summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/GF/Command/Commands.hs11
-rw-r--r--src/compiler/GF/Compile/ExampleBased.hs2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index d27bea37e..b10d35ec7 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -492,7 +492,8 @@ allCommands env@(pgf, mos) = Map.fromList [
flags = [
("cat","target category of parsing"),
("lang","the languages of parsing (comma-separated, no spaces)"),
- ("openclass","list of open-class categories for robust parsing")
+ ("openclass","list of open-class categories for robust parsing"),
+ ("depth","maximal depth for proof search if the abstract syntax tree has meta variables")
],
options = [
("bracket","prints the bracketed string from the parser")
@@ -902,8 +903,10 @@ allCommands env@(pgf, mos) = Map.fromList [
]
where
par opts s = case optOpenTypes opts of
- [] -> [parse_ pgf lang (optType opts) s | lang <- optLangs opts]
- open_typs -> [parseWithRecovery pgf lang (optType opts) open_typs s | lang <- optLangs opts]
+ [] -> [parse_ pgf lang (optType opts) (Just dp) s | lang <- optLangs opts]
+ open_typs -> [parseWithRecovery pgf lang (optType opts) open_typs (Just dp) s | lang <- optLangs opts]
+ where
+ dp = valIntOpts "depth" 4 opts
void = ([],[])
@@ -993,7 +996,7 @@ allCommands env@(pgf, mos) = Map.fromList [
Just ty -> case checkType pgf ty of
Left tcErr -> error $ render (ppTcError tcErr)
Right ty -> ty
- Nothing -> error ("Can't parse '"++str++"' as type")
+ Nothing -> error ("Can't parse '"++str++"' as a type")
optComm opts = valStrOpts "command" "" opts
optViewFormat opts = valStrOpts "format" "png" opts
optViewGraph opts = valStrOpts "view" "open" opts
diff --git a/src/compiler/GF/Compile/ExampleBased.hs b/src/compiler/GF/Compile/ExampleBased.hs
index 46fb8b5d7..24944d9b6 100644
--- a/src/compiler/GF/Compile/ExampleBased.hs
+++ b/src/compiler/GF/Compile/ExampleBased.hs
@@ -41,7 +41,7 @@ convertFile conf src file = do
convEx (cat,ex) = do
appn "("
let typ = maybe (error "no valid cat") id $ readType cat
- ws <- case fst (parse_ pgf lang typ ex) of
+ ws <- case fst (parse_ pgf lang typ (Just 4) ex) of
ParseFailed _ -> do
let ws = morphoMissing morpho (words ex)
appv ("WARNING: cannot parse example " ++ ex)