mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-28 04:08:55 -06:00
preparing resource api for multilingual documentation
This commit is contained in:
@@ -216,6 +216,7 @@ allCommands env@(pgf, mos) = Map.fromList [
|
|||||||
],
|
],
|
||||||
options = [
|
options = [
|
||||||
("all","pick all strings (forms and variants) from records and tables"),
|
("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"),
|
("table","show all strings labelled by parameters"),
|
||||||
("unqual","hide qualifying module names")
|
("unqual","hide qualifying module names")
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ showTerm gr style q t = render $
|
|||||||
case style of
|
case style of
|
||||||
TermPrintTable -> vcat [p <+> s | (p,s) <- ppTermTabular gr q t]
|
TermPrintTable -> vcat [p <+> s | (p,s) <- ppTermTabular gr q t]
|
||||||
TermPrintAll -> vcat [ 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
|
TermPrintDefault -> ppTerm q 0 t
|
||||||
|
|
||||||
ppTermTabular :: SourceGrammar -> TermPrintQual -> Term -> [(Doc,Doc)]
|
ppTermTabular :: SourceGrammar -> TermPrintQual -> Term -> [(Doc,Doc)]
|
||||||
@@ -37,4 +38,5 @@ ppTermTabular gr q = pr where
|
|||||||
data TermPrintStyle
|
data TermPrintStyle
|
||||||
= TermPrintTable
|
= TermPrintTable
|
||||||
| TermPrintAll
|
| TermPrintAll
|
||||||
|
| TermPrintOne
|
||||||
| TermPrintDefault
|
| TermPrintDefault
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ loop opts gfenv0 = do
|
|||||||
let
|
let
|
||||||
pOpts style q ("-table" :ws) = pOpts TermPrintTable q ws
|
pOpts style q ("-table" :ws) = pOpts TermPrintTable q ws
|
||||||
pOpts style q ("-all" :ws) = pOpts TermPrintAll 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 ("-default":ws) = pOpts TermPrintDefault q ws
|
||||||
pOpts style q ("-unqual" :ws) = pOpts style Unqualified ws
|
pOpts style q ("-unqual" :ws) = pOpts style Unqualified ws
|
||||||
pOpts style q ("-qual" :ws) = pOpts style Qualified ws
|
pOpts style q ("-qual" :ws) = pOpts style Qualified ws
|
||||||
|
|||||||
Reference in New Issue
Block a user