summaryrefslogtreecommitdiff
path: root/src/GF/Conversion/SimpleToFCFG.hs
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2006-06-03 10:30:10 +0000
committerkr.angelov <kr.angelov@gmail.com>2006-06-03 10:30:10 +0000
commit81d9aea92fe738858cbde011d5f92de8646abb3b (patch)
tree82e240e0bb5801beb49a05ad2769becee092358f /src/GF/Conversion/SimpleToFCFG.hs
parentc5550bd482d7f81b8aa2648dffdcc72705457f1d (diff)
the constraints list in the conversion rules should be sorted too
Diffstat (limited to 'src/GF/Conversion/SimpleToFCFG.hs')
-rw-r--r--src/GF/Conversion/SimpleToFCFG.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/GF/Conversion/SimpleToFCFG.hs b/src/GF/Conversion/SimpleToFCFG.hs
index 3bdcfa455..17a713546 100644
--- a/src/GF/Conversion/SimpleToFCFG.hs
+++ b/src/GF/Conversion/SimpleToFCFG.hs
@@ -298,10 +298,14 @@ genFCatArg env@(FRulesEnv last_id fcatSet rules) m1@(FCat _ cat rcs tcs) ctype =
gen_tcs (StrT) path acc = return acc
gen_tcs (ConT terms) path acc =
case List.lookup path tcs of
- Just term -> return ((path,term) : acc)
+ Just term -> return $! addConstraint path term acc
Nothing -> do writeState True
term <- member terms
- return ((path,term) : acc)
+ return $! addConstraint path term acc
+ where
+ addConstraint path0 term0 (c@(path,term) : cs)
+ | path0 > path = c:addConstraint path0 term0 cs
+ addConstraint path0 term0 cs = (path0,term0) : cs
takeToDoRules :: SRulesMap -> FRulesEnv -> ([([SRule], STermSelector)], FRulesEnv)
takeToDoRules srulesMap (FRulesEnv last_id fcatSet rules) = (todo,FRulesEnv last_id fcatSet' rules)