1
0
forked from GitHub/gf-core

overload extension: syntax overload OldModule* {def*}

This commit is contained in:
aarne
2008-06-03 09:21:24 +00:00
parent 07c8a4383a
commit 04d8846c95
7 changed files with 16 additions and 11 deletions

View File

@@ -98,7 +98,7 @@ data Info =
| ResValue (Perh (Type,Maybe Int)) -- ^ (/RES/) to mark parameter constructors for lookup
| ResOper (Perh Type) (Perh Term) -- ^ (/RES/)
| ResOverload [Term] [(Type,Term)] -- ^ (/RES/)
| ResOverload [Ident] [(Type,Term)] -- ^ (/RES/) idents: modules inherited
-- judgements in concrete syntax
| CncCat (Perh Type) (Perh Term) MPr -- ^ (/CNC/) lindef ini'zed,

View File

@@ -116,9 +116,11 @@ lookupOverload gr m c = do
ModMod mo -> do
info <- lookupIdentInfo mo c
case info of
ResOverload os tysts ->
return [(map snd args,(val,tr)) |
(ty,tr) <- tysts, Ok (args,val) <- [typeFormCnc ty]]
ResOverload os tysts -> do
tss <- mapM (\x -> lookupOverload gr x c) os
return $ [(map snd args,(val,tr)) |
(ty,tr) <- tysts, Ok (args,val) <- [typeFormCnc ty]] ++
concat tss
AnyInd _ n -> lookupOverload gr n c
_ -> Bad $ prt c +++ "is not an overloaded operation"