-
Notifications
You must be signed in to change notification settings - Fork 6
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 #92 from adi-lb-phoenix/type_checking
Type checking for function parameters when called.
- Loading branch information
Showing
7 changed files
with
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
CodegenError: Not a function: ['declare', 'a', 'int'] | ||
CodegenError: Neither function nor struct definition: ['declare', 'a', 'int'] |
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,4 +1,6 @@ | ||
(c-lisp | ||
(define ((print int) (n int))) | ||
|
||
(define ((main int)) | ||
(declare arr (ptr int)) | ||
(set arr (alloc int 20)) | ||
|
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,2 @@ | ||
Error in statement: ['call', 'func_print', 'k', 'j', 'm'] | ||
CodegenError: Expected types: ['int', 'int'], Received: ['int', 'int', 'int'] |
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,15 @@ | ||
(c-lisp | ||
(define ((print int) (n int))) | ||
|
||
(define ((func_print void) (n int) (m int)) | ||
(call print n) | ||
(call print m)) | ||
|
||
(define ((main void)) | ||
(declare k int) | ||
(declare j int) | ||
(declare m int) | ||
(set k 50) | ||
(set j 20) | ||
(set m 100) | ||
(call func_print k j m))) |
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,2 @@ | ||
Error in statement: ['call', 'print', 'm'] | ||
CodegenError: Expected types: ['int'], Received: ['float'] |
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 @@ | ||
(c-lisp | ||
(define ((print int) (n int))) | ||
|
||
(define ((func_print void) (n int) (m float)) | ||
(call print n) | ||
(call print m)) | ||
|
||
(define ((main void)) | ||
(declare k int) | ||
(declare j float) | ||
(set k 50) | ||
(set j 10.0) | ||
(call func_print k j))) |