Skip to content

Commit

Permalink
Merge pull request #456 from douglasjacobsen/update_is_node_error
Browse files Browse the repository at this point in the history
Update `is` node error
  • Loading branch information
rfbgo authored Apr 4, 2024
2 parents e0c3eda + be74588 commit 9d3e7ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ramble/ramble/expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ def perform_math_eval(self, in_str):
except MathEvaluationError as e:
logger.debug(f' Math input is: "{in_str}"')
logger.debug(e)
except RambleSyntaxError as e:
raise RambleSyntaxError(f'{str(e)} in "{in_str}"')

return in_str

Expand Down Expand Up @@ -711,6 +713,9 @@ def _eval_comparisons(self, node):
if len(node.ops) == 1 and isinstance(node.ops[0], ast.In):
return self._eval_comp_in(node)

if len(node.ops) == 1 and isinstance(node.ops[0], ast.Is):
raise RambleSyntaxError('Encountered unsupported operator `is`')

# Try to evaluate the comparison logic, if not return the node as is.
try:
cur_left = self.eval_math(node.left)
Expand Down

0 comments on commit 9d3e7ef

Please sign in to comment.