added case for missing input of file to main.c

This commit is contained in:
SirTalksalot75 2024-04-22 11:51:27 +02:00 committed by GitHub
parent e90cd80fbe
commit 1cfe9485e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -38,8 +38,16 @@ int main(void) {
FILE* input = fopen("program.gem", "r");
if (input == NULL)
{
printf("Error opening file!\n");
return 1; // Error when opening file
}
yyin = input;
fclose(input);
yyparse();
return 0;
}