Skip to content

Commit

Permalink
Fix a crash reporting an error on the first line.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Feb 3, 2009
1 parent e17978c commit d94b86d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/bootstrap/rtn.lua
Expand Up @@ -72,7 +72,7 @@ CharStream = {}
local lineno = 1
for nl in self.string:sub(0, self.offset):gmatch("[\n\r]") do lineno = lineno + 1 end
local first, last = self.string:sub(0, self.offset):find(".*[\n\r]")
local colno = self.offset - last
local colno = self.offset - (last or 0)
error(string.format("Error parsing grammar %s:\nat line %s, column %s expected '%s', got '%s'", input_filename, lineno, colno, str, actual_str))
end
self.offset = self.offset + str:len()
Expand Down

0 comments on commit d94b86d

Please sign in to comment.