diff options
Diffstat (limited to 'Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua')
-rw-r--r-- | Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua index 1956071b747..0fd238d63f4 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua @@ -90,7 +90,7 @@ local t_number = token("number", real) -- t_reference = token("number", cardinal) -- * t_spacing -- * token("number", cardinal) -local t_reserved = token("number", P("true") + P("false") + P("null")) +local t_reserved = token("number", P("true") + P("false") + P("NULL")) -- t_reference = token("warning", cardinal * spacing * cardinal * spacing) -- * token("keyword", p_reference) local t_reference = token("warning", cardinal) @@ -121,31 +121,17 @@ local t_stream = token("keyword", p_stream) * token("text", (1 - p_endstream)^1) * token("keyword", p_endstream) -local t_other = t_constant + t_reference + t_string + t_unicode + t_number + t_reserved + t_whatsit - local t_dictionary = { "dictionary", - dictionary = t_opendictionary - * (t_spaces * t_keyword * t_spaces * V("whatever"))^0 - * t_spaces - * t_closedictionary, - array = t_openarray - * (t_spaces * V("whatever"))^0 - * t_spaces - * t_closearray, - whatever = V("dictionary") - + V("array") - + t_other, + dictionary = t_opendictionary * (t_spaces * t_keyword * t_spaces * V("whatever"))^0 * t_spaces * t_closedictionary, + array = t_openarray * (t_spaces * V("whatever"))^0 * t_spaces * t_closearray, + whatever = V("dictionary") + V("array") + t_constant + t_reference + t_string + t_unicode + t_number + t_reserved + t_whatsit, } local t_object = { "object", -- weird that we need to catch the end here (probably otherwise an invalid lpeg) dictionary = t_dictionary.dictionary, array = t_dictionary.array, whatever = t_dictionary.whatever, - object = t_openobject - * t_spaces - * (V("dictionary") * t_spaces * t_stream^-1 + V("array") + t_other) - * t_spaces - * t_closeobject, + object = t_openobject * t_spaces * (V("dictionary")^-1 * t_spaces * t_stream^-1 + V("array") + V("number") + t_spaces) * t_spaces * t_closeobject, number = t_number, } |