diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2021-05-03 13:19:08 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2021-05-03 13:19:08 +0200 |
| commit | 450368f9bbf2948365953ae35069b5039ba38a28 (patch) | |
| tree | c9694513d42b1a19f33a990b4bffe158d0a64d65 /src/runtime/haskell-bind/test.hs | |
| parent | 60bc752a6f705cca1edcd0e48bcfe947fd98b4b5 (diff) | |
First attempt at adding support for complete in PGF2 (gives segmentation faults)
Diffstat (limited to 'src/runtime/haskell-bind/test.hs')
| -rw-r--r-- | src/runtime/haskell-bind/test.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/test.hs b/src/runtime/haskell-bind/test.hs new file mode 100644 index 000000000..16e7ff7cb --- /dev/null +++ b/src/runtime/haskell-bind/test.hs @@ -0,0 +1,12 @@ +import PGF2 +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) + let pr = complete concr (startCat pgf) "this" "wi" Nothing + case pr of + ParseOk x -> print (head x) + ParseFailed _ _ -> putStrLn "parse failed" + ParseIncomplete -> putStrLn "input incomplete" |
