// process ifdef x ... endifdef blocks static void tok_ifdef(LS tok, IPred isDefined) { // ifdef x or y jreplace_dyn(tok, "ifdef or ", (_tok, cIdx) -> { S flag1 = tok.get(cIdx+2), flag2 = tok.get(cIdx+6); bool value = isDefined.get(flag1) || isDefined.get(flag2); //print("ifdef: " + flag1 + " | " + flag2 + " = " + value); ret "ifdef " + value; }); tok_conditionals(tok, "ifdef", "endifdef", isDefined, true, false); }