diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-07-02 13:58:02 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-07-02 13:58:02 +0000 |
| commit | 6fc3bbd45794b78c3363060b9491459b414e3066 (patch) | |
| tree | a98047843800b211f72081f7bc3c8cc5ff72775e /src/GF/Shell.hs | |
| parent | c7f488b11e2a44875c80fd456ff5f5b5d86c30d5 (diff) | |
parsing overloaded constructors as result
Diffstat (limited to 'src/GF/Shell.hs')
| -rw-r--r-- | src/GF/Shell.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs index dd8267a91..139a2ab07 100644 --- a/src/GF/Shell.hs +++ b/src/GF/Shell.hs @@ -30,6 +30,7 @@ import GF.Grammar.Values import GF.UseGrammar.GetTree import GF.UseGrammar.Generate (generateAll) ---- should be in API import GF.UseGrammar.Treebank +import GF.UseGrammar.MakeOverload (getOverloadResults) import GF.Shell.ShellCommands @@ -242,6 +243,9 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com CParse ---- | oElem showMulti opts -> do + | oElem (iOpt "overload") opts -> do + p <- parse $ prCommandArg a + changeArg (opTTs2CommandArg getOverloadResults) p | oElem byLines opts -> do let ss = (if oElem showAll opts then id else filter (not . null)) $ lines $ prCommandArg a @@ -576,3 +580,9 @@ opTT2CommandArg :: (Tree -> Err [Tree]) -> CommandArg -> CommandArg opTT2CommandArg f (ATrms ts) = err AError (ATrms . concat) $ mapM f ts opTT2CommandArg _ (AError s) = AError ("expected term, but got error:" ++++ s) opTT2CommandArg _ a = AError ("expected term, but got:" ++++ prCommandArg a) + +opTTs2CommandArg :: ([Tree] -> [Tree]) -> CommandArg -> CommandArg +opTTs2CommandArg f (ATrms ts) = ATrms $ f ts +opTTs2CommandArg _ (AError s) = AError ("expected terms, but got error:" ++++ s) +opTTs2CommandArg _ a = AError ("expected terms, but got:" ++++ prCommandArg a) + |
