Open mieszko opened 1 year ago
The same issue also affects BSV. Given this code:
package Foo;
Integer foo;
foo = 1 + 2 * 3 + 4;
Integer bar;
bar = 1 + (2 * 3) + 4;
Integer baz;
baz = (1 + 2) * 3 + 4;
Integer qux;
qux = 1 + 2 * (3 + 4);
endpackage
Compiling this with -dparsed
yields:
package Foo;
Integer foo;
foo = 1 + 2 * 3 + 4;
Integer bar;
bar = 1 + 2 * 3 + 4;
Integer baz;
baz = 1 + 2 * 3 + 4;
Integer qux;
qux = 1 + 2 * 3 + 4;
endpackage: Foo
Pretty-printing BH code that has infix operators at different precedences is bugged.
Example input:
Compiling with
-dparsed
yields:which loses all the precedence information from the parens, so if it's fed back to
bsc
it produces different semantics.This is related to #568 (although that is a separate CSyntax cons); they should probably be fixed together.