diff --git a/examples/tram/Tram.gf b/examples/tram/Tram.gf index 6a7fa1763..1e437d5ed 100644 --- a/examples/tram/Tram.gf +++ b/examples/tram/Tram.gf @@ -1,4 +1,4 @@ -abstract Tram = { +abstract Tram = PredefAbs ** { cat Dep ; -- from here, from Angered diff --git a/examples/tram/TramEng.gf b/examples/tram/TramEng.gf index a9dc1543f..994c0fcdc 100644 --- a/examples/tram/TramEng.gf +++ b/examples/tram/TramEng.gf @@ -1,5 +1,4 @@ ---# -path=.:compiled --- --# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/multimodal:resource-1.0/english:prelude:resource-1.0/mathematical +--# -path=.:compiled:prelude concrete TramEng of Tram = TramI with (Multimodal = MultimodalEng), diff --git a/examples/tram/TramFin.gf b/examples/tram/TramFin.gf new file mode 100644 index 000000000..b7d861d12 --- /dev/null +++ b/examples/tram/TramFin.gf @@ -0,0 +1,5 @@ +--# -path=.:compiled:prelude + +concrete TramFin of Tram = TramI with + (Multimodal = MultimodalFin), + (Symbol = SymbolFin) ; diff --git a/examples/tram/TramFre.gf b/examples/tram/TramFre.gf index 8c3cb7529..32e992717 100644 --- a/examples/tram/TramFre.gf +++ b/examples/tram/TramFre.gf @@ -1,4 +1,6 @@ ---# -path=.:resource-1.0/abstract:resource-1.0/french:resource-1.0/common:resource-1.0/multimodal:resource-1.0/romance:prelude:resource-1.0/mathematical +--# -path=.:compiled:prelude + +-- --# -path=.:resource-1.0/abstract:resource-1.0/french:resource-1.0/common:resource-1.0/multimodal:resource-1.0/romance:prelude:resource-1.0/mathematical concrete TramFre of Tram = TramI with (Multimodal = MultimodalFre), diff --git a/examples/tram/TramGer.gf b/examples/tram/TramGer.gf index fb97452cb..1d1fb3281 100644 --- a/examples/tram/TramGer.gf +++ b/examples/tram/TramGer.gf @@ -1,4 +1,5 @@ ---# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/mathematical:resource-1.0/multimodal:resource-1.0/german:prelude +--# -path=.:compiled:prelude +-- --# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/mathematical:resource-1.0/multimodal:resource-1.0/german:prelude concrete TramGer of Tram = TramI with (Multimodal = MultimodalGer), diff --git a/examples/tram/TramI.gf b/examples/tram/TramI.gf index 90c5e5261..1d505fc58 100644 --- a/examples/tram/TramI.gf +++ b/examples/tram/TramI.gf @@ -31,8 +31,8 @@ lin DestClick = here7to_MAdv ; DepHere = DemAdv here7from_Adv ; DestHere = DemAdv here7to_Adv ; ---- DepNamed s = MPrepNP from_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ; ---- DestNamed s = MPrepNP to_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ; + DepNamed s = MPrepNP from_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ; + DestNamed s = MPrepNP to_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ; CCoord x y = {point = "(" ++ x.s ++ "," ++ y.s ++ ")" ; lock_Point = <>} ; diff --git a/examples/tram/TramSwe.gf b/examples/tram/TramSwe.gf index 59d0ff7f0..3d4814791 100644 --- a/examples/tram/TramSwe.gf +++ b/examples/tram/TramSwe.gf @@ -1,4 +1,4 @@ ---# -path=.:compiled +--# -path=.:compiled:prelude -- --# -path=.:resource-1.0/abstract:resource-1.0/swedish:resource-1.0/common:resource-1.0/multimodal:resource-1.0/scandinavian:prelude:resource-1.0/mathematical diff --git a/lib/resource-1.0/Makefile b/lib/resource-1.0/Makefile index 7daa44921..77dcddbe6 100644 --- a/lib/resource-1.0/Makefile +++ b/lib/resource-1.0/Makefile @@ -5,6 +5,9 @@ test: langs: echo "s ;; pm | wf langs.gfcm" | gf -src -nocf */Lang??*.gf english/LangEng.gf +RTS -M500M +install: + cp -p */*.gfc */*.gfr ../compiled + stat: wc */*.gfc gfdoc: diff --git a/lib/resource-1.0/mathematical/Symbol.gf b/lib/resource-1.0/mathematical/Symbol.gf index a8ae1b38a..cbc3cd1db 100644 --- a/lib/resource-1.0/mathematical/Symbol.gf +++ b/lib/resource-1.0/mathematical/Symbol.gf @@ -3,7 +3,7 @@ -- *Note*. This module is not automatically included in the main -- grammar [Lang Lang.html]. -abstract Symbol = Cat ** { +abstract Symbol = Cat, PredefAbs ** { --2 Noun phrases with symbols and numbers diff --git a/lib/resource-1.0/multimodal/Demonstrative.gf b/lib/resource-1.0/multimodal/Demonstrative.gf index c1427e0a3..fffca641d 100644 --- a/lib/resource-1.0/multimodal/Demonstrative.gf +++ b/lib/resource-1.0/multimodal/Demonstrative.gf @@ -1,4 +1,4 @@ -abstract Demonstrative = Cat ** { +abstract Demonstrative = Cat, PredefAbs ** { -- Naming convention: $M$ prepended to 'unimodal' names. -- Exceptions: lexical units, those without unimodal counterparts. diff --git a/lib/resource-1.0/multimodal/DemonstrativeFin.gf b/lib/resource-1.0/multimodal/DemonstrativeFin.gf new file mode 100644 index 000000000..2e99961cb --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeFin.gf @@ -0,0 +1,4 @@ +--# -path=.:../finnish/:../abstract:../common:prelude + +concrete DemonstrativeFin of Demonstrative = CatFin ** DemonstrativeI with + (Lang = LangFin) ; diff --git a/lib/resource-1.0/multimodal/MultimodalFin.gf b/lib/resource-1.0/multimodal/MultimodalFin.gf new file mode 100644 index 000000000..6331795a9 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalFin.gf @@ -0,0 +1,18 @@ +--# -path=.:../finnish/:../abstract:../common:prelude + +concrete MultimodalFin of Multimodal = + NounFin, +-- Verb, + AdjectiveFin, + AdverbFin, + NumeralFin, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralFin, + DemonstrativeFin, + LexiconFin + ** {} ; diff --git a/lib/resource-1.0/multimodal/MultimodalFre.gf b/lib/resource-1.0/multimodal/MultimodalFre.gf index b3683e35f..8ffe9104a 100644 --- a/lib/resource-1.0/multimodal/MultimodalFre.gf +++ b/lib/resource-1.0/multimodal/MultimodalFre.gf @@ -1,4 +1,4 @@ ---# -path=.:../french/:../romancs:../abstract:../common:prelude +--# -path=.:../french/:../romance:../abstract:../common:prelude concrete MultimodalFre of Multimodal = NounFre, diff --git a/src/GF/Canon/Look.hs b/src/GF/Canon/Look.hs index c0566f4dc..1fef9b586 100644 --- a/src/GF/Canon/Look.hs +++ b/src/GF/Canon/Look.hs @@ -30,6 +30,7 @@ import GF.Grammar.PrGrammar import GF.Canon.CMacros ----import Values import GF.Grammar.MMacros +import GF.Grammar.Macros (zIdent) import qualified GF.Infra.Modules as M import qualified GF.Canon.CanonToGrammar as CG @@ -50,7 +51,7 @@ lookupCncInfo gr f@(CIQ m c) = do _ -> prtBad "not concrete module" m lookupLin :: CanonGrammar -> CIdent -> Err Term -lookupLin gr f = do +lookupLin gr f = errIn "looking up linearization rule" $ do info <- lookupCncInfo gr f case info of CncFun _ _ t _ -> return t @@ -58,7 +59,9 @@ lookupLin gr f = do AnyInd _ n -> lookupLin gr $ redirectIdent n f lookupLincat :: CanonGrammar -> CIdent -> Err CType -lookupLincat gr f = do +lookupLincat gr (CIQ _ c) | elem c [zIdent "String", zIdent "Int", zIdent "Float"] = + return defLinType --- ad hoc; not needed? cf. Grammar.Lookup.lookupLincat +lookupLincat gr f = errIn "looking up linearization type" $ do info <- lookupCncInfo gr f case info of CncCat t _ _ -> return t @@ -66,7 +69,7 @@ lookupLincat gr f = do _ -> prtBad "no lincat found for" f lookupPrintname :: CanonGrammar -> CIdent -> Err Term -lookupPrintname gr f = do +lookupPrintname gr f = errIn "looking up printname" $ do info <- lookupCncInfo gr f case info of CncFun _ _ _ t -> return t diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index eaf9bc819..21eb1fbbb 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -287,6 +287,7 @@ computeLType gr t = do Q (IC "Predef") (IC "Float") -> return ty ---- shouldn't be needed Q m c | elem c [cPredef,cPredefAbs] -> return ty + Q m c | elem c [zIdent "Int",zIdent "Float",zIdent "String"] -> return defLinType ---- Q m ident -> checkIn ("module" +++ prt m) $ do ty' <- checkErr (lookupResDef gr m ident) diff --git a/src/GF/Grammar/Lookup.hs b/src/GF/Grammar/Lookup.hs index 4123f450f..6c6f13611 100644 --- a/src/GF/Grammar/Lookup.hs +++ b/src/GF/Grammar/Lookup.hs @@ -34,7 +34,7 @@ import Data.List (nub) import Control.Monad lookupResDef :: SourceGrammar -> Ident -> Ident -> Err Term -lookupResDef gr = look True where +lookupResDef gr m c = look True m c where look isTop m c = do mi <- lookupModule gr m case mi of