Template for switch() constructs. If the match array can be
sorted in ascending order with gaps no larger than max_gap
between the numbers, a TABLESWITCH instruction is generated, and
a LOOKUPSWITCH otherwise. The former may be more efficient, but
needs more space.
Note, that the key array always will be sorted, though we leave
the original arrays unaltered.