Fixing formatting for above:
if exp ~ ('mask_shl', int:size, int:offset, -offset, :e): ...
vs if type(exp) == tuple and len(exp) == 5 and exp[0]=='mask_shl' and type(exp[1])==int aand type(exp[2])==int and exp[3] == -exp[1]:
size, offset, e = exp[1], exp[2], exp[4]
...
To give you an example, let's look at this statement:
if exp ~ ('mask_shl', int:size, int:offset, -offset, :e): ...
It is the same as writing: if type(exp) == tuple and len(exp) == 5 and exp[0]=='mask_shl' and type(exp[1])==int aand type(exp[2])==int and exp[3] == -exp[1]: size, offset, e = exp[1], exp[2], exp[4] ...
If you can figure out syntax that makes this sort of matches more readable, I'll gladly use it :)