X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=sem.icl;fp=sem.icl;h=19092dff61f9118432d09367ee04c38ec445100d;hb=3b2d959ee14ecfd95008dfe536c87b8b1629c1ae;hp=f0241e1f614a63e4ce78b39e22c7cf6e0504e53c;hpb=cbc9411e930abac7d85badaaf16c6d0f39a6bed5;p=cc1516.git diff --git a/sem.icl b/sem.icl index f0241e1..19092df 100644 --- a/sem.icl +++ b/sem.icl @@ -61,7 +61,7 @@ instance toString SemError where sem :: AST -> SemOutput sem (AST vd fd) = case evalStateT m ('Map'.newMap, getRandomStream 1) of Left e = Left [e] - Right (vds, fds) = Right (AST vds fds) + Right ((vds, fds), gamma) = Right ((AST vds fds), gamma) where m :: Env (([VarDecl], [FunDecl])) m = (mapM semVarDecl vd) >>= \vds -> @@ -159,4 +159,8 @@ extrPos (CharExpr p _) = p extrPos (BoolExpr p _) = p extrPos (FunExpr p _) = p extrPos (EmptyListExpr p) = p -extrPos (TupleExpr p _) = p \ No newline at end of file +extrPos (TupleExpr p _) = p + +instance toString Gamma where + toString (mp, _) = concat + [concat [k, ": ", toString v, "\n"]\\(k, v) <- 'Map'.toList mp]