mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 11:09:54 +00:00
Add line/col info to parse error in janet_[dobytes, dostring]
This commit is contained in:
parent
3b1d787fbe
commit
3e5bd460a5
@ -79,7 +79,13 @@ int janet_dobytes(JanetTable *env, const uint8_t *bytes, int32_t len, const char
|
||||
const char *e = janet_parser_error(&parser);
|
||||
errflags |= 0x04;
|
||||
ret = janet_cstringv(e);
|
||||
janet_eprintf("parse error in %s: %s\n", sourcePath, e);
|
||||
int32_t line = parser.line;
|
||||
int32_t col = parser.column;
|
||||
if (line > 0 && col > 0) {
|
||||
janet_eprintf("%s:%d:%d: parse error: %s\n", sourcePath, line, col, e);
|
||||
} else {
|
||||
janet_eprintf("%s: parse error: %s\n", sourcePath, e);
|
||||
}
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user