mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
gf -server: make it possible to pass arbitrary flags/options to gf when compiling grammars
For example, you can add -optimize-pgf: http://localhost:41296/cloud?dir=...&command=remake&-optimize-pgf=&Foods2Eng.gf=&Foods2Swe.gf=
This commit is contained in:
@@ -211,9 +211,12 @@ handle state0 cache execute1
|
|||||||
then return path
|
then return path
|
||||||
else err $ resp400 $ "unacceptable path "++path
|
else err $ resp400 $ "unacceptable path "++path
|
||||||
|
|
||||||
make skip dir files =
|
make skip dir args =
|
||||||
do _ <- upload skip files
|
do let (flags,files) = partition ((=="-").take 1.fst) args
|
||||||
let args = "-s":"-make":map fst files
|
_ <- upload skip files
|
||||||
|
let args = "-s":"-make":map flag flags++map fst files
|
||||||
|
flag (n,"") = n
|
||||||
|
flag (n,v) = n++"="++v
|
||||||
cmd = unwords ("gf":args)
|
cmd = unwords ("gf":args)
|
||||||
out <- liftIO $ readProcessWithExitCode "gf" args ""
|
out <- liftIO $ readProcessWithExitCode "gf" args ""
|
||||||
cwd <- liftIO $ getCurrentDirectory
|
cwd <- liftIO $ getCurrentDirectory
|
||||||
|
|||||||
Reference in New Issue
Block a user