Skip to content

Commit 364723f

Browse files
committed
Better error message for unescaped newlines in string literals.
1 parent f566363 commit 364723f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

preprocess.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ function tokenize(s, path, allowBacktickStrings, allowMetaTokens)
513513
end
514514
ptr = ptr+2
515515

516+
elseif c == "\n" then
517+
-- Can't have unescaped newlines. Lua, this is a silly rule! @Ugh
518+
return nil, errorInFile(s, path, ptr, "Tokenizer", "Newlines must be escaped in strings.")
519+
516520
else
517521
ptr = ptr+1
518522
end

0 commit comments

Comments
 (0)