Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@capture union problem #180

Open
cstjean opened this issue Mar 30, 2022 · 1 comment
Open

@capture union problem #180

cstjean opened this issue Mar 30, 2022 · 1 comment

Comments

@cstjean
Copy link
Collaborator

cstjean commented Mar 30, 2022

Similar to what was noted in #40 (comment),

julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_)
true

julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_) | someotherpat
false

julia> @capture :(myvariable = 2) (lhs_ = rhs_) | someotherpat
true

The second match should be true as well.

@heyx3
Copy link

heyx3 commented Nov 7, 2023

There's a much simpler example:

julia> @capture(:x, a_Symbol)
true

julia> @capture(:x, (a_Symbol) | (a_::b_))
false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants