mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-09-19 00:36:02 -06:00
categories in PredefCnc should also have lock fields
This commit is contained in:
@@ -25,9 +25,9 @@ import GF.Data.Operations(ErrorMonad,Err(..))
|
||||
lock :: Ident -> Term -> Term
|
||||
lock c t@(RecType rs) =
|
||||
let lbl = lockLabel c
|
||||
in if elem lbl [l | (l,_,_)<-rs] || elem c [cString,cInt]
|
||||
then t --- don't add an extra copy of lock field, nor predef cats
|
||||
else RecType (rs ++ [(lbl, [], RecType [])])
|
||||
in if null [l | (l,_,_)<-rs, l == lbl]
|
||||
then RecType (rs ++ [(lbl, [], RecType [])])
|
||||
else t --- don't add an extra copy of lock field, nor predef cats
|
||||
lock c t@(R rs) =
|
||||
let lbl = lockLabel c
|
||||
in if elem lbl (map fst rs)
|
||||
|
||||
@@ -235,7 +235,7 @@ lookupAbsDef gr q@(m,c) = errIn (render ("looking up absdef of" <+> c)) $ do
|
||||
_ -> return Nothing
|
||||
|
||||
lookupLincat :: ErrorMonad m => Grammar -> ModuleName -> Ident -> m Type
|
||||
lookupLincat gr m c | isPredefCat c = return defLinType --- ad hoc; not needed?
|
||||
lookupLincat gr m c | isPredefCat c = return (lock c defLinType) --- ad hoc; not needed?
|
||||
lookupLincat gr m c = do
|
||||
info <- lookupQIdentInfo gr (m,c)
|
||||
case info of
|
||||
@@ -247,7 +247,7 @@ lookupLincat gr m c = do
|
||||
lookupAbsType :: ErrorMonad m => Grammar -> QIdent -> m (Term,Type)
|
||||
lookupAbsType gr q@(m,c)
|
||||
| m == cPredefAbs =
|
||||
if elem c [cInt,cFloat,cString]
|
||||
if isPredefCat c
|
||||
then return (QC q,typeType)
|
||||
else no_type
|
||||
| otherwise = do
|
||||
|
||||
Reference in New Issue
Block a user