diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2021-05-03 22:28:48 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2021-05-03 22:28:48 +0200 |
| commit | 84fd431afd54644bbe4bfc2c09c444f5a99e35cb (patch) | |
| tree | 792e929d8d6062f6c2ea6610d0ca766ae88468d0 /src/runtime/haskell-bind/test.hs | |
| parent | 588cd6ddb16350ed947a975a28315806164fe651 (diff) | |
Manage to get completion working in PGF2
Diffstat (limited to 'src/runtime/haskell-bind/test.hs')
| -rw-r--r-- | src/runtime/haskell-bind/test.hs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/runtime/haskell-bind/test.hs b/src/runtime/haskell-bind/test.hs deleted file mode 100644 index 1c0c9fa87..000000000 --- a/src/runtime/haskell-bind/test.hs +++ /dev/null @@ -1,25 +0,0 @@ -import PGF2 -import qualified Data.Char as C -import qualified Data.List as L -import qualified Data.Map as M - -main :: IO () -main = do - pgf <- readPGF "/Users/john/repositories/GF/contrib/foods/Foods.pgf" - let - Just concr = M.lookup "FoodsEng" (languages pgf) - loop = do - putStr "> " - input <- getLine - let - (sent,pfx) = - if C.isSpace (last input) - then (input, "") - else let toks = words input in (unwords (init toks), last toks) - let pr = complete concr (startCat pgf) sent pfx Nothing - case pr of - ParseOk x -> print x - ParseFailed x s -> putStrLn $ "parse failed at " ++ show x ++ " " ++ s - ParseIncomplete -> putStrLn "input incomplete" - loop - loop |
