diff options
| author | krasimir <krasimir@chalmers.se> | 2008-06-23 08:48:17 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2008-06-23 08:48:17 +0000 |
| commit | 8b47619361d005c734fd54dc423a5d0cc569b80a (patch) | |
| tree | 7e4ac5bd00f8510cad12290b11cc56bf0072acd0 /src-3.0/GF/Compile | |
| parent | 9d6e3c7b9501da54418c6f05503907e54c0019a2 (diff) | |
fix Haskell embedded grammars
Diffstat (limited to 'src-3.0/GF/Compile')
| -rw-r--r-- | src-3.0/GF/Compile/GFCCtoHaskell.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src-3.0/GF/Compile/GFCCtoHaskell.hs b/src-3.0/GF/Compile/GFCCtoHaskell.hs index 9d03aa490..59db9c364 100644 --- a/src-3.0/GF/Compile/GFCCtoHaskell.hs +++ b/src-3.0/GF/Compile/GFCCtoHaskell.hs @@ -54,14 +54,14 @@ haskPreamble name = "----------------------------------------------------", "", "class Gf a where", - " gf :: a -> Exp", - " fg :: Exp -> a", + " gf :: a -> Tree", + " fg :: Tree -> a", "", - predefInst "GString" "String" "EStr s", + predefInst "GString" "String" "Lit (LStr s)", "", - predefInst "GInt" "Integer" "EInt s", + predefInst "GInt" "Integer" "Lit (LInt s)", "", - predefInst "GFloat" "Double" "EFloat s", + predefInst "GFloat" "Double" "Lit (LFlt s)", "", "----------------------------------------------------", "-- below this line machine-generated", @@ -143,7 +143,7 @@ hInstance m (cat,rules) (if length xx == 0 then gId f else prParenth (gId f +++ foldr1 (+++) xx')) +++ "=" +++ mkRHS f xx' mkVars n = ["x" ++ show i | i <- [1..n]] - mkRHS f vars = "EApp (mkCId \"" ++ f ++ "\")" +++ + mkRHS f vars = "Fun (mkCId \"" ++ f ++ "\")" +++ "[" ++ prTList ", " ["gf" +++ x | x <- vars] ++ "]" @@ -156,7 +156,7 @@ fInstance m (cat,rules) = " _ -> error (\"no" +++ cat ++ " \" ++ show t)" where mkInst f xx = - " EApp i " ++ + " Fun i " ++ "[" ++ prTList "," xx' ++ "]" +++ "| i == mkCId \"" ++ f ++ "\" ->" +++ mkRHS f xx' where xx' = ["x" ++ show i | (_,i) <- zip xx [1..]] |
