mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-27 03:38:55 -06:00
restored a parsing grammar api/Browse
This commit is contained in:
@@ -480,9 +480,10 @@ allCommands cod env@(pgf, mos) = Map.fromList [
|
|||||||
examples = [
|
examples = [
|
||||||
"pt -compute (plus one two) -- compute value"
|
"pt -compute (plus one two) -- compute value"
|
||||||
],
|
],
|
||||||
exec = \opts -> returnFromExprs . treeOps opts,
|
exec = \opts ->
|
||||||
|
returnFromExprs . takeOptNum opts . treeOps opts,
|
||||||
options = treeOpOptions pgf,
|
options = treeOpOptions pgf,
|
||||||
flags = treeOpFlags pgf
|
flags = [("number","take at most this many trees")] ++ treeOpFlags pgf
|
||||||
}),
|
}),
|
||||||
("q", emptyCommandInfo {
|
("q", emptyCommandInfo {
|
||||||
longname = "quit",
|
longname = "quit",
|
||||||
@@ -821,6 +822,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [
|
|||||||
optViewGraph opts = valStrOpts "view" "open" opts
|
optViewGraph opts = valStrOpts "view" "open" opts
|
||||||
optNum opts = valIntOpts "number" 1 opts
|
optNum opts = valIntOpts "number" 1 opts
|
||||||
optNumInf opts = valIntOpts "number" 1000000000 opts ---- 10^9
|
optNumInf opts = valIntOpts "number" 1000000000 opts ---- 10^9
|
||||||
|
takeOptNum opts = take (optNumInf opts)
|
||||||
|
|
||||||
fromExprs es = (es,unlines (map (showExpr []) es))
|
fromExprs es = (es,unlines (map (showExpr []) es))
|
||||||
fromStrings ss = (map (ELit . LStr) ss, unlines ss)
|
fromStrings ss = (map (ELit . LStr) ss, unlines ss)
|
||||||
|
|||||||
Reference in New Issue
Block a user