support for for-else and while-else#513
Open
simeonschaub wants to merge 1 commit into
Open
Conversation
59d5d93 to
f418f4a
Compare
c42f
reviewed
Dec 22, 2024
c42f
left a comment
Member
There was a problem hiding this comment.
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 :)
Comment on lines
+192
to
+206
| 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 |
Member
There was a problem hiding this comment.
Suggested change
| 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) | |
| ) | |
| ) | |
Member
|
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 git@github.com:JuliaLang/julia julia_dir
# cd julia_dir
git remote add JuliaSyntax git@github.com: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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
companion to JuliaLang/julia#56153