mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-19 08:02:51 -06:00
bug fix in with-modules and gr checker; factoring out cats to Common
This commit is contained in:
@@ -4,7 +4,7 @@ abstract Adverb = Cat ** {
|
|||||||
|
|
||||||
fun
|
fun
|
||||||
|
|
||||||
-- The two main ways of formins adverbs is from adjectives and by
|
-- The two main ways of forming adverbs are from adjectives and by
|
||||||
-- prepositions from noun phrases.
|
-- prepositions from noun phrases.
|
||||||
|
|
||||||
PositAdvAdj : A -> Adv ; -- quickly
|
PositAdvAdj : A -> Adv ; -- quickly
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ abstract Cat = Common ** {
|
|||||||
|
|
||||||
QCl ; -- question clause, with all tenses e.g. "why does she walk"
|
QCl ; -- question clause, with all tenses e.g. "why does she walk"
|
||||||
IP ; -- interrogative pronoun e.g. "who"
|
IP ; -- interrogative pronoun e.g. "who"
|
||||||
IAdv ; -- interrogative adverb e.g. "why"
|
|
||||||
IComp ; -- interrogative complement of copula e.g. "where"
|
IComp ; -- interrogative complement of copula e.g. "where"
|
||||||
IDet ; -- interrogative determiner e.g. "which"
|
IDet ; -- interrogative determiner e.g. "which"
|
||||||
|
|
||||||
@@ -68,16 +67,6 @@ abstract Cat = Common ** {
|
|||||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||||
|
|
||||||
--2 Adverbs
|
|
||||||
|
|
||||||
-- Constructed in [Adverb Adverb.html].
|
|
||||||
-- Many adverbs are constructed in [Structural Structural.html].
|
|
||||||
|
|
||||||
Adv ; -- verb-phrase-modifying adverb, e.g. "in the house"
|
|
||||||
AdV ; -- adverb directly attached to verb e.g. "always"
|
|
||||||
AdA ; -- adjective-modifying adverb, e.g. "very"
|
|
||||||
AdN ; -- numeral-modifying adverb, e.g. "more than"
|
|
||||||
|
|
||||||
--2 Numerals
|
--2 Numerals
|
||||||
|
|
||||||
-- Constructed in [Numeral Numeral.html].
|
-- Constructed in [Numeral Numeral.html].
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
--
|
--
|
||||||
-- Here we have some words belonging to closed classes and appearing
|
-- Here we have some words belonging to closed classes and appearing
|
||||||
-- in all languages we have considered.
|
-- in all languages we have considered.
|
||||||
-- Sometimes they are not really meaningful, e.g. $we_NP$ in Spanish
|
-- Sometimes they are not really meaningful, e.g. $we_Pron$ in Spanish
|
||||||
-- should be replaced by masculine and feminine variants.
|
-- should be replaced by masculine and feminine variants.
|
||||||
|
|
||||||
abstract Structural = Cat ** {
|
abstract Structural = Cat ** {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--1 Texts
|
--1 Texts
|
||||||
|
|
||||||
abstract Text = Cat ** {
|
abstract Text = Common ** {
|
||||||
|
|
||||||
fun
|
fun
|
||||||
TEmpty : Text ;
|
TEmpty : Text ;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete TextX of Text = {
|
concrete TextX of Text = CommonX ** {
|
||||||
|
|
||||||
-- This will work for almost all languages except Spanish.
|
-- This will work for almost all languages except Spanish.
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ inferLType gr trm = case trm of
|
|||||||
Q m ident | isPredef m -> termWith trm $ checkErr (typPredefined ident)
|
Q m ident | isPredef m -> termWith trm $ checkErr (typPredefined ident)
|
||||||
|
|
||||||
Q m ident -> checks [
|
Q m ident -> checks [
|
||||||
termWith trm $ checkErr (lookupResType gr m ident)
|
termWith trm $ checkErr (lookupResType gr m ident) >>= comp
|
||||||
,
|
,
|
||||||
checkErr (lookupResDef gr m ident) >>= infer
|
checkErr (lookupResDef gr m ident) >>= infer
|
||||||
,
|
,
|
||||||
@@ -356,7 +356,7 @@ inferLType gr trm = case trm of
|
|||||||
QC m ident | isPredef m -> termWith trm $ checkErr (typPredefined ident)
|
QC m ident | isPredef m -> termWith trm $ checkErr (typPredefined ident)
|
||||||
|
|
||||||
QC m ident -> checks [
|
QC m ident -> checks [
|
||||||
termWith trm $ checkErr (lookupResType gr m ident)
|
termWith trm $ checkErr (lookupResType gr m ident) >>= comp
|
||||||
,
|
,
|
||||||
checkErr (lookupResDef gr m ident) >>= infer
|
checkErr (lookupResDef gr m ident) >>= infer
|
||||||
,
|
,
|
||||||
@@ -825,7 +825,7 @@ checkEqLType env t u trm = do
|
|||||||
not (any (\ (k,b) -> alpha g a b && l == k) ts)]
|
not (any (\ (k,b) -> alpha g a b && l == k) ts)]
|
||||||
(locks,others) = partition isLockLabel ls
|
(locks,others) = partition isLockLabel ls
|
||||||
in case others of
|
in case others of
|
||||||
_:_ -> Bad $ "missing record fieds" +++ unwords (map prt others)
|
_:_ -> Bad $ "missing record fields" +++ unwords (map prt others)
|
||||||
_ -> return locks
|
_ -> return locks
|
||||||
_ -> Bad ""
|
_ -> Bad ""
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ rebuildModule ms mo@(i,mi) = do
|
|||||||
++ [oQualif i i | i <- map snd insts] ----
|
++ [oQualif i i | i <- map snd insts] ----
|
||||||
++ [oSimple i | i <- map snd insts] ----
|
++ [oSimple i | i <- map snd insts] ----
|
||||||
---- ++ [oSimple ext] ---- to encode dependence
|
---- ++ [oSimple ext] ---- to encode dependence
|
||||||
--- check if me is incomplete; --- why inherit all forced by syntax
|
--- check if me is incomplete
|
||||||
return $ ModMod $ Module mt0 stat' fs (map inheritAll me) ops1 js
|
return $ ModMod $ Module mt0 stat' fs me ops1 js
|
||||||
---- (mapTree (qualifInstanceInfo insts) js) -- not needed
|
---- (mapTree (qualifInstanceInfo insts) js) -- not needed
|
||||||
|
|
||||||
_ -> return mi
|
_ -> return mi
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ data MGrammar i f a = MGrammar {modules :: [(i,ModInfo i f a)]}
|
|||||||
data ModInfo i f a =
|
data ModInfo i f a =
|
||||||
ModMainGrammar (MainGrammar i)
|
ModMainGrammar (MainGrammar i)
|
||||||
| ModMod (Module i f a)
|
| ModMod (Module i f a)
|
||||||
| ModWith (ModuleType i) ModuleStatus i [i] [OpenSpec i]
|
| ModWith (ModuleType i) ModuleStatus i [(i,MInclude i)] [OpenSpec i]
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|
||||||
data Module i f a = Module {
|
data Module i f a = Module {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ transModDef x = case x of
|
|||||||
opens' <- mapM transOpen opens
|
opens' <- mapM transOpen opens
|
||||||
return (id', GM.ModWith mtyp' mstat' m' [] opens')
|
return (id', GM.ModWith mtyp' mstat' m' [] opens')
|
||||||
MWithE extends m opens -> do
|
MWithE extends m opens -> do
|
||||||
extends' <- liftM (map fst) $ mapM transIncludedExt extends
|
extends' <- mapM transIncludedExt extends
|
||||||
m' <- transIdent m
|
m' <- transIdent m
|
||||||
opens' <- mapM transOpen opens
|
opens' <- mapM transOpen opens
|
||||||
return (id', GM.ModWith mtyp' mstat' m' extends' opens')
|
return (id', GM.ModWith mtyp' mstat' m' extends' opens')
|
||||||
|
|||||||
Reference in New Issue
Block a user