apl.go

 1package a
 2
 3import (
 4	. "github.com/alecthomas/chroma" // nolint
 5	"github.com/alecthomas/chroma/lexers/internal"
 6)
 7
 8// Apl lexer.
 9var Apl = internal.Register(MustNewLexer(
10	&Config{
11		Name:      "APL",
12		Aliases:   []string{"apl"},
13		Filenames: []string{"*.apl"},
14		MimeTypes: []string{},
15	},
16	Rules{
17		"root": {
18			{`\s+`, Text, nil},
19			{`[⍝#].*$`, CommentSingle, nil},
20			{`\'((\'\')|[^\'])*\'`, LiteralStringSingle, nil},
21			{`"(("")|[^"])*"`, LiteralStringDouble, nil},
22			{`[β‹„β—‡()]`, Punctuation, nil},
23			{`[\[\];]`, LiteralStringRegex, nil},
24			{`βŽ•[A-Za-zΞ”βˆ†β™][A-Za-zΞ”βˆ†β™_Β―0-9]*`, NameFunction, nil},
25			{`[A-Za-zΞ”βˆ†β™][A-Za-zΞ”βˆ†β™_Β―0-9]*`, NameVariable, nil},
26			{`¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?`, LiteralNumber, nil},
27			{`[\.\\/βŒΏβ€Β¨β£β¨β β€βˆ˜]`, NameAttribute, nil},
28			{`[+\-Γ—Γ·βŒˆβŒŠβˆ£|⍳?*βŸβ—‹!⌹<≀=>β‰₯β‰ β‰‘β‰’βˆŠβ·βˆͺ∩~∨∧⍱⍲⍴,βͺβŒ½βŠ–β‰β†‘β†“βŠ‚βŠƒβŒ·β‹β’βŠ€βŠ₯β•βŽβŠ£βŠ’ββ‚β‰ˆβŒΈβ―β†—]`, Operator, nil},
29			{`⍬`, NameConstant, nil},
30			{`[βŽ•βž]`, NameVariableGlobal, nil},
31			{`[←→]`, KeywordDeclaration, nil},
32			{`[βΊβ΅βΆβΉβˆ‡:]`, NameBuiltinPseudo, nil},
33			{`[{}]`, KeywordType, nil},
34		},
35	},
36))