Support empty Lua strings
parent
3cf7b72ebb
commit
b2ff858f1d
|
@ -144,7 +144,7 @@ TableConstructor { "{" (field (fieldsep field)* fieldsep?)? "}" }
|
||||||
"\\u{" hex+ "}"
|
"\\u{" hex+ "}"
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleString { "'" (stringEscape | ![\r\n\\'])+ "'" | '"' (stringEscape | ![\r\n\\"])+ '"'}
|
simpleString { "'" (stringEscape | ![\r\n\\'])* "'" | '"' (stringEscape | ![\r\n\\"])* '"'}
|
||||||
|
|
||||||
hex { $[0-9a-fA-F] }
|
hex { $[0-9a-fA-F] }
|
||||||
digit { std.digit }
|
digit { std.digit }
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const parser = LRParser.deserialize({
|
||||||
],
|
],
|
||||||
skippedNodes: [0,1],
|
skippedNodes: [0,1],
|
||||||
repeatNodeCount: 9,
|
repeatNodeCount: 9,
|
||||||
tokenData: "7_~RuXY#fYZ$Q[]#f]^$_pq#fqr$grs$rst)uuv)zvw*Pwx*Uxy/Syz/Xz{/^{|/c|}/h}!O/o!O!P0c!P!Q0x!Q!R1Y!R![2n![!]4r!]!^5P!^!_5W!_!`5j!`!a5r!c!}6U!}#O6g#O#P#w#P#Q6l#Q#R6q#R#S6U#T#o6U#o#p6v#p#q6{#q#r7Q#r#s7V~#kS#V~XY#f[]#fpq#f#O#P#w~#zQYZ#f]^#f~$VP#U~]^$Y~$_O#U~~$dP#U~YZ$YT$jP!_!`$mT$rOzT~$uWOY%_Z]%_^r%_s#O%_#O#P&S#P;'S%_;'S;=`(d<%lO%_~%bXOY%_Z]%_^r%_rs%}s#O%_#O#P&S#P;'S%_;'S;=`(d<%lO%_~&SO#Z~~&VZrs%_wx%_!Q![&x#O#P%_#T#U%_#U#V%_#Y#Z%_#b#c%_#i#j(j#l#m)]#n#o%_~&{ZOY%_Z]%_^r%_rs%}s!Q%_!Q!['n![#O%_#O#P&S#P;'S%_;'S;=`(d<%lO%_~'qZOY%_Z]%_^r%_rs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|
|
|
@ -9,7 +9,7 @@ Deno.test("Test Lua parser", () => {
|
||||||
parse("");
|
parse("");
|
||||||
// Expression tests
|
// Expression tests
|
||||||
parse(
|
parse(
|
||||||
`e(1, 1.2, -3.8, +4, #lst, true, false, nil, "string", "Hello there \x00", ...)`,
|
`e(1, 1.2, -3.8, +4, #lst, true, false, nil, "string", "", "Hello there \x00", ...)`,
|
||||||
);
|
);
|
||||||
|
|
||||||
parse(`e(10 << 10, 10 >> 10, 10 & 10, 10 | 10, 10 ~ 10)`);
|
parse(`e(10 << 10, 10 >> 10, 10 & 10, 10 | 10, 10 ~ 10)`);
|
||||||
|
|
Loading…
Reference in New Issue