Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eval_atom and eval_neg_atom function #5

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/larktools/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def eval_atom(node, env):
varname = get_value(child)
return env[varname]
elif child_name == "neg_atom":
return eval_neg_atom(node, env)
return eval_neg_atom(child, env)
elif child_name == "bracketed_arith_expr":
return eval_bracketed_arith_expr(child, env)

Expand All @@ -100,7 +100,7 @@ def eval_neg_atom(node, env):
# character. Therefore, it doesn't appear among the child nodes
child = get_children(node)[0]
assert get_name(child) == "atom"
julia-sprenger marked this conversation as resolved.
Show resolved Hide resolved
return (-eval_atom(node, env))
return (-eval_atom(child, env))


def eval_bracketed_arith_expr(node, env):
Expand Down
Loading