From 150940b8704a6a61ed08c6bbd99ba4b05a42c59c Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 30 May 2008 13:07:11 +0000 Subject: cleaned up and documented PGF API --- src-3.0/GF/Command/Commands.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src-3.0/GF/Command/Commands.hs') diff --git a/src-3.0/GF/Command/Commands.hs b/src-3.0/GF/Command/Commands.hs index f3789d669..8761234cd 100644 --- a/src-3.0/GF/Command/Commands.hs +++ b/src-3.0/GF/Command/Commands.hs @@ -9,7 +9,7 @@ module GF.Command.Commands ( CommandOutput ) where -import GF.Command.AbsGFShell hiding (Tree) +import GF.Command.AbsGFShell import GF.Command.PPrTree import GF.Command.ParGFShell import PGF @@ -23,10 +23,10 @@ import GF.Data.ErrM ---- import qualified Data.Map as Map -type CommandOutput = ([Tree],String) ---- errors, etc +type CommandOutput = ([Exp],String) ---- errors, etc data CommandInfo = CommandInfo { - exec :: [Option] -> [Tree] -> IO CommandOutput, + exec :: [Option] -> [Exp] -> IO CommandOutput, synopsis :: String, explanation :: String, longname :: String, @@ -106,7 +106,7 @@ allCommands pgf = Map.fromAscList [ synopsis = "get description of a command, or a the full list of commands", options = ["full"], exec = \opts ts -> return ([], case ts of - [t] -> let co = (showTree t) in + [t] -> let co = showExp t in case lookCommand co (allCommands pgf) of ---- new map ??!! Just info -> commandHelp True (co,info) _ -> "command not found" @@ -146,7 +146,7 @@ allCommands pgf = Map.fromAscList [ optNum opts = valIntOpts "number" 1 opts optNumInf opts = valIntOpts "number" 1000000000 opts ---- 10^9 - fromTrees ts = (ts,unlines (map showTree ts)) + fromTrees ts = (ts,unlines (map showExp ts)) fromStrings ss = (map EStr ss, unlines ss) fromString s = ([EStr s], s) toStrings ts = [s | EStr s <- ts] -- cgit v1.2.3