From 312e602dfe69fc6d391d58d715fccad6c1ed1023 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 2 Nov 2011 16:54:22 +0000 Subject: gfse: supply information about what's defined in the exampe language to the server functions for example-based grammar writing --- src/example-based/ExampleService.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/example-based/ExampleService.hs') diff --git a/src/example-based/ExampleService.hs b/src/example-based/ExampleService.hs index 0065fd4dd..185e4fd94 100644 --- a/src/example-based/ExampleService.hs +++ b/src/example-based/ExampleService.hs @@ -22,12 +22,16 @@ cgiMain' root cwd cache = do command <- getInp "command" environ <- parseEnviron =<< getInp "state" case command of - "possibilities" -> outputJSONP (E.getNext environ) - "provide_example" -> doProvideExample root cwd cache environ + "possibilities" -> doPossibilities environ + "provide_example" -> doProvideExample root cwd cache environ "abstract_example" -> doAbstractExample cwd cache environ - "test_function" -> doTestFunction cwd cache environ + "test_function" -> doTestFunction cwd cache environ _ -> throwCGIError 400 ("Unknown command: "++command) [] +doPossibilities environ = + do example_environ <- parseEnviron =<< getInp "example_state" + outputJSONP (E.getNext environ example_environ) + doProvideExample root cwd cache environ = do Just lang <- readInput "lang" fun <- getCId "fun" -- cgit v1.2.3