aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-11-11 14:36:16 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-11-11 14:36:16 -0300
commit81f4def54f440e045b1401f11ef78b65b56b7abe (patch)
treefe3c6be94cd65269bd4e22d0a737475eb4b79f31 /lcode.c
parente44f3a2ffc7ced5e75cca7657aaa60ef27da89aa (diff)
downloadlua-81f4def54f440e045b1401f11ef78b65b56b7abe.tar.gz
lua-81f4def54f440e045b1401f11ef78b65b56b7abe.tar.bz2
lua-81f4def54f440e045b1401f11ef78b65b56b7abe.zip
Correction in line info for semantic errors
Semantic errors should refer the last used token, not the next one.
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lcode.c b/lcode.c
index d82f8263..95ef900c 100644
--- a/lcode.c
+++ b/lcode.c
@@ -45,6 +45,7 @@ l_noret luaK_semerror (LexState *ls, const char *fmt, ...) {
45 va_list argp; 45 va_list argp;
46 pushvfstring(ls->L, argp, fmt, msg); 46 pushvfstring(ls->L, argp, fmt, msg);
47 ls->t.token = 0; /* remove "near <token>" from final message */ 47 ls->t.token = 0; /* remove "near <token>" from final message */
48 ls->linenumber = ls->lastline; /* back to line of last used token */
48 luaX_syntaxerror(ls, msg); 49 luaX_syntaxerror(ls, msg);
49} 50}
50 51