summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua')
-rw-r--r--Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua b/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua
index 1a2a2571d4c..96c5e9c3cb9 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua
+++ b/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua
@@ -70,6 +70,9 @@ local any = lexer.any
local dquote = P('"')
local cstoken = R("az","AZ") + P("_")
+local mptoken = R("az","AZ")
+local leftbrace = P("{")
+local rightbrace = P("}")
local number = context.patterns.real
local cstokentex = R("az","AZ","\127\255") + S("@!?_")
@@ -97,6 +100,14 @@ local special = token('special', S("#()[]{}<>=:\"")) -- or else := <> etc s
local texlike = token('warning', P("\\") * cstokentex^1)
local extra = token('extra', S("`~%^&_-+*/\'|\\"))
+local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace }
+local texlike = token('embedded', P("\\") * (P("MP") + P("mp")) * mptoken^1)
+ * spacing^0
+ * token('grouping', leftbrace)
+ * token('rest', (nested + (1-rightbrace))^0 )
+ * token('grouping', rightbrace)
+ + token('warning', P("\\") * cstokentex^1)
+
metafunlexer._rules = {
{ 'whitespace', spacing },
{ 'comment', comment },
@@ -118,9 +129,11 @@ metafunlexer._rules = {
metafunlexer._tokenstyles = context.styleset
+metafunlexer._foldpattern = R("az")^2 -- separate entry else interference
+
metafunlexer._foldsymbols = {
_patterns = {
- "%l+",
+ '[a-z][a-z]+',
},
["primitive"] = {
["beginfig"] = 1,