diff --git a/app/imports/parser/grammar.js b/app/imports/parser/grammar.js index ec217527..43f5b70f 100644 --- a/app/imports/parser/grammar.js +++ b/app/imports/parser/grammar.js @@ -1,4 +1,4 @@ -// Generated automatically by nearley, version 2.16.0 +// Generated automatically by nearley, version 2.20.1 // http://github.com/Hardmath123/nearley function id(x) { return x[0]; } @@ -9,8 +9,8 @@ function id(x) { return x[0]; } const lexer = moo.compile({ number: /[0-9]+(?:\.[0-9]+)?/, string: { - match: /'.*?'|".*?"/, - value: s => s.slice(1, -1), + match: /'[^']*'|"[^"]*"/, + value: s => s.slice(1, -1).replace('\\n', '\n'), }, name: { match: /[a-zA-Z_#$]*[a-ce-zA-Z_#$][a-zA-Z0-9_#$]*/, diff --git a/app/imports/parser/grammar.ne b/app/imports/parser/grammar.ne index 51d1ece2..3ebdba75 100644 --- a/app/imports/parser/grammar.ne +++ b/app/imports/parser/grammar.ne @@ -7,8 +7,8 @@ const lexer = moo.compile({ number: /[0-9]+(?:\.[0-9]+)?/, string: { - match: /'.*?'|".*?"/, - value: s => s.slice(1, -1), + match: /'[^']*'|"[^"]*"/, + value: s => s.slice(1, -1).replace('\\n', '\n'), }, name: { match: /[a-zA-Z_#$]*[a-ce-zA-Z_#$][a-zA-Z0-9_#$]*/,