X-Git-Url: http://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=typecheck.scm;h=7eb4fa96606d786b5e58d17f2d2601f4f52c85a3;hp=46fddfec7008bbf6e05c637368571b6ed2f71563;hb=91145e54f41ee88f1e279a80430b3f5ed4e7a8c6;hpb=25a4c23da2d76f3bb951d01b1c3175be80441a0a diff --git a/typecheck.scm b/typecheck.scm index 46fddfe..7eb4fa9 100644 --- a/typecheck.scm +++ b/typecheck.scm @@ -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