miniscript
miniscript copied to clipboard
Parsing errors in compiler: Missing an "else if" or "end if" in if-statement
Steps to Reproduce:
- Compile the following:
func = function()
if false then
return "This is returned"
if true then
return "This should be returned"
end if
return ""
end function
print(func)
Output:
This is returned
Actual Results: Compilation was successful.
Expected Results: Compiler error, unmatched block opener.
Additional information:
- The function is necessary for compilation to successfully fail.
- Try without the function to see expected error.
- The issue was observed in the game GreyHack.
Confirmed. Thank you for the report.
This is caused by end function just discarding function parsing context without checking for unclosed backpatches.
Simplified "working" example for this issue:
func = function
if 0 then
print "this if is ignored"
end function
func