summaryrefslogtreecommitdiff
path: root/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua
diff options
context:
space:
mode:
Diffstat (limited to 'context/data/scite/lexers/scite-context-lexer-xml-cdata.lua')
-rw-r--r--context/data/scite/lexers/scite-context-lexer-xml-cdata.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua b/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua
new file mode 100644
index 000000000..71826099c
--- /dev/null
+++ b/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua
@@ -0,0 +1,22 @@
+local lexer = lexer
+local token = lexer.token
+local P = lpeg.P
+
+module(...)
+
+local commentlexer = _M
+
+local whitespace = commentlexer.WHITESPACE -- triggers states
+
+local space = lexer.space
+local nospace = 1 - space - P("]]>")
+
+local p_spaces = token(whitespace, space ^1)
+local p_cdata = token("comment", nospace^1)
+
+_rules = {
+ { "whitespace", p_spaces },
+ { "cdata", p_cdata },
+}
+
+_tokenstyles = lexer.context.styleset