mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
change how hosted declarations are pushed
This commit is contained in:
parent
a44a99c6cf
commit
5f1e2c60f8
1 changed files with 12 additions and 22 deletions
|
@ -242,32 +242,22 @@ where
|
|||
// symbols from this set
|
||||
let mut exposed_but_not_defined = exposed_symbols.clone();
|
||||
|
||||
let hosted_declarations = if let Some(effect_symbol) = effect_symbol {
|
||||
let mut declarations = Vec::new();
|
||||
let mut exposed_symbols = MutSet::default();
|
||||
|
||||
// NOTE this currently builds all functions, not just the ones that the user requested
|
||||
crate::effect_module::build_effect_builtins(
|
||||
&mut env,
|
||||
&mut scope,
|
||||
effect_symbol,
|
||||
var_store,
|
||||
&mut exposed_symbols,
|
||||
&mut declarations,
|
||||
);
|
||||
|
||||
declarations
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
match sort_can_defs(&mut env, defs, Output::default()) {
|
||||
(Ok(mut declarations), output) => {
|
||||
use crate::def::Declaration::*;
|
||||
|
||||
for x in hosted_declarations {
|
||||
// TODO should this be `insert(0, x)`?
|
||||
declarations.push(x);
|
||||
if let Some(effect_symbol) = effect_symbol {
|
||||
let mut exposed_symbols = MutSet::default();
|
||||
|
||||
// NOTE this currently builds all functions, not just the ones that the user requested
|
||||
crate::effect_module::build_effect_builtins(
|
||||
&mut env,
|
||||
&mut scope,
|
||||
effect_symbol,
|
||||
var_store,
|
||||
&mut exposed_symbols,
|
||||
&mut declarations,
|
||||
);
|
||||
}
|
||||
|
||||
for decl in declarations.iter_mut() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue