def t_STRING(t):
r'\$[^$]*\$'
t.value = t.value[1:-1]
+ t.value = re.sub("\n\s*", "", t.value)
return t
def t_FUNCALL(t):
for dim in t[2]:
res += '[' + print_C_expr(dim) + ']'
return res
+ elif t[0] == 'funptr':
+ return t[1]
elif t[0] == 'apply':
madfunc = t[1][:-1]
return madfunc_map.get(madfunc, madfunc) + '(' + ', '.join(map(prinC1, t[2])) + ')'
# Put them after every newline, then remove if they're followed
# by whitespace and a continuation digit
source = source.replace("\n", " eos\n")
- source = re.sub('eos\n(\s*)[0-9]+', '\n\\1', source)
+ source = re.sub('eos\n(\s*)[0-9]+\s*', '\n\\1', source)
# Transform some adjacent groups of keywords into
# agglomerates. This lets us get away with stuff like SET LIST
# TO LIST that the parser would otherwise choke on, because