JFR-57: Possible bug in parenthesize of conditional operator
Something changed in the parenthesizer that triggered this bug report by Lennart:> De unit tests falen nu door een fout in de Java pretty-printer/parenthesizer.
Submitted on 8 January 2007 at 15:29
>
> Het komt er op neer dat de volgende twee aterms niet meer gelijk
> zijn, omdat de haakjes wegvallen:
>
> $ echo ‘(x ? y : z) == 6’ | parse-java -s Expr | pp-aterm
> Eq(
> Cond(
> ExprName(Id(“x”))
> , ExprName(Id(“y”))
> , ExprName(Id(“z”))
> )
> , Lit(Deci(“6”))
> )
>
> $ echo ‘(x ? y : z) == 6’ | parse-java -s Expr | pp-java | parse-java
> -s Expr | pp-aterm
> Cond(
> ExprName(Id(“x”))
> , ExprName(Id(“y”))
> , Eq(ExprName(Id(“z”)), Lit(Deci(“6”)))
> )
>
> Hoop dat je er wat mee kan :)
Issue Log
JFR-57, martin:
Dit is vreemd: de == werkt hier wel goed, maar de != niet …martin@nisaaw:~/wc/nix-release/trunk> echo ‘(x ? y : z) == 6’ |
parse-java -s Expr | pp-java | parse-java -s Expr | pp-aterm
Eq(
Cond(
ExprName(Id(“x”))
, ExprName(Id(“y”))
, ExprName(Id(“z”))
)
, Lit(Deci(“6”))
)martin@nisaaw:~/wc/nix-release/trunk> echo ‘(x ? y : z) != 6’ |
parse-java -s Expr | pp-java | parse-java -s Expr | pp-aterm
Cond(
ExprName(Id(“x”))
, ExprName(Id(“y”))
, NotEq(ExprName(Id(“z”)), Lit(Deci(“6”)))
)
JFR-57, martin:
Fixed in Stratego/XT (revision 16366).
Log in to post comments