Skip to content

Commit

Permalink
fix(tokenizer): Correctly terminate long comments based on depth and …
Browse files Browse the repository at this point in the history
…closing bracket
  • Loading branch information
bytexenon committed Jun 26, 2024
1 parent 21a6f57 commit 7d48b31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion the-tiny-lua-compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ function Tokenizer.tokenize(code)
consume() -- Consume the "=" character
closingDepth = closingDepth + 1
end
if closingDepth == depth then break end
if curChar == "]" and closingDepth == depth then break end
elseif curChar == "\0" then
error("Unclosed long comment")
end
Expand Down

0 comments on commit 7d48b31

Please sign in to comment.