// process ifdef x ... endifdef blocks static void tok_ifdef(LS tok) { // 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(flag1) || isDefined(flag2); print("ifdef: " + flag1 + " | " + flag2 + " = " + value); print("All flags: " + definitions); ret "ifdef " + value; }); tok_conditionals(tok, "ifdef", "endifdef", id -> definitions.contains(id), true, false); }