From: pimjager Date: Fri, 20 May 2016 11:44:21 +0000 (+0200) Subject: readchar in sem X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=c5e89ecf06145895bd8c8bca19e7e0587cfe1082;hp=--cc;p=cc1516.git readchar in sem --- c5e89ecf06145895bd8c8bca19e7e0587cfe1082 diff --git a/examples/codeGen.spl b/examples/codeGen.spl index e5d938b..77b02a1 100644 --- a/examples/codeGen.spl +++ b/examples/codeGen.spl @@ -38,6 +38,7 @@ main() { var x = (True, 5) : (False,0) : []; var sdaf = isE(x1); var z = isEmpty(x1); + Char c = read(); x.hd.snd = 8; return; } diff --git a/sem.icl b/sem.icl index 0ffcdd2..0c5b552 100644 --- a/sem.icl +++ b/sem.icl @@ -51,7 +51,7 @@ variableStream = map toString [1..] defaultGamma :: Gamma //includes all default functions defaultGamma = extend "print" (Forall ["a"] ((IdType "a") ->> VoidType)) $ extend "isEmpty" (Forall ["a"] ((ListType (IdType "a")) ->> BoolType)) - $ extend "read" (Forall [] (IntType ->> (ListType CharType))) + $ extend "read" (Forall [] CharType) zero sem :: AST -> Either [SemError] AST