Skip to content
Snippets Groups Projects
Commit 17add357 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Generalize AUTO generation somewhat

parent 3b3238cd
Branches
No related tags found
No related merge requests found
......@@ -17,11 +17,11 @@ class PlutoVariables:
pass
def codegen(self, expr):
m = re.match('([^=]+)=ALL\((.*)\)', expr)
m = re.match('([^=]+)=AND\{(.*),(.*)\}', expr)
if m:
lh = m.group(1)
regexp = m.group(2).replace('*', '.*')
rh = [ "(%s+/SM_Pluto%d_Present)" % (v, self.by_name[v][0])
rh = [ m.group(3).format(v, pluto=self.by_name[v][0])
for v in self.by_name if re.match(regexp, v)]
return("%s=%s" % (lh, '*'.join(rh)))
raise Exception('Invalid expression', expr)
......
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment