diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-10-08 20:46:55 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-10-08 20:46:55 +0200 |
commit | 778f381ba6a448ab00d67994a412dd4226d43238 (patch) | |
tree | d9dade45016a572e6c22521bfb165f9829ac3192 /context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua | |
parent | 2073fe5d88215dddd9a9e6421afaea7ab7db955a (diff) | |
download | context-778f381ba6a448ab00d67994a412dd4226d43238.tar.gz |
2021-10-08 20:07:00
Diffstat (limited to 'context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua')
-rw-r--r-- | context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua b/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua index b1304f65c..5e7fa1256 100644 --- a/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua +++ b/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua @@ -6,26 +6,25 @@ local info = { license = "see context related readme files", } -local lexer = require("scite-context-lexer") -local context = lexer.context -local patterns = context.patterns +-- This one is needed because we have spaces in strings and partial lexing depends +-- on them being different. -local token = lexer.token +local lexers = require("scite-context-lexer") -local stringlexer = lexer.new("lua-longstring","scite-context-lexer-lua-longstring") -local whitespace = stringlexer.whitespace +local patterns = lexers.patterns +local token = lexers.token + +local stringlexer = lexers.new("lua-longstring","scite-context-lexer-lua-longstring") local space = patterns.space local nospace = 1 - space -local p_spaces = token(whitespace, space ^1) -local p_string = token("string", nospace^1) +local p_spaces = token("whitespace", space^1) +local p_string = token("string", nospace^1) -stringlexer._rules = { +stringlexer.rules = { { "whitespace", p_spaces }, { "string", p_string }, } -stringlexer._tokenstyles = context.styleset - return stringlexer |