Skip to content

Commit

Permalink
Controls: catch rule matching exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTipson committed Sep 29, 2024
1 parent 9a87b02 commit f12d4fb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ export default function Controls(props: ControlsProps) {
let expr = machine.expr;
try {
if (expr instanceof identifier) expr = machine.env.find_value(expr);
} catch (e) { } // error should get reported by ProgramView
for (let rule of machine.ruleset) {
let result = rule.match(expr, machine.env, machine.s, machine.h);
if (result) {
definition = rule.definition;
explanation = rule.explanation;
break;
for (let rule of machine.ruleset) {
let result = rule.match(expr, machine.env, machine.s, machine.h);
if (result) {
definition = rule.definition;
explanation = rule.explanation;
break;
}
}
}
} catch (e) { } // error should get reported by ProgramView

/**
* Handle changes to the markers and update the state
Expand Down

0 comments on commit f12d4fb

Please sign in to comment.