Fix ignoring joins in stringify in preprocessor (#5777)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2025-02-13 18:33:12 -05:00
committed by GitHub
parent f753ae2518
commit ffb02cea15
4 changed files with 51 additions and 0 deletions
+5
View File
@@ -1065,6 +1065,11 @@ int V3PreProcImp::getStateToken() {
// FALLTHRU, handle as with VP_SYMBOL_JOIN
}
}
if (state() == ps_STRIFY) {
// Ignore joins and symbol joins in stringify as they don't affect the final string
if (tok == VP_JOIN) goto next_tok;
if (tok == VP_SYMBOL_JOIN) tok = VP_SYMBOL;
}
if (tok == VP_SYMBOL_JOIN // not else if, can fallthru from above if()
|| tok == VP_DEFREF_JOIN || tok == VP_JOIN) {
// a`` -> string doesn't include the ``, so can just grab next and continue