Report prescan errors on their source lines
Some checks failed
akbasic CI Build / cmake_build (push) Has been cancelled
akbasic CI Build / sanitizers (push) Has been cancelled
akbasic CI Build / coverage (push) Has been cancelled
akbasic CI Build / akgl_build (push) Has been cancelled
akbasic CI Build / mutation_test (push) Has been cancelled
Some checks failed
akbasic CI Build / cmake_build (push) Has been cancelled
akbasic CI Build / sanitizers (push) Has been cancelled
akbasic CI Build / coverage (push) Has been cancelled
akbasic CI Build / akgl_build (push) Has been cancelled
akbasic CI Build / mutation_test (push) Has been cancelled
This commit is contained in:
@@ -160,14 +160,21 @@ akerr_ErrorContext *akbasic_data_scan(akbasic_Runtime *obj)
|
||||
{
|
||||
PREPARE_ERROR(errctx);
|
||||
int64_t i = 0;
|
||||
int64_t entry = 0;
|
||||
|
||||
FAIL_ZERO_RETURN(errctx, (obj != NULL), AKERR_NULLPOINTER, "NULL runtime in data_scan");
|
||||
FAIL_ZERO_RETURN(errctx, (obj->environment != NULL), AKERR_NULLPOINTER,
|
||||
"Runtime has no environment; call akbasic_runtime_init() first");
|
||||
entry = obj->environment->lineno;
|
||||
PASS(errctx, akbasic_data_state_init(&obj->data_state));
|
||||
for ( i = 0; i < AKBASIC_MAX_SOURCE_LINES; i++ ) {
|
||||
if ( obj->source[i].code[0] != '\0' ) {
|
||||
/* Keep BASIC's error prefix on the source line being prescanned. */
|
||||
obj->environment->lineno = i;
|
||||
PASS(errctx, scan_line(&obj->data_state, obj->source[i].code, i));
|
||||
}
|
||||
}
|
||||
obj->environment->lineno = entry;
|
||||
SUCCEED_RETURN(errctx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user