diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-11-11 14:36:16 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-11-11 14:36:16 -0300 |
| commit | 81f4def54f440e045b1401f11ef78b65b56b7abe (patch) | |
| tree | fe3c6be94cd65269bd4e22d0a737475eb4b79f31 /lcode.c | |
| parent | e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa (diff) | |
| download | lua-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
| @@ -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 | ||
