diff options
Diffstat (limited to 'Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua')
-rw-r--r-- | Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua b/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua index fd1aae7f70c..bbb938dc588 100644 --- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua +++ b/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua @@ -1,28 +1,31 @@ local info = { version = 1.002, - comment = "scintilla lpeg lexer for xml cdata", + comment = "scintilla lpeg lexer for xml script", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files", } -local lexer = lexer -local token = lexer.token local P = lpeg.P -local xmlscriptlexer = { _NAME = "xml-script", _FILENAME = "scite-context-lexer-xml-script" } -local whitespace = lexer.WHITESPACE -- triggers states -local context = lexer.context +local lexer = require("lexer") +local context = lexer.context +local patterns = context.patterns -local space = lexer.space -local nospace = 1 - space - (P("</") * P("script") + P("SCRIPT")) * P(">") +local token = lexer.token -local p_spaces = token(whitespace, space ^1) -local p_cdata = token("default", nospace^1) +local xmlscriptlexer = lexer.new("xml-script","scite-context-lexer-xml-script") +local whitespace = xmlscriptlexer.whitespace + +local space = patterns.space +local nospace = 1 - space - (P("</") * P("script") + P("SCRIPT")) * P(">") + +local t_spaces = token(whitespace, space ^1) +local t_script = token("default", nospace^1) xmlscriptlexer._rules = { - { "whitespace", p_spaces }, - { "script", p_cdata }, + { "whitespace", t_spaces }, + { "script", t_script }, } xmlscriptlexer._tokenstyles = context.styleset |