diff options
-rw-r--r-- | compiler.c | 6 | ||||
-rw-r--r-- | tests/custom/04_modules/06_export_errors | 1 |
2 files changed, 3 insertions, 4 deletions
@@ -187,10 +187,8 @@ uc_compiler_syntax_error(uc_compiler_t *compiler, size_t off, const char *fmt, . off = uc_program_function_srcpos(compiler->function, uc_compiler_current_chunk(compiler)->count); - if (off) { - byte = off; - line = uc_source_get_line(source, &byte); - } + byte = off; + line = uc_source_get_line(source, &byte); va_start(ap, fmt); len = xvasprintf(&s, fmt, ap); diff --git a/tests/custom/04_modules/06_export_errors b/tests/custom/04_modules/06_export_errors index 5c9f676..83227b1 100644 --- a/tests/custom/04_modules/06_export_errors +++ b/tests/custom/04_modules/06_export_errors @@ -10,6 +10,7 @@ export let x = 1; -- Expect stderr -- Syntax error: Exports may only appear at top level of a module +In line 1, byte 1: `export let x = 1;` ^-- Near here |