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#91 from namannimmo10/set
Implement Set
- Loading branch information
Showing
9 changed files
with
68 additions
and
0 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
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": "asr-set1-b7b913a", | ||
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}", | ||
"infile": "tests/set1.py", | ||
"infile_hash": "9daf37483fb6f1523007506236ce239db1f9c56a31c5e028bbecff0b", | ||
"outfile": null, | ||
"outfile_hash": null, | ||
"stdout": "asr-set1-b7b913a.stdout", | ||
"stdout_hash": "f50412c1c431e3b37674040d42c8e48c101c73e4f72008b8955f7fe0", | ||
"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 @@ | ||
(TranslationUnit (SymbolTable 1 {test_Set: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Set [] [(= (Var 2 a) (ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 []))) ()) (= (Var 2 a) (ConstantSet [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) (ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 5 (Integer 4 []))] (Set (Integer 4 []))) ()) (= (Var 2 a) (ConstantSet [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Set (Character 1 1 () []))) ()) (= (Var 2 b) (ArrayRef 2 a [(() (ConstantInteger 0 (Integer 4 [])) ())] (Integer 4 []) ()) ())] Source Public Implementation () .false. .false.)}) []) |
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-set1-ebd6ee0", | ||
"cmd": "lpython --show-ast --no-color {infile} -o {outfile}", | ||
"infile": "tests/set1.py", | ||
"infile_hash": "9daf37483fb6f1523007506236ce239db1f9c56a31c5e028bbecff0b", | ||
"outfile": null, | ||
"outfile_hash": null, | ||
"stdout": "ast-set1-ebd6ee0.stdout", | ||
"stdout_hash": "8c1cad9ac254b1847c30e26721e705d4db36fca6316e0f4e870f06a0", | ||
"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 [(FunctionDef test_Set ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (AnnAssign (Name b Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Set [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())]) ()) (Assign [(Name a Store)] (Set [(ConstantInt 2 ()) (ConstantInt 3 ()) (ConstantInt 4 ()) (ConstantInt 5 ()) (ConstantInt 5 ())]) ()) (Assign [(Name a Store)] (Set [(ConstantStr "a" ()) (ConstantStr "b" ()) (ConstantStr "c" ())]) ()) (Assign [(Name b Store)] (Subscript (Name a Load) (ConstantInt 0 ()) 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
def test_Set(): | ||
a: i32 | ||
b: i32 | ||
|
||
a = {1, 2, 3} | ||
a = {2, 3, 4, 5, 5} | ||
a = {"a", "b", "c"} | ||
# a = {-1, -2, "c"} -> semantic error for now | ||
b = a[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