diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua')
-rw-r--r-- | context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua b/context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua new file mode 100644 index 000000000..5d5b689d2 --- /dev/null +++ b/context/data/textadept/context/lexers/scite-context-lexer-lua-longstring.lua @@ -0,0 +1,32 @@ +local info = { + version = 1.002, + comment = "scintilla lpeg lexer for lua longstrings", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +-- local lexer = require("lexer") +local lexer = require("scite-context-lexer") +local context = lexer.context +local patterns = context.patterns + +local token = lexer.token + +local stringlexer = lexer.new("lua-longstring","scite-context-lexer-lua-longstring") +local whitespace = stringlexer.whitespace + +local space = patterns.space +local nospace = 1 - space + +local p_spaces = token(whitespace, space ^1) +local p_string = token("string", nospace^1) + +stringlexer._rules = { + { "whitespace", p_spaces }, + { "string", p_string }, +} + +stringlexer._tokenstyles = context.styleset + +return stringlexer |