diff options
| author | krangelov <kr.angelov@gmail.com> | 2020-05-20 20:18:47 +0200 |
|---|---|---|
| committer | krangelov <kr.angelov@gmail.com> | 2020-05-20 20:18:47 +0200 |
| commit | 0a915199e85c72b55793b4c02566e3e708fd7013 (patch) | |
| tree | 88243a8955e3b90106aa4a60c3bd0f6b09b9c262 /src/compiler/GF/Command | |
| parent | 165c5a6d9d3cd5c34b2237cdec609421d7b9c83c (diff) | |
allow literals in the C shell
Diffstat (limited to 'src/compiler/GF/Command')
| -rw-r--r-- | src/compiler/GF/Command/Commands2.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/GF/Command/Commands2.hs b/src/compiler/GF/Command/Commands2.hs index 08caf705d..344b6b51d 100644 --- a/src/compiler/GF/Command/Commands2.hs +++ b/src/compiler/GF/Command/Commands2.hs @@ -806,14 +806,22 @@ hsExpr c = Just (f,cs) -> H.mkApp (H.mkCId f) (map hsExpr cs) _ -> case unStr c of Just str -> H.mkStr str - _ -> error $ "GF.Command.Commands2.hsExpr "++show c + _ -> case unInt c of + Just n -> H.mkInt n + _ -> case unFloat c of + Just d -> H.mkFloat d + _ -> error $ "GF.Command.Commands2.hsExpr "++show c cExpr e = case H.unApp e of Just (f,es) -> mkApp (H.showCId f) (map cExpr es) _ -> case H.unStr e of Just str -> mkStr str - _ -> error $ "GF.Command.Commands2.cExpr "++show e + _ -> case H.unInt e of + Just n -> mkInt n + _ -> case H.unFloat e of + Just d -> mkFloat d + _ -> error $ "GF.Command.Commands2.cExpr "++show e needPGF exec opts ts = do Env mb_pgf cncs <- getPGFEnv |
