Bug 396490: [metalua] there are some problems with metalua and incomplete invocation.
diff --git a/metalua/grammar/generator.lua b/metalua/grammar/generator.lua index 15dddf8..078b291 100644 --- a/metalua/grammar/generator.lua +++ b/metalua/grammar/generator.lua
@@ -177,9 +177,13 @@ ------------------------------------------------------------------------------- function M.parse_error(lx, fmt, ...) local li = lx:lineinfo_left() - local line, column, offset - if li then line, column, offset = li.line, li.column, li.offset - else line, column, offset = -1, -1, -1 end + local line, column, offset, positions + if li then + line, column, offset = li.line, li.column, li.offset + positions = { first = li, last = li } + else + line, column, offset = -1, -1, -1 + end local msg = string.format("line %i, char %i: "..fmt, line, column, ...) local src = lx.src @@ -192,7 +196,7 @@ msg = string.format("%s\n>>> %s\n>>> %s", msg, srcline, idx) end lx :kill() - return { tag='Error', msg } + return { tag='Error', msg , lineinfo = positions } end function M.wrap_error(lx, nchildren, tag, ...)