From 81f4def54f440e045b1401f11ef78b65b56b7abe Mon Sep 17 00:00:00 2001 From: Roberto I Date: Tue, 11 Nov 2025 14:36:16 -0300 Subject: Correction in line info for semantic errors Semantic errors should refer the last used token, not the next one. --- lcode.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lcode.c') 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, ...) { va_list argp; pushvfstring(ls->L, argp, fmt, msg); ls->t.token = 0; /* remove "near " from final message */ + ls->linenumber = ls->lastline; /* back to line of last used token */ luaX_syntaxerror(ls, msg); } -- cgit v1.2.3-55-g6feb