diff options
| author | aarne <aarne@chalmers.se> | 2010-12-10 08:48:26 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-12-10 08:48:26 +0000 |
| commit | 96433c29146fa79c2e54778dd1c6095d0a54fc1f (patch) | |
| tree | 1fe7e4874c3eaf516040750c40d95c096fa5cd04 /src | |
| parent | 8bb09fd64a94cd4b980275ab0a0d7ea35fd179ef (diff) | |
preparing resource api for multilingual documentation
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 1 | ||||
| -rw-r--r-- | src/compiler/GF/Grammar/ShowTerm.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GFI.hs | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index 82ce69b41..a07ad014a 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -216,6 +216,7 @@ allCommands env@(pgf, mos) = Map.fromList [ ], options = [ ("all","pick all strings (forms and variants) from records and tables"), + ("one","pick the first strings, if there is any, from records and tables"), ("table","show all strings labelled by parameters"), ("unqual","hide qualifying module names") ], diff --git a/src/compiler/GF/Grammar/ShowTerm.hs b/src/compiler/GF/Grammar/ShowTerm.hs index e039aea79..7fc9ba4bf 100644 --- a/src/compiler/GF/Grammar/ShowTerm.hs +++ b/src/compiler/GF/Grammar/ShowTerm.hs @@ -13,6 +13,7 @@ showTerm gr style q t = render $ case style of TermPrintTable -> vcat [p <+> s | (p,s) <- ppTermTabular gr q t] TermPrintAll -> vcat [ s | (p,s) <- ppTermTabular gr q t] + TermPrintOne -> vcat [ s | (p,s) <- take 1 (ppTermTabular gr q t)] TermPrintDefault -> ppTerm q 0 t ppTermTabular :: SourceGrammar -> TermPrintQual -> Term -> [(Doc,Doc)] @@ -37,4 +38,5 @@ ppTermTabular gr q = pr where data TermPrintStyle = TermPrintTable | TermPrintAll + | TermPrintOne | TermPrintDefault diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs index 73aebc960..49e68c024 100644 --- a/src/compiler/GFI.hs +++ b/src/compiler/GFI.hs @@ -111,6 +111,7 @@ loop opts gfenv0 = do let pOpts style q ("-table" :ws) = pOpts TermPrintTable q ws pOpts style q ("-all" :ws) = pOpts TermPrintAll q ws + pOpts style q ("-one" :ws) = pOpts TermPrintOne q ws pOpts style q ("-default":ws) = pOpts TermPrintDefault q ws pOpts style q ("-unqual" :ws) = pOpts style Unqualified ws pOpts style q ("-qual" :ws) = pOpts style Qualified ws |
