mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 02:39:31 -06:00
Morphological analysis and glueing.
This commit is contained in:
@@ -172,6 +172,8 @@ data Exp =
|
||||
| EConcat Exp Exp
|
||||
| EGlue Exp Exp
|
||||
| ELet [LocDef] Exp
|
||||
| ELetb [LocDef] Exp
|
||||
| EWhere Exp [LocDef]
|
||||
| EEqs [Equation]
|
||||
| ELString LString
|
||||
| ELin Ident
|
||||
|
||||
@@ -321,6 +321,8 @@ instance Print Exp where
|
||||
EConcat exp0 exp -> prPrec i 0 (concat [prt 1 exp0 , ["++"] , prt 0 exp])
|
||||
EGlue exp0 exp -> prPrec i 0 (concat [prt 1 exp0 , ["+"] , prt 0 exp])
|
||||
ELet locdefs exp -> prPrec i 0 (concat [["let"] , ["{"] , prt 0 locdefs , ["}"] , ["in"] , prt 0 exp])
|
||||
ELetb locdefs exp -> prPrec i 0 (concat [["let"] , prt 0 locdefs , ["in"] , prt 0 exp])
|
||||
EWhere exp locdefs -> prPrec i 0 (concat [prt 1 exp , ["where"] , ["{"] , prt 0 locdefs , ["}"]])
|
||||
EEqs equations -> prPrec i 0 (concat [["fn"] , ["{"] , prt 0 equations , ["}"]])
|
||||
ELString lstring -> prPrec i 4 (concat [prt 0 lstring])
|
||||
ELin id -> prPrec i 2 (concat [["Lin"] , prt 0 id])
|
||||
|
||||
@@ -357,6 +357,8 @@ transExp x = case x of
|
||||
where
|
||||
tryLoc (c,(mty,Just e)) = return (c,(mty,e))
|
||||
tryLoc (c,_) = Bad $ "local definition of" +++ GP.prt c +++ "without value"
|
||||
ELetb defs exp -> transExp $ ELet defs exp
|
||||
EWhere exp defs -> transExp $ ELet defs exp
|
||||
|
||||
ELString (LString str) -> return $ G.K str
|
||||
ELin id -> liftM G.LiT $ transIdent id
|
||||
|
||||
Reference in New Issue
Block a user