From 2eba3ce9a1fdbaf81232257031297aa153372575 Mon Sep 17 00:00:00 2001 From: Stefan kruger Date: Thu, 19 Aug 2021 14:52:54 +0100 Subject: [PATCH] Update APL lexer to cope with current Dyalog APL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Names can start with underscore * Missing APL primitive ops: ⍥@⌺⌶⍢ * Missing APL primitive funcs: ⊆⍸ --- lexers/a/apl.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lexers/a/apl.go b/lexers/a/apl.go index 6cf1ea05d..f929d2e2b 100644 --- a/lexers/a/apl.go +++ b/lexers/a/apl.go @@ -26,10 +26,10 @@ func aplRules() Rules { {`[⋄◇()]`, Punctuation, nil}, {`[\[\];]`, LiteralStringRegex, nil}, {`⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameFunction, nil}, - {`[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameVariable, nil}, + {`[A-Za-zΔ∆⍙_][A-Za-zΔ∆⍙_¯0-9]*`, NameVariable, nil}, {`¯?(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}, - {`[\.\\/⌿⍀¨⍣⍨⍠⍤∘]`, NameAttribute, nil}, - {`[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]`, Operator, nil}, + {`[\.\\/⌿⍀¨⍣⍨⍠⍤∘⍥@⌺⌶⍢]`, NameAttribute, nil}, + {`[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗⊆⍸]`, Operator, nil}, {`⍬`, NameConstant, nil}, {`[⎕⍞]`, NameVariableGlobal, nil}, {`[←→]`, KeywordDeclaration, nil},