summaryrefslogtreecommitdiff
path: root/src/GF/Canon
diff options
context:
space:
mode:
authoraarne <unknown>2004-06-24 14:06:09 +0000
committeraarne <unknown>2004-06-24 14:06:09 +0000
commit3b39607bbac8e6ab99198ab608f14e1f84c2f60e (patch)
tree35b823c38ef0ed7439f1a057d939fbdfa96bc719 /src/GF/Canon
parentd3db78ad31fe8b27c7ebb4e05b92d4c3986cb119 (diff)
last-minute bug fixes
Diffstat (limited to 'src/GF/Canon')
-rw-r--r--src/GF/Canon/CMacros.hs10
-rw-r--r--src/GF/Canon/Look.hs1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/GF/Canon/CMacros.hs b/src/GF/Canon/CMacros.hs
index da936e735..37693efa5 100644
--- a/src/GF/Canon/CMacros.hs
+++ b/src/GF/Canon/CMacros.hs
@@ -104,6 +104,16 @@ defLinType = RecType [Lbg (L (A.identC "s")) TStr]
defLindef :: Term
defLindef = R [Ass (L (A.identC "s")) (Arg (A (A.identC "str") 0))]
+isDiscontinuousCType :: CType -> Bool
+isDiscontinuousCType t = case t of
+ RecType rs -> length [t | Lbg _ t <- rs, valTableType t == TStr] > 1
+ _ -> True --- does not occur; would not behave well in lin commands
+
+valTableType :: CType -> CType
+valTableType t = case t of
+ Table _ v -> valTableType v
+ _ -> t
+
strsFromTerm :: Term -> Err [Str]
strsFromTerm t = case t of
K (KS s) -> return [str s]
diff --git a/src/GF/Canon/Look.hs b/src/GF/Canon/Look.hs
index 228a43f3c..8dfd4b3fb 100644
--- a/src/GF/Canon/Look.hs
+++ b/src/GF/Canon/Look.hs
@@ -41,6 +41,7 @@ lookupLincat gr f = do
case info of
CncCat t _ _ -> return t
AnyInd _ n -> lookupLincat gr $ redirectIdent n f
+ _ -> prtBad "no lincat found for" f
lookupPrintname :: CanonGrammar -> CIdent -> Err Term
lookupPrintname gr f = do