diff options
| author | aarne <aarne@chalmers.se> | 2010-12-06 10:49:38 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-12-06 10:49:38 +0000 |
| commit | 1f75143d6c8515bc459110d9512b903140f3882e (patch) | |
| tree | 7603e42fe2818c5c3a1128fbd077f195831cbcea /src/compiler/GF/Command | |
| parent | 7fba8c338d04777c82a2d04c4bc82a4da0e86659 (diff) | |
printing option -api in the eb command
Diffstat (limited to 'src/compiler/GF/Command')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index c9f4b4945..fbcefcba8 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -296,6 +296,9 @@ allCommands env@(pgf, mos) = Map.fromList [ "gr and rt. Notice that the command doesn't change the environment,", "but the resulting .gf file must be imported separately." ], + options = [ + ("api","convert trees to overloaded API expressions (using Syntax not Lang)") + ], flags = [ ("file","the file to be converted (suffix .gfe must be given)"), ("lang","the language in which to parse"), @@ -304,7 +307,8 @@ allCommands env@(pgf, mos) = Map.fromList [ exec = \opts _ -> do let file = optFile opts pgf <- optProbs opts pgf - let conf = configureExBased pgf (optMorpho opts) (optLang opts) + let printer = if (isOpt "api" opts) then exprToAPI else (showExpr []) + let conf = configureExBased pgf (optMorpho opts) (optLang opts) printer (file',ws) <- parseExamplesInGrammar conf file if null ws then return () else putStrLn ("unknown words: " ++ unwords ws) return (fromString ("wrote " ++ file')), |
