projects
/
scheme.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add strings and print primitive
[scheme.git]
/
typecheck.scm
diff --git
a/typecheck.scm
b/typecheck.scm
index 46fddfec7008bbf6e05c637368571b6ed2f71563..7eb4fa96606d786b5e58d17f2d2601f4f52c85a3 100644
(file)
--- a/
typecheck.scm
+++ b/
typecheck.scm
@@
-10,6
+10,7
@@
(case t
('int #t)
('bool #t)
(case t
('int #t)
('bool #t)
+ ('void #t)
(else #f)))
(define (pretty-type t)
(else #f)))
(define (pretty-type t)
@@
-74,6
+75,7
@@
('! '(abs bool bool))
('= '(abs int (abs int bool)))
('bool->int '(abs bool int))
('! '(abs bool bool))
('= '(abs int (abs int bool)))
('bool->int '(abs bool int))
+ ('print '(abs string void))
(else #f)))
; we typecheck the lambda calculus only (only single arg lambdas)
(else #f)))
; we typecheck the lambda calculus only (only single arg lambdas)
@@
-89,6
+91,7
@@
(case (ast-type x)
('int-literal (list '() 'int))
('bool-literal (list '() 'bool))
(case (ast-type x)
('int-literal (list '() 'int))
('bool-literal (list '() 'bool))
+ ('string-literal (list '() 'string))
('builtin (list '() (builtin-type x)))
('if
('builtin (list '() (builtin-type x)))
('if