diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-07-29 12:25:54 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-07-30 00:41:56 +0200 |
commit | afd78c1f30ce5d32d0a8dbce72e76d7871903f2f (patch) | |
tree | 01593400061a70383be36b45736f2b4e4ba0ea0f | |
parent | e1c3db05168d0417b3ac5465517c7e6957b28bb5 (diff) |
compiler: fix reported source position in inc/dec operator error
Report the proper source location when raising an error due to an
increment/decrement operation on a constant value.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | compiler.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -871,7 +871,7 @@ uc_compiler_emit_inc_dec(uc_compiler_t *compiler, uc_tokentype_t toktype, bool i varname = compiler->upvals.entries[cidx].name; if (varname) - uc_compiler_syntax_error(compiler, 0, + uc_compiler_syntax_error(compiler, compiler->parser->prev.pos, "Invalid increment/decrement of constant '%s'", ucv_string_get(varname)); |