-
-
Notifications
You must be signed in to change notification settings - Fork 43
support for for-else and while-else #513
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
base: main
Are you sure you want to change the base?
Conversation
59d5d93 to
f418f4a
Compare
c42f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upstream reception of this seems overall negative, so I guess we might not do it?
A minor comment if we do ever merge this - for tests we should never depend on VERSION unless really necessary: JuliaSyntax is multi-version aware :)
| if VERSION >= v"1.12-" | ||
| @test parsestmt("for x=xs\ny\nelse\nz\nend") == | ||
| Expr(:for, | ||
| Expr(:(=), :x, :xs), | ||
| Expr(:block, | ||
| LineNumberNode(2), | ||
| :y, | ||
| ), | ||
| Expr(:block, | ||
| LineNumberNode(4), | ||
| :z, | ||
| LineNumberNode(5) | ||
| ) | ||
| ) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if VERSION >= v"1.12-" | |
| @test parsestmt("for x=xs\ny\nelse\nz\nend") == | |
| Expr(:for, | |
| Expr(:(=), :x, :xs), | |
| Expr(:block, | |
| LineNumberNode(2), | |
| :y, | |
| ), | |
| Expr(:block, | |
| LineNumberNode(4), | |
| :z, | |
| LineNumberNode(5) | |
| ) | |
| ) | |
| end | |
| @test parsestmt("for x=xs\ny\nelse\nz\nend", version=v"1.12") == | |
| Expr(:for, | |
| Expr(:(=), :x, :xs), | |
| Expr(:block, | |
| LineNumberNode(2), | |
| :y, | |
| ), | |
| Expr(:block, | |
| LineNumberNode(4), | |
| :z, | |
| LineNumberNode(5) | |
| ) | |
| ) | |
|
Heya, we just moved JuliaSyntax into Base in JuliaLang/julia#59870 - if you want to re-propose this PR over there, I've created a branch https://github.com/JuliaLang/JuliaSyntax.jl/tree/pr-for-Base/513 to make this easier. To make use of the branch, you can use the following steps:
For example: # git clone [email protected]:JuliaLang/julia julia_dir
# cd julia_dir
git remote add JuliaSyntax [email protected]:JuliaLang/JuliaSyntax.jl
git fetch JuliaSyntax
git checkout pr-for-Base/513
git rebase origin/masterSorry this wasn't dealt with prior to the big move! |
companion to JuliaLang/julia#56153