-
Notifications
You must be signed in to change notification settings - Fork 69
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
Inconsistent formatting for unary operators #281
Comments
@eschnett can you post what the input, output and expected output would be? I'm pretty confused right now lol |
The input and expected output are both +++x == 0
++++x == 0
⋆⋆x == 0
⋆⋆⋆x == 0
⋆⋆⋆⋆x == 0 It's a variable |
Hmm this might be an issue with CSTParser, the parsed CST looks a little weird
I would think those would be another 1
|
I didn't know where was a However, there is still the other issue with the julia> CSTParser.parse("⋆⋆⋆⋆x")
1:13 BinaryOpCall
1:6 UnaryOpCall
1:3 OP: STAR_OPERATOR
4:6 OP: STAR_OPERATOR
7:9 OP: STAR_OPERATOR
10:13 UnaryOpCall
10:12 OP: STAR_OPERATOR
13:13 x This parse is different that what Julia itself does: julia> :(⋆⋆⋆⋆x) |> dump
Expr
head: Symbol call
args: Array{Any}((2,))
1: Symbol ⋆
2: Expr
head: Symbol call
args: Array{Any}((2,))
1: Symbol ⋆
2: Expr
head: Symbol call
args: Array{Any}((2,))
1: Symbol ⋆
2: Expr
head: Symbol call
args: Array{Any}((2,))
1: Symbol ⋆
2: Symbol x |
The code below is the result of formatting several lines where
x
is prefixed by a sequence of unary operators (+
and\star
). In the input, there was no white space between the operators. JuliaFormatter seems to misinterpret the unary operators as binary operators.The text was updated successfully, but these errors were encountered: