Add strings and print primitive
[scheme.git] / typecheck.scm
index 46fddfec7008bbf6e05c637368571b6ed2f71563..7eb4fa96606d786b5e58d17f2d2601f4f52c85a3 100644 (file)
@@ -10,6 +10,7 @@
   (case t
     ('int #t)
     ('bool #t)
+    ('void #t)
     (else #f)))
 
 (define (pretty-type t)
@@ -74,6 +75,7 @@
     ('! '(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)
@@ -89,6 +91,7 @@
          (case (ast-type x)
           ('int-literal (list '() 'int))
           ('bool-literal (list '() 'bool))
+          ('string-literal (list '() 'string))
           ('builtin (list '() (builtin-type x)))
 
           ('if