I have a list of tuples that I need to emit a C-like boolean expression from:
ranges = [('a','z'),('0','9'),('_','_')]
my template:
"$ranges:{'$it.0$'<=c&&c<='$it.1$'}; separator='||'$"
this outputs:
'a'<=c&&c<='z'||'0'<=c&&c<='9'||'_'<=c&&c<='_'
I would like to check if $it.0$
is the same as $it.1$
and output c==='$it.0$'
in this case (in my example this would generate c==='_'
for the last tuple). Is this possible?