Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
right side of left associative operators at equal binding strength go…
…t wrong parens!! Summary: New codegen ``` /* CREATE PROC foo () BEGIN DECLARE x INTEGER NOT NULL; SET x := 1 * (2 / 3); SET x := 1 + 2 / 3; SET x := 1 + (2 - 3); SET x := 1 + 2 * 3; SET x := 1 * (2 + 3); SET x := 1 - (2 + 3); SET x := 1 - (2 - 3); SET x := 1 - 2 - (2 - 3); SET x := 1 / 2 / 3; SET x := 1 / (2 / 3); END; */ #undef _PROC_ #define _PROC_ "foo" void foo(void) { cql_int32 x = 0; x = 1 * (2 / 3); x = 1 + 2 / 3; x = 1 + (2 - 3); x = 1 + 2 * 3; x = 1 * (2 + 3); x = 1 - (2 + 3); x = 1 - (2 - 3); x = 1 - 2 - (2 - 3); x = 1 / 2 / 3; x = 1 / (2 / 3); } ``` OLD codegen... so wrong... ``` #undef _PROC_ #define _PROC_ "foo" void foo(void) { cql_int32 x = 0; x = 1 * 2 / 3; // wrong x = 1 + 2 / 3; x = 1 + 2 - 3; // wrong (because could be floating point) x = 1 + 2 * 3; x = 1 * (2 + 3); x = 1 - 2 + 3; // wrong x = 1 - 2 - 3; // wrong x = 1 - 2 - 2 - 3; // wrong x = 1 / 2 / 3; x = 1 / 2 / 3; // wrong } ``` Reviewed By: RaoulFoaleng Differential Revision: D25080502 fbshipit-source-id: 8421709b1e93a30171c60be4924995ff16aefa19
- Loading branch information
1 parent
96dce74
commit 47e78dd
Showing
7 changed files
with
657 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.