1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 20:31:55 +03:00

raise FreeVariable error from address

This commit is contained in:
Charlie Somerville 2018-05-31 15:14:45 -05:00
parent a9958fcc5f
commit 207a105e94
3 changed files with 7 additions and 1 deletions

View File

@ -84,6 +84,7 @@ convergingModules :: ( AbstractValue address value effects
, Member (Reader (Cache term address (Cell address) value)) effects
, Member (Reader (Environment address)) effects
, Member (Reader (Live address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (State (Cache term address (Cell address) value)) effects
, Member (State (Environment address)) effects
, Member (State (Heap address (Cell address) value)) effects

View File

@ -223,6 +223,7 @@ evaluateInScopedEnv scopedEnvTerm term = do
value :: ( AbstractValue address value effects
, Member (Allocator address value) effects
, Member (Reader (Environment address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (State (Environment address)) effects
)
=> ValueRef address value
@ -233,6 +234,7 @@ value = deref <=< address
subtermValue :: ( AbstractValue address value effects
, Member (Allocator address value) effects
, Member (Reader (Environment address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (State (Environment address)) effects
)
=> Subterm term (Evaluator address value effects (ValueRef address value))
@ -242,17 +244,19 @@ subtermValue = value <=< subtermRef
address :: ( AbstractValue address value effects
, Member (Allocator address value) effects
, Member (Reader (Environment address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (State (Environment address)) effects
)
=> ValueRef address value
-> Evaluator address value effects address
address (LvalLocal var) = fromJust <$> lookupEnv var
address (LvalLocal var) = variable var
address (LvalMember obj prop) = evaluateInScopedEnv (deref obj) (fromJust <$> lookupEnv prop)
address (Rval addr) = pure addr
subtermAddress :: ( AbstractValue address value effects
, Member (Allocator address value) effects
, Member (Reader (Environment address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (State (Environment address)) effects
)
=> Subterm term (Evaluator address value effects (ValueRef address value))

View File

@ -57,6 +57,7 @@ include :: ( AbstractValue address value effects
, Member (Allocator address value) effects
, Member (Modules address value) effects
, Member (Reader (Environment address)) effects
, Member (Resumable (EnvironmentError address)) effects
, Member (Resumable ResolutionError) effects
, Member (State (Environment address)) effects
, Member (State (Exports address)) effects