Skip to content

Commit

Permalink
Support empty Lua strings
Browse files Browse the repository at this point in the history
  • Loading branch information
zefhemel committed Oct 3, 2024
1 parent 3cf7b72 commit b2ff858
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/space_lua/lua.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TableConstructor { "{" (field (fieldsep field)* fieldsep?)? "}" }
"\\u{" hex+ "}"
}

simpleString { "'" (stringEscape | ![\r\n\\'])+ "'" | '"' (stringEscape | ![\r\n\\"])+ '"'}
simpleString { "'" (stringEscape | ![\r\n\\'])* "'" | '"' (stringEscape | ![\r\n\\"])* '"'}

hex { $[0-9a-fA-F] }
digit { std.digit }
Expand Down
2 changes: 1 addition & 1 deletion common/space_lua/parse-lua.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/space_lua/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Deno.test("Test Lua parser", () => {
parse("");
// Expression tests
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)`);
Expand Down

0 comments on commit b2ff858

Please sign in to comment.