[qfcc] Accept @id as one token in macro bodies

I'm undecided about @ in macro names, but treating @id as one token in
the body is necessary with the single-pass tokenizing. Fixes an infinite
macro expansion loop in vecaddr.r (`#define dot @dot`), but that's
really only a bandaid for *that* issue as there are plenty of other
cases where macros will loop.
This commit is contained in:
Bill Currie 2023-10-30 13:28:45 +09:00
parent 071e529b0e
commit ab34cb7df4

View file

@ -246,7 +246,7 @@ pp_vnumber '({s}*{m}?{pp_number}){2,4}{s}*'{ULFD}?
return tok;
}
} }
<PREPROC,MACRO>{ID} { return PRE_ID; }
<PREPROC>{ID} { return PRE_ID; }
<PREPROC>{ID}\( { return PRE_IDp; }
<ARGS>\r*\n { next_line (yylloc, yyscanner); return -rua_space; }
@ -265,7 +265,7 @@ pp_vnumber '({s}*{m}?{pp_number}){2,4}{s}*'{ULFD}?
<PREEXPR>defined { return PRE_DEFINED; }
<PREEXPR>{ID} { return PRE_ID; }
<INITIAL,ARGS>{
<INITIAL,ARGS,MACRO>{
{ID} |
@{ID} { return -rua_id; }
}