Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Fix last-line-comment match pattern for closures, bump version (0.1.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
regginator committed Jan 6, 2023
1 parent 32a61de commit 3608fd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Codegen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ local function BuildFromSelection(selection, options, log)
local EndStatement = " end" do
local SplitSource = string.split(ScriptSource, "\n")
local LastLine = SplitSource[#SplitSource]
if LastLine and string.find(LastLine, "--") then
-- If the last line has a comment NOT followed by at least a "[" character, it means
-- that it's a full-line comment, and we need to call `end` on the next line
if LastLine and string.match(LastLine, "%-%-[^%[]") then
EndStatement = "\nend"
end
end
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1
0.1.2

0 comments on commit 3608fd3

Please sign in to comment.