Skip to content

Commit

Permalink
Fix: tokens from macro expansion show incorrect position
Browse files Browse the repository at this point in the history
Maybe in the future list all of the macro expansions for a generated token.
  • Loading branch information
positively-charged committed Apr 24, 2017
1 parent 8188386 commit f7b07d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parse/token/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void read_token( struct parse* parse, struct token* token ) {
while ( parse->macro_expan ) {
if ( parse->macro_expan->output ) {
token[ 0 ] = parse->macro_expan->output[ 0 ];
token->pos = parse->macro_expan->pos;
parse->macro_expan->output = token->next;
if ( token->type == TK_MACRONAME ) {
token->type = TK_ID;
Expand Down Expand Up @@ -1023,4 +1024,4 @@ void free_token_list( struct parse* parse, struct token* head,
tail->next = parse->token_free;
parse->token_free = head;
}
}
}

0 comments on commit f7b07d0

Please sign in to comment.