Skip to content

Commit

Permalink
Moves read_preproc_directive to loop
Browse files Browse the repository at this point in the history
This is for consistency for both body statement and global statement
parsing.
  • Loading branch information
ChAoSUnItY committed Jan 16, 2024
1 parent 20d3f8d commit e8f111f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,9 +2593,6 @@ void read_global_statement()
char token[MAX_ID_LEN];
block_t *block = &BLOCKS[0]; /* global block */

if (read_preproc_directive())
return;

if (lex_accept(T_struct)) {
int i = 0, size = 0;

Expand Down Expand Up @@ -2756,6 +2753,8 @@ void parse_internal()
lex_expect(T_start);

do {
if (read_preproc_directive())
continue;
read_global_statement();
} while (!lex_accept(T_eof));
}
Expand Down

0 comments on commit e8f111f

Please sign in to comment.