From 391b301881bee7de9580f2c6d819144161e6a51d Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 21 Oct 2014 19:20:31 +0000 Subject: ModuleName and Ident are now distinct types This makes the documentation clearer, and can potentially catch more programming mistakes. --- src/compiler/GF/Compile/Compute/ConcreteNew.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/compiler/GF/Compile/Compute') diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs index 6bc653983..06d9b0000 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs @@ -7,7 +7,7 @@ module GF.Compile.Compute.ConcreteNew import GF.Grammar hiding (Env, VGen, VApp, VRecType) import GF.Grammar.Lookup(lookupResDefLoc,allParamValues) -import GF.Grammar.Predef(cPredef,cErrorType,cTok,cStr,isPredefCat) +import GF.Grammar.Predef(cPredef,cErrorType,cTok,cStr) import GF.Grammar.PatternMatch(matchPattern,measurePatt) import GF.Grammar.Lockfield(lockLabel,isLockLabel,lockRecType) --unlockRecord import GF.Compile.Compute.Value hiding (Error) @@ -38,10 +38,10 @@ apply env = apply' env -- * Environments -type ResourceValues = Map.Map Ident (Map.Map Ident (Err Value)) +type ResourceValues = Map.Map ModuleName (Map.Map Ident (Err Value)) -data GlobalEnv = GE SourceGrammar ResourceValues (L Ident) -data CompleteEnv = CE {srcgr::SourceGrammar,rvs::ResourceValues, +data GlobalEnv = GE Grammar ResourceValues (L Ident) +data CompleteEnv = CE {srcgr::Grammar,rvs::ResourceValues, gloc::L Ident,local::LocalScope} type LocalScope = [Ident] type Stack = [Value] @@ -73,7 +73,7 @@ resource env (m,c) = if isPredefCat c then value0 env =<< lockRecType c defLinType -- hmm else maybe e id $ Map.lookup c =<< Map.lookup m (rvs env) - where e = fail $ "Not found: "++showIdent m++"."++showIdent c + where e = fail $ "Not found: "++render m++"."++showIdent c -- | Convert operators once, not every time they are looked up resourceValues :: SourceGrammar -> GlobalEnv -- cgit v1.2.3