vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 42fd9e8c772701a011393bf9e1558d440bb8848b
parent 97a03dc80b77476fc05342569b84aca8e5988ef7
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu,  7 Apr 2016 22:53:58 +0200

lexer: update to scintillua-3.6.4-2

Diffstat:
Mlexers/elixir.lua | 2+-
Mlexers/javascript.lua | 12+++++++-----
Mlexers/rexx.lua | 4++--
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git 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 @@ -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 @@ -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.