diff options
| author | mitchell <unknown> | 2020-07-14 10:09:33 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-07-14 10:09:33 -0400 |
| commit | a4a5a6907acf6361618a8aa723a4bacc489f270a (patch) | |
| tree | d1a946fe3d01eb3403bd602ee06a241f4089426d /lexlua/apl.lua | |
| parent | 6dcfbc6a747c0a20e21b53ef0a780bc0ad24da05 (diff) | |
| download | scintilla-mirror-a4a5a6907acf6361618a8aa723a4bacc489f270a.tar.gz | |
lexlua: Minor pattern refactoring.
Diffstat (limited to 'lexlua/apl.lua')
| -rw-r--r-- | lexlua/apl.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lexlua/apl.lua b/lexlua/apl.lua index ad0ec2d99..c7de3075f 100644 --- a/lexlua/apl.lua +++ b/lexlua/apl.lua @@ -3,7 +3,7 @@ local lexer = require('lexer') local token, word_match = lexer.token, lexer.word_match -local P, R, S = lpeg.P, lpeg.R, lpeg.S +local P, S = lpeg.P, lpeg.S local lex = lexer.new('apl') @@ -20,7 +20,7 @@ local dq_str = lexer.range('"') lex:add_rule('string', token(lexer.STRING, sq_str + dq_str)) -- Numbers. -local dig = R('09') +local dig = lexer.digit local rad = P('.') local exp = S('eE') local img = S('jJ') @@ -31,12 +31,12 @@ lex:add_rule('number', token(lexer.NUMBER, float * img * float + float)) -- Keywords. lex:add_rule('keyword', token(lexer.KEYWORD, P('⍞') + 'χ' + '⍺' + '⍶' + '⍵' + - '⍹' + '⎕' * R('AZ', 'az')^0)) + '⍹' + '⎕' * lexer.alpha^0)) -- Names. -local n1l = R('AZ', 'az') +local n1l = lexer.alpha local n1b = P('_') + '∆' + '⍙' -local n2l = n1l + R('09') +local n2l = n1l + lexer.digit local n2b = n1b + '¯' local n1 = n1l + n1b local n2 = n2l + n2b |
