mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Rename addExport to export.
This commit is contained in:
parent
11a92c0cb6
commit
6a3f4ba689
@ -4,7 +4,7 @@ module Control.Abstract.Environment
|
||||
, Exports
|
||||
, getEnv
|
||||
, getExports
|
||||
, addExport
|
||||
, export
|
||||
, lookupEnv
|
||||
, bind
|
||||
, bindAll
|
||||
@ -36,8 +36,8 @@ getExports :: Member (State (Exports address)) effects => Evaluator address valu
|
||||
getExports = get
|
||||
|
||||
-- | Add an export to the global export state.
|
||||
addExport :: Member (State (Exports address)) effects => Name -> Name -> Maybe address -> Evaluator address value effects ()
|
||||
addExport name alias = modify' . insert name alias
|
||||
export :: Member (State (Exports address)) effects => Name -> Name -> Maybe address -> Evaluator address value effects ()
|
||||
export name alias = modify' . insert name alias
|
||||
|
||||
|
||||
-- | Look a 'Name' up in the current environment, trying the default environment if no value is found.
|
||||
|
@ -229,7 +229,7 @@ instance Evaluatable QualifiedExport where
|
||||
eval (QualifiedExport exportSymbols) = do
|
||||
-- Insert the aliases with no addresses.
|
||||
for_ exportSymbols $ \(name, alias) ->
|
||||
addExport name alias Nothing
|
||||
export name alias Nothing
|
||||
pure (Rval unit)
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@ instance Evaluatable QualifiedExportFrom where
|
||||
-- Look up addresses in importedEnv and insert the aliases with addresses into the exports.
|
||||
for_ exportSymbols $ \(name, alias) -> do
|
||||
let address = Env.lookup name importedEnv
|
||||
maybe (throwEvalError $ ExportError modulePath name) (addExport name alias . Just) address
|
||||
maybe (throwEvalError $ ExportError modulePath name) (export name alias . Just) address
|
||||
pure (Rval unit)
|
||||
|
||||
newtype DefaultExport a = DefaultExport { defaultExport :: a }
|
||||
@ -269,7 +269,7 @@ instance Evaluatable DefaultExport where
|
||||
Just name -> do
|
||||
addr <- lookupOrAlloc name
|
||||
assign addr v
|
||||
addExport name name Nothing
|
||||
export name name Nothing
|
||||
bind name addr
|
||||
Nothing -> throwEvalError DefaultExportError
|
||||
pure (Rval unit)
|
||||
|
Loading…
Reference in New Issue
Block a user