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#233 from namannimmo10/type_checking
Add strict type checking for assignment
- Loading branch information
Showing
29 changed files
with
77 additions
and
49 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) ()) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (Integer 4 []))) ()) (= (Var 2 z) (ArrayRef 2 x [(() (BinOp (ConstantString "a" (Character 1 1 () [])) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ()) (= (Var 2 z) (ArrayRef 2 x [(() (BinOp (ConstantString "b" (Character 1 1 () [])) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) | ||
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) ()) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (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
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 @@ | ||
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 1 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 1 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (UnaryOp UAdd (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger 4 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantInteger 500 (Integer 4 [])) (Integer 4 []) (ConstantInteger -500 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Not (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 a) (UnaryOp Not (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 a) (UnaryOp Not (ConstantInteger 0 (Integer 4 [])) (Integer 4 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 f) (ImplicitCast (UnaryOp UAdd (ConstantReal 1.000000 (Real 8 [])) (Real 8 []) (ConstantReal 1.000000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 f) (ImplicitCast (UnaryOp USub (ConstantReal 183745.534000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.534000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 b1) (ConstantLogical .true. (Logical 1 [])) ()) (= (Var 2 b2) (UnaryOp Not (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 b3) (UnaryOp Not (Var 2 b2) (Logical 1 []) ()) ()) (= (Var 2 a) (UnaryOp UAdd (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger 1 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantInteger 0 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger -2 (Integer 4 []))) ()) (= (Var 2 c) (UnaryOp UAdd (ConstantComplex 1.000000 2.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 2.000000 (Complex 8 []))) ()) (= (Var 2 c) (UnaryOp USub (ConstantComplex 3.000000 65.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -3.000000 -65.000000 (Complex 8 []))) ()) (= (Var 2 b1) (UnaryOp Not (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 b2) (UnaryOp Not (ConstantComplex 0.000000 0.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .true. (Logical 4 []))) ())] Source Public Implementation () .false. .false.)}) []) | ||
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 1 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 1 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 1 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (UnaryOp UAdd (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger 4 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantInteger 500 (Integer 4 [])) (Integer 4 []) (ConstantInteger -500 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 []))) ()) (= (Var 2 b) (UnaryOp Not (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 b) (UnaryOp Not (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Logical 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 b) (UnaryOp Not (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 f) (ImplicitCast (UnaryOp UAdd (ConstantReal 1.000000 (Real 8 [])) (Real 8 []) (ConstantReal 1.000000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 f) (ImplicitCast (UnaryOp USub (ConstantReal 183745.534000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.534000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 b1) (ConstantLogical .true. (Logical 1 [])) ()) (= (Var 2 b2) (UnaryOp Not (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 b3) (UnaryOp Not (Var 2 b2) (Logical 1 []) ()) ()) (= (Var 2 a) (UnaryOp UAdd (ConstantLogical .true. (Logical 1 [])) (Integer 4 []) (ConstantInteger 1 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantLogical .false. (Logical 1 [])) (Integer 4 []) (ConstantInteger 0 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantLogical .true. (Logical 1 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) ()) (= (Var 2 c) (UnaryOp UAdd (ConstantComplex 1.000000 2.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 2.000000 (Complex 8 []))) ()) (= (Var 2 c) (UnaryOp USub (ConstantComplex 3.000000 65.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -3.000000 -65.000000 (Complex 8 []))) ()) (= (Var 2 b1) (UnaryOp Not (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 b2) (UnaryOp Not (ConstantComplex 0.000000 0.000000 (Complex 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 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
Oops, something went wrong.