forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lcompilers#773 from Thirumalai-Shaktivel/boolop
[New] Handle Boolop operands similar to CPython AST
- Loading branch information
Showing
5 changed files
with
52 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
a and b | ||
a and b or c | ||
a or b | ||
a or b and c | ||
|
||
(a and b and c or (x or (y and (z or i)) or j)) | ||
(a and (b and (c or d)) and (e and f) or x) and y | ||
|
||
# # TODO: Make this work similar to Old Parser | ||
# (a or b and c) or z |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"basename": "ast_new-statements2-c4cdc5f", | ||
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", | ||
"infile": "tests/parser/statements2.py", | ||
"infile_hash": "a20fee19d7b8e6f8689f6badc2726fd618524af0aba84a7d0d0e5af5", | ||
"outfile": null, | ||
"outfile_hash": null, | ||
"stdout": "ast_new-statements2-c4cdc5f.stdout", | ||
"stdout_hash": "8b8d1514ec03d6081c0e716170ff41615cb00f9745a71e153f25179c", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(Module [(Expr (BoolOp And [(Name a Load) (Name b Load)])) (Expr (BoolOp Or [(BoolOp And [(Name a Load) (Name b Load)]) (Name c Load)])) (Expr (BoolOp Or [(Name a Load) (Name b Load)])) (Expr (BoolOp Or [(Name a Load) (BoolOp And [(Name b Load) (Name c Load)])])) (Expr (BoolOp Or [(BoolOp And [(Name a Load) (Name b Load) (Name c Load)]) (BoolOp Or [(Name x Load) (BoolOp And [(Name y Load) (BoolOp Or [(Name z Load) (Name i Load)])]) (Name j Load)])])) (Expr (BoolOp And [(BoolOp Or [(BoolOp And [(Name a Load) (BoolOp And [(Name b Load) (BoolOp Or [(Name c Load) (Name d Load)])]) (BoolOp And [(Name e Load) (Name f Load)])]) (Name x Load)]) (Name y Load)]))] []) |
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