Correction in line info for semantic errors
Semantic errors should refer the last used token, not the next one.
This commit is contained in:
1
lcode.c
1
lcode.c
@@ -45,6 +45,7 @@ l_noret luaK_semerror (LexState *ls, const char *fmt, ...) {
|
||||
va_list argp;
|
||||
pushvfstring(ls->L, argp, fmt, msg);
|
||||
ls->t.token = 0; /* remove "near <token>" from final message */
|
||||
ls->linenumber = ls->lastline; /* back to line of last used token */
|
||||
luaX_syntaxerror(ls, msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user