diff options
| author | hallgren <hallgren@chalmers.se> | 2012-11-06 15:29:38 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-11-06 15:29:38 +0000 |
| commit | 1dbf575a71491068547614a54cfbb32580dc89a8 (patch) | |
| tree | 49b3a33663056fd4d7cdef99a88c337bcaf4f175 | |
| parent | cfcf7cbc7fb801c22c8d31f7ad7014606d2e8fb9 (diff) | |
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=
| -rw-r--r-- | src/compiler/GFServer.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs index dfb76bc88..fc0dcf347 100644 --- a/src/compiler/GFServer.hs +++ b/src/compiler/GFServer.hs @@ -211,9 +211,12 @@ handle state0 cache execute1 then return path else err $ resp400 $ "unacceptable path "++path - make skip dir files = - do _ <- upload skip files - let args = "-s":"-make":map fst files + make skip dir args = + do let (flags,files) = partition ((=="-").take 1.fst) args + _ <- 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) out <- liftIO $ readProcessWithExitCode "gf" args "" cwd <- liftIO $ getCurrentDirectory |
