mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-01 15:22:50 -06:00
printnames are now kept as String instead of Term in PGF
This commit is contained in:
@@ -35,7 +35,7 @@ data Concr = Concr {
|
||||
opers :: Map.Map CId Term, -- oper generated by subex elim
|
||||
lincats :: Map.Map CId Term, -- lin type of a cat
|
||||
lindefs :: Map.Map CId Term, -- lin default of a cat
|
||||
printnames :: Map.Map CId Term, -- printname of a cat or a fun
|
||||
printnames :: Map.Map CId String, -- printname of a cat or a fun
|
||||
paramlincats :: Map.Map CId Term, -- lin type of cat, with printable param names
|
||||
parser :: Maybe ParserInfo -- parser
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE ParallelListComp #-}
|
||||
module PGF.Linearize
|
||||
(linearizes,realize,realizes,linTree, linTreeMark,linearizesMark) where
|
||||
(linearizes,showPrintName,realize,realizes,linTree, linTreeMark,linearizesMark) where
|
||||
|
||||
import PGF.CId
|
||||
import PGF.Data
|
||||
@@ -164,3 +164,7 @@ linTreeMark pgf lang = lin [] . expr2tree
|
||||
|
||||
bracket p ts = [kks ("("++show p)] ++ ts ++ [kks ")"]
|
||||
sub p i = p ++ [i]
|
||||
|
||||
-- | Show the printname of function or category
|
||||
showPrintName :: PGF -> Language -> CId -> String
|
||||
showPrintName pgf lang id = lookMap "?" id $ printnames $ lookMap (error "no lang") lang $ concretes pgf
|
||||
|
||||
@@ -29,10 +29,6 @@ lookParamLincat :: PGF -> CId -> CId -> Term
|
||||
lookParamLincat pgf lang fun =
|
||||
lookMap tm0 fun $ paramlincats $ lookMap (error "no lang") lang $ concretes pgf
|
||||
|
||||
lookPrintName :: PGF -> CId -> CId -> Term
|
||||
lookPrintName pgf lang fun =
|
||||
lookMap tm0 fun $ printnames $ lookMap (error "no lang") lang $ concretes pgf
|
||||
|
||||
lookType :: PGF -> CId -> Type
|
||||
lookType pgf f =
|
||||
case lookMap (error $ "lookType " ++ show f) f (funs (abstract pgf)) of
|
||||
|
||||
Reference in New Issue
Block a user