diff options
Diffstat (limited to 'lexers')
| -rw-r--r-- | lexers/elixir.lua | 2 | ||||
| -rw-r--r-- | lexers/javascript.lua | 12 | ||||
| -rw-r--r-- | lexers/rexx.lua | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/lexers/elixir.lua b/lexers/elixir.lua index 264f713..5ec27c0 100644 --- a/lexers/elixir.lua +++ b/lexers/elixir.lua @@ -2,7 +2,7 @@ -- Contributed by Richard Philips. -- Elixer LPeg lexer. -local l = lexer +local l = require('lexer') local token, style, color, word_match = l.token, l.style, l.color, l.word_match local B, P, R, S = lpeg.B, lpeg.P, lpeg.R, lpeg.S diff --git a/lexers/javascript.lua b/lexers/javascript.lua index feb212b..f879948 100644 --- a/lexers/javascript.lua +++ b/lexers/javascript.lua @@ -18,9 +18,11 @@ local comment = token(l.COMMENT, line_comment + block_comment) -- Strings. local sq_str = l.delimited_range("'") local dq_str = l.delimited_range('"') +local template_str = l.delimited_range('`') local regex_str = #P('/') * l.last_char_includes('+-*%^!=&|?:;,([{<>') * l.delimited_range('/', true) * S('igm')^0 -local string = token(l.STRING, sq_str + dq_str) + token(l.REGEX, regex_str) +local string = token(l.STRING, sq_str + dq_str + template_str) + + token(l.REGEX, regex_str) -- Numbers. local number = token(l.NUMBER, l.float + l.integer) @@ -31,10 +33,10 @@ local keyword = token(l.KEYWORD, word_match{ 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'double', 'else', 'enum', 'export', 'extends', 'false', 'final', 'finally', 'float', 'for', 'function', 'goto', 'if', 'implements', 'import', 'in', 'instanceof', 'int', - 'interface', 'let', 'long', 'native', 'new', 'null', 'package', 'private', - 'protected', 'public', 'return', 'short', 'static', 'super', 'switch', - 'synchronized', 'this', 'throw', 'throws', 'transient', 'true', 'try', - 'typeof', 'var', 'void', 'volatile', 'while', 'with', 'yield' + 'interface', 'let', 'long', 'native', 'new', 'null', 'of', 'package', + 'private', 'protected', 'public', 'return', 'short', 'static', 'super', + 'switch', 'synchronized', 'this', 'throw', 'throws', 'transient', 'true', + 'try', 'typeof', 'var', 'void', 'volatile', 'while', 'with', 'yield' }) -- Identifiers. diff --git a/lexers/rexx.lua b/lexers/rexx.lua index 582d86e..c750168 100644 --- a/lexers/rexx.lua +++ b/lexers/rexx.lua @@ -16,8 +16,8 @@ local block_comment = l.nested_pair('/*', '*/') local comment = token(l.COMMENT, line_comment + block_comment) -- Strings. -local sq_str = l.delimited_range("'", true) -local dq_str = l.delimited_range('"', true) +local sq_str = l.delimited_range("'", true, true) +local dq_str = l.delimited_range('"', true, true) local string = token(l.STRING, sq_str + dq_str) -- Numbers. |
