add if statement and declaration

This commit is contained in:
2025-07-13 03:34:31 +01:00
parent 744e3c281d
commit f7ff3393f0
36 changed files with 587 additions and 165 deletions

View File

@@ -8,9 +8,7 @@ ArErr lexer(LexerState state) {
int ch;
while ((ch = fgetc(state.file)) != EOF) {
if (ch == 0 || (ch < 0x20 && ch != '\n' && ch != '\r' && ch != '\t')) {
fprintf(stderr, "%s:%zu:%zu error: disallowed character\n", state.path,
line, column);
exit(1);
return create_err(line, column, 1, state.path, "Syntax Error", "disallowed character");
}
if (ch == '\n') {