Change grammar: only one bind in let and no EAnn for typed syntax
This commit is contained in:
parent
7cedc2e28c
commit
a3e57dde7b
7 changed files with 172 additions and 228 deletions
|
|
@ -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 ")"
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue