do not create an output upon encountering an error

This commit is contained in:
anon 2024-07-08 19:35:02 +02:00
parent 843dc44921
commit 95478b2f5b
3 changed files with 11 additions and 4 deletions

View File

@ -14,6 +14,8 @@
tommy_hashtable variable_table;
int has_encountered_error = 0;
char * scope = NULL;
int is_program_found = 0;
#if DEBUG == 1
@ -164,6 +166,8 @@ void issue_error(const char * const format, ...) {
extern char * yyfilename;
extern int yylineno;
has_encountered_error = 1;
va_list args;
va_start(args, format);

View File

@ -22,6 +22,8 @@ typedef struct {
extern int system_type;
extern int has_encountered_error;
extern char * scope;
extern int eaxhla_init(void);

View File

@ -43,9 +43,10 @@ signed main(int argc, char * argv[]) {
yyparse();
assemble (t_count, t_array);
dump ("test_me_please");
if (!has_encountered_error) {
assemble (t_count, t_array);
dump ("test_me_please");
}
yyfree_leftovers();
@ -54,7 +55,7 @@ signed main(int argc, char * argv[]) {
free (token_array);
free (t_array);
return 0;
return has_encountered_error;
}
void append_token (int t) {