moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

Error Reporting: Slicing without *

Open s-ol opened this issue 5 years ago • 0 comments

Using the slice syntax without the asterisk confusing error message. The minimal reproducible example is indeed very minimal:

x[,]
Compile error: [string "moonscript.lua"]:1812: Unknown chain action: slice
stack traceback:
	[C]: in function 'error'
	[string "moonscript.lua"]:1812: in local 'chain_item'
	[string "moonscript.lua"]:1827: in function 'moonscript.compile.value.chain'
	[string "moonscript.lua"]:5985: in function <[string "moonscript.lua"]:5969>
	(...tail calls...)
	[string "moonscript.lua"]:1560: in function 'moonscript.compile.statement.return'
	[string "moonscript.lua"]:6024: in method 'stm'
	[string "moonscript.lua"]:6058: in function <[string "moonscript.lua"]:6049>
	(...tail calls...)

I think this should rather lead to a parse error, and it definitely has to report the error location.

s-ol avatar Feb 02 '20 17:02 s-ol