unexpected token

This commit is contained in:
Igor Malovitsa 2024-03-06 00:14:11 +02:00
parent adc393be93
commit c0692c9ffd

4
hbas.c
View file

@ -321,6 +321,7 @@ typedef enum AsmError_e {
ErrTrailingLine, ErrTrailingLine,
ErrNeedDirectiveAfterDot, ErrNeedDirectiveAfterDot,
ErrDirectiveNotImplemented, ErrDirectiveNotImplemented,
ErrUnexpectedToken,
} AsmError; } AsmError;
char *ERRORS[] = { char *ERRORS[] = {
"Success", "Success",
@ -340,6 +341,7 @@ char *ERRORS[] = {
"Encountered trailing identifier after instruction", "Encountered trailing identifier after instruction",
"Expected directive after dot", "Expected directive after dot",
"Directive is not implemented", "Directive is not implemented",
"Unexpected token",
}; };
typedef struct ByteVec_s { typedef struct ByteVec_s {
@ -819,6 +821,8 @@ AsmError assemble(InstHt ht, char *input, size_t len, ByteVec *out, EInfo *einfo
} }
continue; continue;
} }
err = ErrUnexpectedToken;
goto end;
} }
for (size_t ii = 0; ii < holes.len; ii += 1) { for (size_t ii = 0; ii < holes.len; ii += 1) {