Change grammar: only one bind in let and no EAnn for typed syntax

This commit is contained in:
Martin Fredin 2023-02-18 12:57:23 +01:00
parent 7cedc2e28c
commit a3e57dde7b
7 changed files with 172 additions and 228 deletions

View file

@ -16,11 +16,10 @@ newtype Program = Program [Bind]
data Exp
= EId Id
| EInt Integer
| ELet [Bind] Exp
| ELet Bind Exp
| EApp Type Exp Exp
| EAdd Type Exp Exp
| EAbs Type Id Exp
| EAnn Exp Type
deriving (C.Eq, C.Ord, C.Show, C.Read)
type Id = (Ident, Type)
@ -97,12 +96,5 @@ instance Print Exp where
, doc $ showString "."
, prt 0 e
]
EAnn e t -> prPrec i 3 $ concatD
[ doc $ showString "("
, prt 0 e
, doc $ showString ":"
, prt 0 t
, doc $ showString ")"
]