Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| creating:statements [2025/06/13 20:13] – Removed PrintStream parameter from Interpreter constructor ahelwer | creating:statements [2025/06/18 20:42] (current) – Fixed stale line of code due to print changes ahelwer | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| defineAst(outputDir, | defineAst(outputDir, | ||
| - | " | + | " |
| )); | )); | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | The '' | ||
| ===== Parsing statements ===== | ===== Parsing statements ===== | ||
| Line 58: | Line 60: | ||
| Our '' | Our '' | ||
| + | Use '' | ||
| We'll return to this method later to add parsing logic for operator definitions. | We'll return to this method later to add parsing logic for operator definitions. | ||
| - | |||
| <code java> | <code java> | ||
| private Stmt statement() { | private Stmt statement() { | ||
| - | if (replMode) return new Stmt.Print(expression()); | + | if (replMode) return new Stmt.Print(peek(), |
| throw error(peek(), | throw error(peek(), | ||
| Line 199: | Line 201: | ||
| <code java [highlight_lines_extra=" | <code java [highlight_lines_extra=" | ||
| defineAst(outputDir, | defineAst(outputDir, | ||
| - | " | + | " |
| " | " | ||
| )); | )); | ||