lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have a very small patch that adds the starting line number to the error message of unterminated strings/comments.

Old Message:
lua: test.lua:233: unfinished long string near <eof>


New Message:
lua: test.lua:233: unfinished long string (starting at line 175) near <eof>

The patch simply stores the starting line at the start of the read_long_string function and then uses luaO_pushfstring to format an error string containing the line number should an error occur.

I hope this patch can be of use and, as it is a very trivial patch, I hope it could be added to Lua itself. Knowing where your run-away string started saves time and effort! :)

~Paige

Attachment: lstrerrline.patch
Description: Binary data