Skip to content

Commit 2eba3ce

Browse files
xpqzalecthomas
authored andcommitted
Update APL lexer to cope with current Dyalog APL
* Names can start with underscore * Missing APL primitive ops: ⍥@⌺⌶⍢ * Missing APL primitive funcs: ⊆⍸
1 parent b71f4c6 commit 2eba3ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lexers/a/apl.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func aplRules() Rules {
2626
{`[⋄◇()]`, Punctuation, nil},
2727
{`[\[\];]`, LiteralStringRegex, nil},
2828
{`⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameFunction, nil},
29-
{`[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameVariable, nil},
29+
{`[A-Za-zΔ∆⍙_][A-Za-zΔ∆⍙_¯0-9]*`, NameVariable, nil},
3030
{`¯?(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},
31-
{`[\.\\/⌿⍀¨⍣⍨⍠⍤∘]`, NameAttribute, nil},
32-
{`[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]`, Operator, nil},
31+
{`[\.\\/⌿⍀¨⍣⍨⍠⍤∘⍥@⌺⌶⍢]`, NameAttribute, nil},
32+
{`[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗⊆⍸]`, Operator, nil},
3333
{`⍬`, NameConstant, nil},
3434
{`[⎕⍞]`, NameVariableGlobal, nil},
3535
{`[←→]`, KeywordDeclaration, nil},

0 commit comments

Comments
 (0)