Skip to content

Conversation

MiryangJung
Copy link
Contributor

@MiryangJung MiryangJung commented Apr 6, 2025

I used the existing Token.Bar, it looks like there's a conflict with the | used in pattern matching, so I'm looking into it.

@cometkim cometkim mentioned this pull request Apr 11, 2025
@cometkim
Copy link
Member

cometkim commented Apr 13, 2025

Ok, this is actually ambiguous.

switch n { | n => n | 1 // ^ Is this an or-pattern or binary expression?

This is tricky because we don't force a delimiter at the end of the pattern (like , in Rust)

We can put it in a new region to avoid ambiguity

switch n { | n => { n | 1 } // or.... | n => ( n | 1 )

The problem is that our formatter actively tries to wipe it out.

@cometkim
Copy link
Member

Maybe reviving local open syntax would help to deal with this kind of ambiguity

@cometkim cometkim mentioned this pull request Apr 14, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants