failing single line if test #5

Merged
probablycorey merged 3 commits from single-line-if into main 2025-10-27 18:31:48 +00:00
Owner

No fix for this yet - wanted to discuss first.

Basically - should single line if statements require an end, just like do?

But regardless of whether we require end or not, single line if statements (without end) parse just fine but don't compile yet.

Currently this test fails with:

Evaluation threw an error:

  ╭───┨ Compiler Error ┃
  │
1 │ if 3 < 9: shire
  │           ═════
  │ Unsupported syntax node: ThenBlock
  │
  ╰───

``
No fix for this yet - wanted to discuss first. Basically - should single line `if` statements require an `end`, just like `do`? But regardless of whether we require `end` or not, single line if statements (without `end`) parse just fine but don't compile yet. Currently this test fails with: ``` Evaluation threw an error: ╭───┨ Compiler Error ┃ │ 1 │ if 3 < 9: shire │ ═════ │ Unsupported syntax node: ThenBlock │ ╰─── ``
defunkt added 1 commit 2025-10-26 02:53:31 +00:00
Author
Owner

UPDATE: Corey is 👍 on adding end to single line IFs.

UPDATE: Corey is 👍 on adding `end` to single line IFs.
probablycorey added 2 commits 2025-10-27 18:30:52 +00:00
probablycorey changed title from WIP: failing single line if test to failing single line if test 2025-10-27 18:31:34 +00:00

Got this working

Got this working
probablycorey merged commit cbd3fe6315 into main 2025-10-27 18:31:48 +00:00

I don't love how I have SingleLineIf and MultiLineIf in the grammar. But when I started to combine the two rules it became a little to complicated. I might try again if I can think of a way to keep it simple.

I don't love how I have SingleLineIf and MultiLineIf in the grammar. But when I started to combine the two rules it became a little to complicated. I might try again if I can think of a way to keep it simple.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: probablycorey/shrimp#5
No description provided.