sbarisic/gluac

Errors not outputting file name next to line number.

samuelmaddock opened this issue · 6 comments

When gluac detects a syntax error in code, it doesn't output the file name as luac does. Instead, it seems to output the first string in the file itself. Here's an example to what I'm referring to.

>luac -p commands.lua
luac: commands.lua:11: unexpected symbol near '!'

>gluac -p commands.lua
error: [string "include( 'prop_tools.lua' )..."]:16: ']' expected near 'if'

When running luac, the file name is visible in the output. However, gluac seems to be outputting [string "include( 'prop_tools.lua' )..."] in its place.

Fixed

While the string's contents seem to be fixed, the error message formatting is still off:

>gluac -p test.lua
error: [string "test.lua"]:1: unexpected symbol near 'then'

What exactly is wrong with the error message formatting?

You mean [string "test.lua"]:1: instead of test.lua:1:?

Okay, changed [string "whatever"]:... to whatever:...

Sorry for the late response, that is what I meant. Thanks for fixing this.