diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2006-06-02 08:34:17 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2006-06-02 08:34:17 +0000 |
| commit | 58bcb9e22e1ce09e6ed0bbdbf08e5df76f2a74b5 (patch) | |
| tree | 6158c033487626e8457b28eefcbf8e1a4912f60b /src/GF/Conversion | |
| parent | 81f2e036e788c14f44c44a0f24e8fb1353481a44 (diff) | |
fix the "stack overflow" error with the Swedish grammar
Diffstat (limited to 'src/GF/Conversion')
| -rw-r--r-- | src/GF/Conversion/SimpleToFCFG.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Conversion/SimpleToFCFG.hs b/src/GF/Conversion/SimpleToFCFG.hs index ba729e9b0..3bdcfa455 100644 --- a/src/GF/Conversion/SimpleToFCFG.hs +++ b/src/GF/Conversion/SimpleToFCFG.hs @@ -340,7 +340,6 @@ data STermSelector | TblPrj STerm STermSelector | ConSel [STerm] | StrSel - deriving Show mkSingletonSelector :: SLinType -> BacktrackM () STermSelector @@ -377,10 +376,14 @@ mkSelector rcs tcss = add (cas@(pat',sub_sel):cases) | pat == pat' = (pat',addProjection sub_sel path):cases | otherwise = cas : add cases - addProjection x y = error ("addProjection "++show x ++ " " ++ prt (Path y)) addRestriction :: STermSelector -> ([Either Label STerm],STerm) -> STermSelector - addRestriction (ConSel terms) ([] ,term) = ConSel (term:terms) + addRestriction (ConSel terms) ([] ,term) = ConSel (add terms) + where + add [] = [term] + add (term':terms) + | term == term' = term': terms + | otherwise = term':add terms addRestriction (RecSel fields) (Left lbl : path,term) = RecSel (add fields) where add [] = [(lbl,path2selector (ConSel [term]) path)] |
