summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/CommandInfo.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-08-12 11:05:08 +0000
committerhallgren <hallgren@chalmers.se>2015-08-12 11:05:08 +0000
commit6fff2def393663522f86e13e2536a9e111e8b2cd (patch)
tree777c40abe073299992f937f025b239e448672f59 /src/compiler/GF/Command/CommandInfo.hs
parent063912c3861d73c0b3cc036394476a4af8eec782 (diff)
GF shell: source commands (cc, sd, so, ss & dg) can now be used in pipes
These commands are now implemented as regular commands (i.e. using the CommandInfo data type) in the new module GF.Command.SourceCommands. The list of commands exported from GF.Command.Commmands now called pgfCommands instead of allCommands. The list allCommands of all commands is now assembled from sourceCommands, pgfCommands, commonCommands and helpCommand in GF.Interactive.
Diffstat (limited to 'src/compiler/GF/Command/CommandInfo.hs')
-rw-r--r--src/compiler/GF/Command/CommandInfo.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/GF/Command/CommandInfo.hs b/src/compiler/GF/Command/CommandInfo.hs
index 696d14cbc..f73aa35e1 100644
--- a/src/compiler/GF/Command/CommandInfo.hs
+++ b/src/compiler/GF/Command/CommandInfo.hs
@@ -17,6 +17,8 @@ data CommandInfo env = CommandInfo {
needsTypeCheck :: Bool
}
+mapCommandEnv f c = c { exec = exec c . f }
+
emptyCommandInfo :: CommandInfo env
emptyCommandInfo = CommandInfo {
exec = \_ _ ts -> return $ pipeExprs ts, ----
@@ -33,6 +35,9 @@ emptyCommandInfo = CommandInfo {
class TypeCheckArg env where typeCheckArg :: env -> Expr -> Either Doc Expr
+instance TypeCheckArg env => TypeCheckArg (x,env) where
+ typeCheckArg (x,env) = typeCheckArg env
+
--------------------------------------------------------------------------------
newtype CommandOutput = Piped {fromPipe :: ([Expr],String)} ---- errors, etc