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

allow @foo{...} macro calls #34505

Merged
merged 4 commits into from
Jan 28, 2020
Merged

allow @foo{...} macro calls #34505

merged 4 commits into from
Jan 28, 2020

Conversation

stevengj
Copy link
Member

Closes #34498.

@stevengj stevengj added the parser Language parsing and surface syntax label Jan 24, 2020
@stevengj
Copy link
Member Author

Unrelated windows temp-file errors in CI.

@stevengj
Copy link
Member Author

stevengj commented Jan 25, 2020

Hmm, I'm getting (from this PR):

julia> :(@foo{bar}(baz))
ERROR: syntax: invalid macro usage "@(foo{bar})"

I think we probably want @foo{bar}(baz) to parse as (@foo {bar})(baz), similar to how :(@foo[bar](baz)) is already parsed. I'll look into it.

Update: Fixed.

@JeffBezanson
Copy link
Sponsor Member

This still doesn't seem to be fully general, e.g. @m{a}{b} doesn't work. I think instead parse-call-chain could be modified ala 6c4e30e, which made @a[i] work.

@stevengj
Copy link
Member Author

stevengj commented Jan 25, 2020

What should @m{a}{b} parse to? I guess :((@m{a}){b})

@stevengj
Copy link
Member Author

As @JeffBezanson, suggested, I moved the implementation to the parse-call-chain function, which indeed seems to make it much simpler and more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow @foo{...} macro calls
2 participants