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.
Fixed issue identify tuples without brackets (lcompilers#1581)
* Fixed issue identify tuples without brackets * Update Readme.md
- Loading branch information
1 parent
78c8347
commit 12971c1
Showing
5 changed files
with
17 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,5 @@ def test(): | |
x, | ||
y, | ||
) | ||
|
||
t : tuple[i32, i32] = 2,3 # Without bracket annotated assignment of tuples |
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 |
---|---|---|
@@ -1 +1 @@ | ||
(Module [(Assign [(Name a Store)] (BinOp (Tuple [(ConstantInt 1 ())] Load) Add (ConstantInt 4 ())) ()) (Assign [(Name a Store)] (BinOp (BinOp (ConstantInt 3 ()) Mult (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)) Add (ConstantInt 4 ())) ()) (Expr (Call (Name f Load) [(Tuple [(Name x Load) (Name y Load)] Load)] [])) (Expr (Call (Name f Load) [(Tuple [(Name x Load)] Load)] [])) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a4 Store)] (Tuple [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) (Tuple [(ConstantInt 4 ()) (ConstantInt 5 ()) (ConstantInt 6 ())] Load)] Load) ()) (Expr (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)) (Expr (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)) (Expr (BinOp (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) Mult (ConstantInt 3 ()))) (Expr (Call (Name print Load) [(BinOp (ConstantStr "%s%s%s" ()) Mod (Tuple [(Name a Load) (Name b Load) (Name c Load)] Load))] [])) (Expr (Call (Name print Load) [(BinOp (ConstantStr "%s%s%s" ()) Mod (Tuple [(BinOp (ConstantInt 10 ()) Add (Name x Load)) (Name y Load) (BinOp (Name z Load) Add (ConstantInt 20 ()))] Load))] [])) (If (Compare (Attribute (Name sys Load) version_info Load) GtE [(Tuple [(ConstantInt 3 ()) (ConstantInt 9 ())] Load)]) [(Pass)] []) (Assign [(Name NDArray Store)] (Call (Name _GenericAlias Load) [(Attribute (Name np Load) ndarray Load) (Tuple [(Name Any Load) (Name _DType Load)] Load)] []) ()) (FunctionDef test ([] [] [] [] [] [] []) [(Pass)] [(Call (Attribute (Attribute (Name pytest Load) mark Load) parametrize Load) [(ConstantStr "shape" ()) (List [(ConstantInt 5 ()) (Tuple [(ConstantInt 3 ()) (ConstantInt 3 ()) (ConstantInt 3 ())] Load)] Load)] [])] () ()) (Assign [(Name _promotion_table Store)] (Dict [(Tuple [(Name int8 Load) (Name int8 Load)] Load)] [(Name int8 Load)]) ()) (Expr (Tuple [(Name x Load) (Name y Load)] Load)) (Expr (Tuple [(Name x Load) (Name y Load)] Load)) (Expr (Tuple [(Call (Name assert_ Load) [(Call (Attribute (Name np Load) isnan Load) [(Name div Load)] [])] []) (BinOp (ConstantStr "dt: %s, rem: %s" ()) Mod (Tuple [(Name dt Load) (Name rem Load)] Load))] Load)) (Expr (Call (Name sum Load) [(ListComp (Subscript (Tuple [(ConstantInt 1 ()) (UnaryOp USub (ConstantInt 1 ()))] Load) (BinOp (Name i Load) Mod (ConstantInt 2 ())) Load) [((Name i Store) (Name x Load) [] 0)])] [])) (Expr (Call (Name sum Load) [(ListComp (Subscript (Tuple [(ConstantInt 1 ()) (UnaryOp USub (ConstantInt 1 ()))] Load) (BinOp (Name i Load) Mod (ConstantInt 2 ())) Load) [((Name i Store) (Name x Load) [] 0)])] [])) (Assign [(Name a Store)] (Tuple [(Name x Load) (Name y Load)] Load) ())] [(TypeIgnore 0 "")]) | ||
(Module [(Assign [(Name a Store)] (BinOp (Tuple [(ConstantInt 1 ())] Load) Add (ConstantInt 4 ())) ()) (Assign [(Name a Store)] (BinOp (BinOp (ConstantInt 3 ()) Mult (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)) Add (ConstantInt 4 ())) ()) (Expr (Call (Name f Load) [(Tuple [(Name x Load) (Name y Load)] Load)] [])) (Expr (Call (Name f Load) [(Tuple [(Name x Load)] Load)] [])) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a4 Store)] (Tuple [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) (Tuple [(ConstantInt 4 ()) (ConstantInt 5 ()) (ConstantInt 6 ())] Load)] Load) ()) (Expr (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)) (Expr (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)) (Expr (BinOp (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) Mult (ConstantInt 3 ()))) (Expr (Call (Name print Load) [(BinOp (ConstantStr "%s%s%s" ()) Mod (Tuple [(Name a Load) (Name b Load) (Name c Load)] Load))] [])) (Expr (Call (Name print Load) [(BinOp (ConstantStr "%s%s%s" ()) Mod (Tuple [(BinOp (ConstantInt 10 ()) Add (Name x Load)) (Name y Load) (BinOp (Name z Load) Add (ConstantInt 20 ()))] Load))] [])) (If (Compare (Attribute (Name sys Load) version_info Load) GtE [(Tuple [(ConstantInt 3 ()) (ConstantInt 9 ())] Load)]) [(Pass)] []) (Assign [(Name NDArray Store)] (Call (Name _GenericAlias Load) [(Attribute (Name np Load) ndarray Load) (Tuple [(Name Any Load) (Name _DType Load)] Load)] []) ()) (FunctionDef test ([] [] [] [] [] [] []) [(Pass)] [(Call (Attribute (Attribute (Name pytest Load) mark Load) parametrize Load) [(ConstantStr "shape" ()) (List [(ConstantInt 5 ()) (Tuple [(ConstantInt 3 ()) (ConstantInt 3 ()) (ConstantInt 3 ())] Load)] Load)] [])] () ()) (Assign [(Name _promotion_table Store)] (Dict [(Tuple [(Name int8 Load) (Name int8 Load)] Load)] [(Name int8 Load)]) ()) (Expr (Tuple [(Name x Load) (Name y Load)] Load)) (Expr (Tuple [(Name x Load) (Name y Load)] Load)) (Expr (Tuple [(Call (Name assert_ Load) [(Call (Attribute (Name np Load) isnan Load) [(Name div Load)] [])] []) (BinOp (ConstantStr "dt: %s, rem: %s" ()) Mod (Tuple [(Name dt Load) (Name rem Load)] Load))] Load)) (Expr (Call (Name sum Load) [(ListComp (Subscript (Tuple [(ConstantInt 1 ()) (UnaryOp USub (ConstantInt 1 ()))] Load) (BinOp (Name i Load) Mod (ConstantInt 2 ())) Load) [((Name i Store) (Name x Load) [] 0)])] [])) (Expr (Call (Name sum Load) [(ListComp (Subscript (Tuple [(ConstantInt 1 ()) (UnaryOp USub (ConstantInt 1 ()))] Load) (BinOp (Name i Load) Mod (ConstantInt 2 ())) Load) [((Name i Store) (Name x Load) [] 0)])] [])) (Assign [(Name a Store)] (Tuple [(Name x Load) (Name y Load)] Load) ()) (AnnAssign (Name t Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load)] Load) Load) (Tuple [(ConstantInt 2 ()) (ConstantInt 3 ())] Load) 1)] [(TypeIgnore 0 "")]) |