summaryrefslogtreecommitdiff
path: root/src/GF/UseGrammar
diff options
context:
space:
mode:
authorpeb <unknown>2005-04-14 10:42:05 +0000
committerpeb <unknown>2005-04-14 10:42:05 +0000
commitf070a412a1256b39e60b3a819e18c61922a7fe79 (patch)
treeb92a78677c55c60e265b221452cd13c94645a37e /src/GF/UseGrammar
parent03fad6e1b877e78e67b2827ba782e7da1a56565e (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/UseGrammar')
-rw-r--r--src/GF/UseGrammar/Custom.hs7
-rw-r--r--src/GF/UseGrammar/Parsing.hs11
2 files changed, 11 insertions, 7 deletions
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs
index 519413af5..441d6bd14 100644
--- a/src/GF/UseGrammar/Custom.hs
+++ b/src/GF/UseGrammar/Custom.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/12 10:49:45 $
+-- > CVS $Date: 2005/04/14 11:42:06 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.52 $
+-- > CVS $Revision: 1.53 $
--
-- A database for customizable GF shell commands.
--
@@ -264,6 +264,9 @@ customGrammarPrinter =
-- obsolete, or only for testing:
,(strCI "simple", Prt2.prt . Cnv.gfc2simple . stateGrammarLang)
,(strCI "finite", Prt2.prt . Cnv.simple2finite . Cnv.gfc2simple . stateGrammarLang)
+ ,(strCI "single", Prt2.prt . Cnv.removeSingletons . Cnv.simple2finite . Cnv.gfc2simple . stateGrammarLang)
+ ,(strCI "sg-sg", Prt2.prt . Cnv.removeSingletons . Cnv.removeSingletons . Cnv.simple2finite . Cnv.gfc2simple . stateGrammarLang)
+ ,(strCI "sg-sg-sg", Prt2.prt . Cnv.removeSingletons . Cnv.removeSingletons . Cnv.removeSingletons . Cnv.simple2finite . Cnv.gfc2simple . stateGrammarLang)
,(strCI "mcfg-old", Prt.prt . CnvOld.mcfg . statePInfoOld)
,(strCI "cfg-old", Prt.prt . CnvOld.cfg . statePInfoOld)
]
diff --git a/src/GF/UseGrammar/Parsing.hs b/src/GF/UseGrammar/Parsing.hs
index ae890b757..a50de2db7 100644
--- a/src/GF/UseGrammar/Parsing.hs
+++ b/src/GF/UseGrammar/Parsing.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/11 13:53:39 $
+-- > CVS $Date: 2005/04/14 11:42:06 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.16 $
+-- > CVS $Revision: 1.17 $
--
-- (Description of the module)
-----------------------------------------------------------------------------
@@ -57,12 +57,12 @@ parseStringC :: Options -> StateGrammar -> CFCat -> String -> Check [Tree]
parseStringC opts0 sg cat s
---- to test peb's new parser 6/10/2003
----- (to be obsoleted by "newer" below
+---- (to be obsoleted by "newer" below)
| oElem newParser opts0 = do
let pm = maybe "" id $ getOptVal opts0 useParser -- -parser=pm
ct = cfCat2Cat cat
ts <- checkErr $ NewOld.newParser pm sg ct s
- mapM (checkErr . annotate (stateGrammarST sg)) ts
+ mapM (checkErr . annotate (stateGrammarST sg) . refreshMetas []) ts
---- to test peb's newer parser 7/4-05
| oElem newerParser opts0 = do
@@ -70,7 +70,8 @@ parseStringC opts0 sg cat s
pm = maybe "" id $ getOptVal opts0 useParser -- -parser=pm
tok = customOrDefault opts useTokenizer customTokenizer sg
ts <- return $ New.parse pm (pInfo sg) (absId sg) cat (tok s)
- mapM (checkErr . annotate (stateGrammarST sg)) ts
+ ts' <- mapM (checkErr . annotate (stateGrammarST sg) . refreshMetas []) ts
+ return $ optIntOrAll opts flagNumber ts'
| otherwise = do
let opts = unionOptions opts0 $ stateOptions sg