Skip to content
Snippets Groups Projects
Commit 14c2b15a authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Evaluate tuples. Fix parser.

parent 5f0d5e80
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,9 @@ class EvaluationMapper(RecursiveMapper):
def map_max(self, expr):
return min(self.rec(child) for child in expr.children)
def map_tuple(self, expr):
return tuple(self.rec(child) for child in expr)
......
......@@ -37,7 +37,7 @@ _LEX_TABLE = [
(_identifier, pytools.lex.RE(r"[a-z_A-Z_][a-zA-Z_0-9]*")),
(_whitespace, pytools.lex.RE("[ \n\t]*")),
(_comma, pytools.lex.RE(",")),
(_dot, pytools.lex.RE(".")),
(_dot, pytools.lex.RE(r"\.")),
]
_PREC_COMMA = 5
......@@ -107,6 +107,7 @@ def parse(expr_str):
pstate.advance()
did_something = True
elif next_tag is _dot and _PREC_CALL > min_precedence:
1/0
pstate.advance()
pstate.expect(_identifier)
left_exp = primitives.Lookup(left_exp, pstate.next_str())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment