- case opid2('-','P'): return fold_op_neg (fold, a);
- case opid2('!','P'): return fold_op_not (fold, a);
- case opid1('+'): return fold_op_add (fold, a, b);
- case opid1('-'): return fold_op_sub (fold, a, b);
- case opid1('*'): return fold_op_mul (fold, a, b);
- case opid1('/'): return fold_op_div (fold, a, b);
- case opid1('%'): return fold_op_mod (fold, a, b);
- case opid1('|'): return fold_op_bor (fold, a, b);
- case opid1('&'): return fold_op_band (fold, a, b);
- case opid1('^'): return fold_op_xor (fold, a, b);
- case opid2('<','<'): return fold_op_lshift (fold, a, b);
- case opid2('>','>'): return fold_op_rshift (fold, a, b);
- case opid2('|','|'): return fold_op_andor (fold, a, b, true);
- case opid2('&','&'): return fold_op_andor (fold, a, b, false);
- case opid2('?',':'): return fold_op_tern (fold, a, b, c);
- case opid2('*','*'): return fold_op_exp (fold, a, b);
- case opid3('<','=','>'): return fold_op_lteqgt (fold, a, b);
- case opid2('!','='): return fold_op_cmp (fold, a, b, true);
- case opid2('=','='): return fold_op_cmp (fold, a, b, false);
- case opid2('~','P'): return fold_op_bnot (fold, a);
+ fold_op_case(2, ('-', 'P'), neg, (fold, a));
+ fold_op_case(2, ('!', 'P'), not, (fold, a));
+ fold_op_case(1, ('+'), add, (fold, a, b));
+ fold_op_case(1, ('-'), sub, (fold, a, b));
+ fold_op_case(1, ('*'), mul, (fold, a, b));
+ fold_op_case(1, ('/'), div, (fold, a, b));
+ fold_op_case(1, ('%'), mod, (fold, a, b));
+ fold_op_case(1, ('|'), bor, (fold, a, b));
+ fold_op_case(1, ('&'), band, (fold, a, b));
+ fold_op_case(1, ('^'), xor, (fold, a, b));
+ fold_op_case(2, ('<', '<'), lshift, (fold, a, b));
+ fold_op_case(2, ('>', '>'), rshift, (fold, a, b));
+ fold_op_case(2, ('|', '|'), andor, (fold, a, b, true));
+ fold_op_case(2, ('&', '&'), andor, (fold, a, b, false));
+ fold_op_case(2, ('?', ':'), tern, (fold, a, b, c));
+ fold_op_case(2, ('*', '*'), exp, (fold, a, b));
+ fold_op_case(3, ('<','=','>'), lteqgt, (fold, a, b));
+ fold_op_case(2, ('!', '='), cmp, (fold, a, b, true));
+ fold_op_case(2, ('=', '='), cmp, (fold, a, b, false));
+ fold_op_case(2, ('~', 'P'), bnot, (fold, a));