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

Use K"function" for short form function AST #466

Merged
merged 6 commits into from
Jul 30, 2024
Merged

Conversation

c42f
Copy link
Member

@c42f c42f commented Jul 19, 2024

Fix #465 - see rationale there.

Fixing this turned out to be quite easy.

Compat:

  • This is a breaking change to the JuliaSyntax AST
  • Non-breaking for Expr

@c42f c42f changed the title Use K"function" for short form funtion AST Use K"function" for short form function AST Jul 19, 2024
@domluna
Copy link

domluna commented Jul 20, 2024

looks good to me. Does it handle all 4 of these?

f(x) = 10
f(x)::R = 10
f(x::T) where T = 10
f(x::T)::R where T = 10

@c42f c42f mentioned this pull request Jul 23, 2024
c42f added 3 commits July 25, 2024 08:09
This is semantically incorrect and will be caught by lowering. But
technically making it a parser error would be breaking :-(
This is a simple fix for the tests, but a better solution is to make
Expr equivalence more permissive to accommodate having better line
information in the new parser!
@c42f c42f force-pushed the caf/short-form-function-head branch from 6eab9b6 to 6694b89 Compare July 24, 2024 22:09
@c42f
Copy link
Member Author

c42f commented Jul 24, 2024

Does it handle all 4 of these?

Yes!

c42f added 3 commits July 29, 2024 15:33
This form isn't a short form function definition, so should be parsed
with `=` kind.
@c42f c42f merged commit 25f8eb2 into main Jul 30, 2024
36 checks passed
@c42f c42f deleted the caf/short-form-function-head branch July 30, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AST of short form functions
2 participants