I was getting confused about some parsing errors while working on match
expressions. Claude thinks this is the issue.
Looking at these two snapshots, the key difference is indentation:
basic_tag_union.md (works correctly):
match color {
Red => 1
Blue => 2
Green => 3
}
boolean_patterns.md (fails to parse):
match isReady {
True => "ready to go!"
False => "not ready yet"
}
The working version uses tabs for indentation, while the broken version uses 4 spaces. You can see this in the token positions:
UpperIdent(2:2-2:5)
- pattern starts at column 2 (tab indentation)UpperIdent(2:5-2:9)
- pattern starts at column 5 (4-space indentation)I'm going to investigate a bit further and try and fix. @Anthony Bullard FYI
Ignore the above... on deeper inspection I can see the issue is with parsing string literals instead
We don't expect any comma's between match
branches right? ... I've modified the parser to use newlines and it seems to be happy now.
Luke Boswell has marked this topic as resolved.
Luke Boswell said:
We don't expect any comma's between
match
branches right? ... I've modified the parser to use newlines and it seems to be happy now.
Hmm, I seem to remember something about that, I think it was in a conversation with @Anthony Bullard
i do too, but can't remember where it was or what the outcome was
I think ideally we don't need them
Last updated: Jul 06 2025 at 12:14 UTC