From 249d506f58a8b5f8ef87295ab3dde2d13ddd3885 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 10 Nov 2003 07:55:45 +0000 Subject: Morphological analysis and glueing. --- src/GF/Source/AbsGF.hs | 2 ++ src/GF/Source/PrintGF.hs | 2 ++ src/GF/Source/SourceToGrammar.hs | 2 ++ 3 files changed, 6 insertions(+) (limited to 'src/GF/Source') diff --git a/src/GF/Source/AbsGF.hs b/src/GF/Source/AbsGF.hs index 8acf35349..28313c5ce 100644 --- a/src/GF/Source/AbsGF.hs +++ b/src/GF/Source/AbsGF.hs @@ -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 diff --git a/src/GF/Source/PrintGF.hs b/src/GF/Source/PrintGF.hs index b406f1935..e4238ceff 100644 --- a/src/GF/Source/PrintGF.hs +++ b/src/GF/Source/PrintGF.hs @@ -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]) diff --git a/src/GF/Source/SourceToGrammar.hs b/src/GF/Source/SourceToGrammar.hs index 4c4bc93a6..53681104c 100644 --- a/src/GF/Source/SourceToGrammar.hs +++ b/src/GF/Source/SourceToGrammar.hs @@ -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 -- cgit v1.2.3