diff options
| author | aarne <unknown> | 2005-02-15 10:06:30 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-02-15 10:06:30 +0000 |
| commit | f8df4df53065fdafc76306e20e5e12b335254042 (patch) | |
| tree | d1cb99ac2114eb7cc289a71e6be1fb8bbb72f82f /src/GF/Grammar/Compute.hs | |
| parent | 1befa19e222c0c44142696e4aaf7d942ae348653 (diff) | |
record type extension freshness check
Diffstat (limited to 'src/GF/Grammar/Compute.hs')
| -rw-r--r-- | src/GF/Grammar/Compute.hs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/GF/Grammar/Compute.hs b/src/GF/Grammar/Compute.hs index 2ddce3a6c..643621119 100644 --- a/src/GF/Grammar/Compute.hs +++ b/src/GF/Grammar/Compute.hs @@ -86,17 +86,21 @@ computeTerm gr = comp where t' <- comp g t case t' of FV rs -> mapM (\c -> comp g (P c l)) rs >>= returnC . FV - R r -> maybe (prtBad "no value for label" l) (comp g . snd) $ lookup l r + R r -> maybe (prtBad "no value for label" l) (comp g . snd) $ + lookup l $ reverse r - ExtR (R a) b -> -- NOT POSSIBLE both a and b records! - case comp g (P (R a) l) of - Ok v -> return v - _ -> comp g (P b l) ExtR a (R b) -> case comp g (P (R b) l) of Ok v -> return v _ -> comp g (P a l) +--- { - --- this is incorrect, since b can contain the proper value + ExtR (R a) b -> -- NOT POSSIBLE both a and b records! + case comp g (P (R a) l) of + Ok v -> return v + _ -> comp g (P b l) +--- - } --- + Alias _ _ r -> comp g (P r l) S (T i cs) e -> prawitz g i (flip P l) cs e @@ -207,8 +211,8 @@ computeTerm gr = comp where (Alias _ _ d, _) -> comp g $ ExtR d s' (_, Alias _ _ d) -> comp g $ Glue r' d - (R rs, R ss) -> return $ R (rs ++ ss) - (RecType rs, RecType ss) -> return $ RecType (rs ++ ss) + (R rs, R ss) -> plusRecord r' s' + (RecType rs, RecType ss) -> plusRecType r' s' _ -> return $ ExtR r' s' -- case-expand tables |
