-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 x[i,j;k] syntax to be parsed #8250
allow x[i,j;k] syntax to be parsed #8250
Conversation
It's nice that after #8190 this also prints correctly. |
Thanks for taking care of this. This is pretty much right, but I found this:
|
I thought that this syntax was supposed to be parseable but still not valid Julia syntax (so that the JUMP guys could use it in their macros, but it remains an invalid Julia expression)? Obviously it would be better to agree on what this would mean and make it valid syntax as well. I don't see how |
Parsing |
I agree it is sketchy, what would you like to do? Throw a better error message? (Something like, |
Yeah that would be better, until we figure something else out. |
We currently give this error for cell arrays: julia> {1,2;3,4}
ERROR: unsupported or misplaced expression parameters would it be sufficient to make the error messages the same (for 0.3)? We could always come back and clean up this up later for 0.4. As JUMP will probably be using 0.3 for a while, it would be nice to backport this change for them. |
Backporting this to 0.3 would be fantastic for us, if that's a reasonable request. Thanks for this, @jakebolewski! |
💯 |
Updated now that the 0.3.1 window is closing. This should preserve the old syntax error behavior now. julia> [1,2;3,4]
ERROR: syntax: unexpected semicolon in array expression
julia> {1,2;3,4}
ERROR: syntax: unexpected semicolon in array expression
julia> Int[1,2;3,4]
ERROR: syntax: unexpected semicolon in array expression
julia> [1,2;a=3]
ERROR: syntax: unexpected semicolon in array expression
julia> {1,2;a=3}
ERROR: syntax: unexpected semicolon in array expression
julia> Int[1,2;a=3]
ERROR: syntax: unexpected semicolon in array expression |
c3df3dc
to
f8e66b8
Compare
👍 |
(receive | ||
(kws args) (separate kwarg? (cdddr e)) | ||
(lower-kw-call f (append kws (cdr (caddr e))) args)))) | ||
(if (eq? f 'vcat) |
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.
This doesn't work, because it gives
julia> vcat(x;a=1)
ERROR: syntax: unexpected semicolon in array expression
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.
I don't know why I didn't add the check when expanding 'vcat, will fix.
f8e66b8
to
6a70d54
Compare
@JeffBezanson can you have another look at this so it can be backported? |
allow x[i,j;k] syntax to be parsed
👍 |
Awesome, thanks @jakebolewski! |
Is this one causing the |
Was it this or 7f2cf32? |
I did a |
Was there any problem with this, or is it time to backport to I've used my quota for mistakes this week, so someone else will have to do the honours 😜 |
895639a :) |
See #7225 && JuliaLang/JuliaParser.jl#8