Skip to content

Commit

Permalink
Merge pull request #3 from CodeVisionaries/fix_eval_neg_atom
Browse files Browse the repository at this point in the history
Fix eval neg atom
  • Loading branch information
julia-sprenger authored Oct 2, 2024
2 parents ead7af8 + e5a4695 commit c852d83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/larktools/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
def eval_arith_expr(node, env):
child = get_children(node)[0]
child_name = get_name(child)
if child_name != "sum":
breakpoint()
assert child_name == "sum"
return eval_sum(child, env)

Expand Down Expand Up @@ -99,10 +97,10 @@ def eval_atom(node, env):
def eval_neg_atom(node, env):
# the "-" character appearing in the production rule is
# filtered out by lark by default because it is a constant
# character. Thereore, it doesn't appear among the child nodes
# character. Therefore, it doesn't appear among the child nodes
child = get_children(node)[0]
assert get_name(child) == "atom"
return eval_atom(node, env)
return (-eval_atom(node, env))


def eval_bracketed_arith_expr(node, env):
Expand Down

0 comments on commit c852d83

Please sign in to comment.