Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| creating:safety [2025/09/02 19:25] – Finished first draft with challenges ahelwer | creating:safety [2025/11/03 23:16] (current) – Removed extra line of code ahelwer | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| Iterate through all the spec statements to find them: | Iterate through all the spec statements to find them: | ||
| - | <code java [highlight_lines_extra=" | + | <code java [highlight_lines_extra=" |
| private final Interpreter interpreter; | private final Interpreter interpreter; | ||
| private Stmt.OpDef init = null; | private Stmt.OpDef init = null; | ||
| Line 68: | Line 68: | ||
| this.interpreter = interpreter; | this.interpreter = interpreter; | ||
| for (Stmt unit : spec) { | for (Stmt unit : spec) { | ||
| - | if (unit instanceof Stmt.OpDef) { | + | if (unit instanceof Stmt.OpDef |
| - | Stmt.OpDef op = (Stmt.OpDef)unit; | + | |
| switch (op.name.lexeme) { | switch (op.name.lexeme) { | ||
| - | case " | + | case " |
| - | case " | + | case " |
| - | case " | + | case " |
| - | case " | + | case " |
| - | case " | + | case " |
| } | } | ||
| } | } | ||