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

order in unions #98

Open
tpapp opened this issue Sep 8, 2018 · 1 comment
Open

order in unions #98

tpapp opened this issue Sep 8, 2018 · 1 comment

Comments

@tpapp
Copy link

tpapp commented Sep 8, 2018

Not sure if this is a documentation issue or a bug, but order matters:

julia> (@capture :(struct Foo{X} end) struct (T_{params__}|T_) fields__ end), T
(true, :Foo)

julia> (@capture :(struct Foo{X} end) struct (T_|T_{params__}) fields__ end), T
(true, :(Foo{X}))
@MikeInnes
Copy link
Member

Yes, this is just something we should document. MacroTools is more like a regex than a CSS selector; it doesn't have any concept of "better" matches and just takes the first valid one.

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