Repository: alecthomas/chroma
Pull request #1091 (2025-06-20 03:25:18)

Add MoonScript lexer
This change...

* Generates a MoonScript lexer with the `pygments2chroma_xml.py` script using Pygments version 2.19.1
* Replaces `rexexp2`-incompatible Python-style patterns with [compatible ones][1]:
    - Capture group pattern `?P<name>` with .NET-style `?<name>`
    - Named back reference `?P=name` with ECMAScript-style `\k<name>`
* Removes `and`, `or`, and `not` from the Keyword rule, since they are also listed under the OperatorWord rule
* Fixes incorrect string escape rules discovered while writing the test data
* Adds test data for the lexer

[1]: <https://github.com/dlclark/regexp2?tab=readme-ov-file#compare-regexp-and-regexp2>


Patch:
diff --git a/lexers/embedded/moonscript.xml b/lexers/embedded/moonscript.xml
new file mode 100644
index 0000000..293f538
--- /dev/null
+++ b/lexers/embedded/moonscript.xml
@@ -0,0 +1,83 @@
+
+<lexer>
+  <config>
+    <name>MoonScript</name>
+    <alias>moonscript</alias>
+    <alias>moon</alias>
+    <filename>*.moon</filename>
+    <mime_type>text/x-moonscript</mime_type>
+    <mime_type>application/x-moonscript</mime_type>
+  </config>
+  <rules>
+    <state name="root">
+      <rule pattern="#!(.*?)$"><token type="CommentPreproc"/></rule>
+      <rule><push state="base"/></rule>
+    </state>
+    <state name="base">
+      <rule pattern="--.*$"><token type="CommentSingle"/></rule>
+      <rule pattern="(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?"><token type="LiteralNumberFloat"/></rule>
+      <rule pattern="(?i)\d+e[+-]?\d+"><token type="LiteralNumberFloat"/></rule>
+      <rule pattern="(?i)0x[0-9a-f]*"><token type="LiteralNumberHex"/></rule>
+      <rule pattern="\d+"><token type="LiteralNumberInteger"/></rule>
+      <rule pattern="\n"><token type="TextWhitespace"/></rule>
+      <rule pattern="[^\S\n]+"><token type="Text"/></rule>
+      <rule pattern="(?s)\[(=*)\[.*?\]\1\]"><token type="LiteralString"/></rule>
+      <rule pattern="(-&gt;|=&gt;)"><token type="NameFunction"/></rule>
+      <rule pattern=":[a-zA-Z_]\w*"><token type="NameVariable"/></rule>
+      <rule pattern="(==|!=|~=|&lt;=|&gt;=|\.\.\.|\.\.|[=+\-*/%^&lt;&gt;#!.\\:])"><token type="Operator"/></rule>
+      <rule pattern="[;,]"><token type="Punctuation"/></rule>
+      <rule pattern="[\[\]{}()]"><token type="KeywordType"/></rule>
+      <rule pattern="[a-zA-Z_]\w*:"><token type="NameVariable"/></rule>
+      <rule pattern="(class|extends|if|then|super|do|with|import|export|while|elseif|return|for|in|from|when|using|else|switch|break)\b"><token type="Keyword"/></rule>
+      <rule pattern="(true|false|nil)\b"><token type="KeywordConstant"/></rule>
+      <rule pattern="(and|or|not)\b"><token type="OperatorWord"/></rule>
+      <rule pattern="(self)\b"><token type="NameBuiltinPseudo"/></rule>
+      <rule pattern="@@?([a-zA-Z_]\w*)?"><token type="NameVariableClass"/></rule>
+      <rule pattern="[A-Z]\w*"><token type="NameClass"/></rule>
+      <rule pattern="(_G|_VERSION|assert|collectgarbage|dofile|error|getmetatable|ipairs|load|loadfile|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|select|setmetatable|tonumber|tostring|type|warn|xpcall|bit32\.arshift|bit32\.band|bit32\.bnot|bit32\.bor|bit32\.btest|bit32\.bxor|bit32\.extract|bit32\.lrotate|bit32\.lshift|bit32\.replace|bit32\.rrotate|bit32\.rshift|coroutine\.close|coroutine\.create|coroutine\.isyieldable|coroutine\.resume|coroutine\.running|coroutine\.status|coroutine\.wrap|coroutine\.yield|debug\.debug|debug\.gethook|debug\.getinfo|debug\.getlocal|debug\.getmetatable|debug\.getregistry|debug\.getupvalue|debug\.getuservalue|debug\.sethook|debug\.setlocal|debug\.setmetatable|debug\.setupvalue|debug\.setuservalue|debug\.traceback|debug\.upvalueid|debug\.upvaluejoin|io\.close|io\.flush|io\.input|io\.lines|io\.open|io\.output|io\.popen|io\.read|io\.stderr|io\.stdin|io\.stdout|io\.tmpfile|io\.type|io\.write|math\.abs|math\.acos|math\.asin|math\.atan|math\.atan2|math\.ceil|math\.cos|math\.cosh|math\.deg|math\.exp|math\.floor|math\.fmod|math\.frexp|math\.huge|math\.ldexp|math\.log|math\.max|math\.maxinteger|math\.min|math\.mininteger|math\.modf|math\.pi|math\.pow|math\.rad|math\.random|math\.randomseed|math\.sin|math\.sinh|math\.sqrt|math\.tan|math\.tanh|math\.tointeger|math\.type|math\.ult|package\.config|package\.cpath|package\.loaded|package\.loadlib|package\.path|package\.preload|package\.searchers|package\.searchpath|require|os\.clock|os\.date|os\.difftime|os\.execute|os\.exit|os\.getenv|os\.remove|os\.rename|os\.setlocale|os\.time|os\.tmpname|string\.byte|string\.char|string\.dump|string\.find|string\.format|string\.gmatch|string\.gsub|string\.len|string\.lower|string\.match|string\.pack|string\.packsize|string\.rep|string\.reverse|string\.sub|string\.unpack|string\.upper|table\.concat|table\.insert|table\.move|table\.pack|table\.remove|table\.sort|table\.unpack|utf8\.char|utf8\.charpattern|utf8\.codepoint|utf8\.codes|utf8\.len|utf8\.offset)\b"><token type="NameBuiltin"/></rule>
+      <rule pattern="[A-Za-z_]\w*"><token type="Name"/></rule>
+      <rule pattern="&#x27;"><token type="LiteralStringSingle"/><combined state="stringescape" state="sqs"/></rule>
+      <rule pattern="&quot;"><token type="LiteralStringDouble"/><combined state="stringescape" state="dqs"/></rule>
+    </state>
+    <state name="stringescape">
+      <rule pattern="\\([abfnrtv\\&quot;\&#x27;]|\d{1,3})"><token type="LiteralStringEscape"/></rule>
+    </state>
+    <state name="sqs">
+      <rule pattern="&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
+      <rule pattern="[^\\&#x27;]+"><token type="LiteralString"/></rule>
+    </state>
+    <state name="dqs">
+      <rule pattern="&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
+      <rule pattern="[^\\&quot;]+"><token type="LiteralString"/></rule>
+    </state>
+    <state name="ws">
+      <rule pattern="(?:--\[(?&lt;level&gt;=*)\[[\w\W]*?\](\k&lt;level&gt;)\])"><token type="CommentMultiline"/></rule>
+      <rule pattern="(?:--.*$)"><token type="CommentSingle"/></rule>
+      <rule pattern="(?:\s+)"><token type="TextWhitespace"/></rule>
+    </state>
+    <state name="varname">
+      <rule><include state="ws"/></rule>
+      <rule pattern="\.\."><token type="Operator"/><pop depth="1"/></rule>
+      <rule pattern="[.:]"><token type="Punctuation"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)(?=(?:(?:--\[(?&lt;level&gt;=*)\[[\w\W]*?\](\k&lt;level&gt;)\])|(?:--.*$)|(?:\s+))*[.:])"><token type="NameProperty"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)(?=(?:(?:--\[(?&lt;level&gt;=*)\[[\w\W]*?\](\k&lt;level&gt;)\])|(?:--.*$)|(?:\s+))*\()"><token type="NameFunction"/><pop depth="1"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)"><token type="NameProperty"/><pop depth="1"/></rule>
+    </state>
+    <state name="funcname">
+      <rule><include state="ws"/></rule>
+      <rule pattern="[.:]"><token type="Punctuation"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)(?=(?:(?:--\[(?&lt;level&gt;=*)\[[\w\W]*?\](\k&lt;level&gt;)\])|(?:--.*$)|(?:\s+))*[.:])"><token type="NameClass"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)"><token type="NameFunction"/><pop depth="1"/></rule>
+      <rule pattern="\("><token type="Punctuation"/><pop depth="1"/></rule>
+    </state>
+    <state name="goto">
+      <rule><include state="ws"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)"><token type="NameLabel"/><pop depth="1"/></rule>
+    </state>
+    <state name="label">
+      <rule><include state="ws"/></rule>
+      <rule pattern="::"><token type="Punctuation"/><pop depth="1"/></rule>
+      <rule pattern="(?:[^\W\d]\w*)"><token type="NameLabel"/></rule>
+    </state>
+  </rules>
+</lexer>
\ No newline at end of file


Test patch:
diff --git a/lexers/testdata/moonscript.actual b/lexers/testdata/moonscript.actual
new file mode 100644
index 0000000..ebca564
--- /dev/null
+++ b/lexers/testdata/moonscript.actual
@@ -0,0 +1,141 @@
+#!/usr/local/bin/moon
+
+-- a comment
+
+.01
+0.1
+1.5E+3
+.3e-2
+
+2E3
+1e-12
+
+0x
+0xff
+0x56
+
+1024
+
+[[long
+format
+string]]
+
+[[nested [=[
+long format]=] string
+]]
+
+->
+-> ->
+(a) -> a + 1
+
+=>
+=> =>
+(b, c=1) =>
+  b + @d / c
+
+:var
+
+==
+!=
+~=
+<=
+>=
+...
+..
+=
++
+-
+*
+/
+%
+^
+<
+>
+#
+!
+.
+\
+:
+
+a = (b, c) -> b += 1; b, c
+
+[]
+{}
+()
+
+var: var
+
+class
+extends
+if
+then
+super
+do
+with
+import
+export
+while
+elseif
+return
+for
+in
+from
+when
+using
+else
+switch
+break
+
+true
+false
+nil
+
+and
+or
+not
+
+self
+
+@
+@@
+@var
+@@var
+
+Name
+LongName
+LOUD_NAME
+L337N4m3
+Forbidden_Name
+
+assert
+error
+warn
+type
+pairs
+ipairs
+coroutine.create
+debug.debug
+io.open
+math.max
+require
+os.execute
+string.len
+table.insert
+utf8.len
+
+_
+_name
+name
+nA_Me
+n4m3
+
+"double"
+'single'
+"multi
+line"
+'multi
+line'
+"escaped\"
+quote"
+'escaped\'
+quote'
diff --git a/lexers/testdata/moonscript.expected b/lexers/testdata/moonscript.expected
new file mode 100644
index 0000000..63b77a4
--- /dev/null
+++ b/lexers/testdata/moonscript.expected
@@ -0,0 +1,295 @@
+[
+  {"type":"CommentPreproc","value":"#!/usr/local/bin/moon"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"CommentSingle","value":"-- a comment"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralNumberFloat","value":".01"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberFloat","value":"0.1"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberFloat","value":"1.5E+3"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberFloat","value":".3e-2"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralNumberFloat","value":"2E3"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberFloat","value":"1e-12"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralNumberHex","value":"0x"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberHex","value":"0xff"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralNumberHex","value":"0x56"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralNumberInteger","value":"1024"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralString","value":"[[long\nformat\nstring]]"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralString","value":"[[nested [=[\nlong format]=] string\n]]"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameFunction","value":"-\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameFunction","value":"-\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"-\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordType","value":"("},
+  {"type":"Name","value":"a"},
+  {"type":"KeywordType","value":")"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"-\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"a"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"+"},
+  {"type":"Text","value":" "},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameFunction","value":"=\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameFunction","value":"=\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"=\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordType","value":"("},
+  {"type":"Name","value":"b"},
+  {"type":"Punctuation","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"c"},
+  {"type":"Operator","value":"="},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"KeywordType","value":")"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"=\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Text","value":"  "},
+  {"type":"Name","value":"b"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"+"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableClass","value":"@d"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"/"},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"c"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameVariable","value":":var"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"Operator","value":"=="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"!="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"~="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"\u003c="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"\u003e="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"..."},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":".."},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"="},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"+"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"-"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"*"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"/"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"%"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"^"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"\u003c"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"\u003e"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"#"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"!"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"."},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":"\\"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Operator","value":":"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"Name","value":"a"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"="},
+  {"type":"Text","value":" "},
+  {"type":"KeywordType","value":"("},
+  {"type":"Name","value":"b"},
+  {"type":"Punctuation","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"c"},
+  {"type":"KeywordType","value":")"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"-\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"b"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"+="},
+  {"type":"Text","value":" "},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Punctuation","value":";"},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"b"},
+  {"type":"Punctuation","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"c"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"KeywordType","value":"[]"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordType","value":"{}"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordType","value":"()"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameVariable","value":"var:"},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"var"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"Keyword","value":"class"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"extends"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"if"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"then"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"super"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"do"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"with"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"import"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"export"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"while"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"elseif"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"return"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"for"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"in"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"from"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"when"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"using"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"else"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"switch"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Keyword","value":"break"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"KeywordConstant","value":"true"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordConstant","value":"false"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"KeywordConstant","value":"nil"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"OperatorWord","value":"and"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"OperatorWord","value":"or"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"OperatorWord","value":"not"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameBuiltinPseudo","value":"self"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameVariableClass","value":"@"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameVariableClass","value":"@@"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameVariableClass","value":"@var"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameVariableClass","value":"@@var"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameClass","value":"Name"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameClass","value":"LongName"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameClass","value":"LOUD_NAME"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameClass","value":"L337N4m3"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameClass","value":"Forbidden_Name"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"NameBuiltin","value":"assert"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"error"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"warn"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"type"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"pairs"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"ipairs"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"coroutine.create"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"debug.debug"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"io.open"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"math.max"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"require"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"os.execute"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"string.len"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"table.insert"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"NameBuiltin","value":"utf8.len"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"Name","value":"_"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Name","value":"_name"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Name","value":"name"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Name","value":"nA_Me"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"Name","value":"n4m3"},
+  {"type":"TextWhitespace","value":"\n\n"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"LiteralString","value":"double"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"LiteralString","value":"single"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"LiteralString","value":"multi\nline"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"LiteralString","value":"multi\nline"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"LiteralString","value":"escaped"},
+  {"type":"LiteralStringEscape","value":"\\\""},
+  {"type":"LiteralString","value":"\nquote"},
+  {"type":"LiteralStringDouble","value":"\""},
+  {"type":"TextWhitespace","value":"\n"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"LiteralString","value":"escaped"},
+  {"type":"LiteralStringEscape","value":"\\'"},
+  {"type":"LiteralString","value":"\nquote"},
+  {"type":"LiteralStringSingle","value":"'"},
+  {"type":"TextWhitespace","value":"\n"}
+]