mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
fixed scope lookup bug
This commit is contained in:
parent
0a77b3f334
commit
c7c421b2f5
19 changed files with 212 additions and 185 deletions
|
@ -4,8 +4,11 @@ use roc_ast::{
|
|||
lang::{self, core::def::def_to_def2::def_to_def2},
|
||||
mem_pool::pool::Pool,
|
||||
};
|
||||
use roc_code_markup::{markup::{convert::from_def2::def2_to_markup, nodes::tree_as_string}, slow_pool::SlowPool};
|
||||
use roc_module::symbol::{IdentIds, Interns, ModuleId, ModuleIds};
|
||||
use roc_code_markup::{
|
||||
markup::{convert::from_def2::def2_to_markup, nodes::tree_as_string},
|
||||
slow_pool::SlowPool,
|
||||
};
|
||||
use roc_module::symbol::{IdentIds, Interns, ModuleId};
|
||||
use roc_region::all::Region;
|
||||
use roc_types::subs::VarStore;
|
||||
|
||||
|
@ -16,7 +19,6 @@ pub fn defs_to_html<'a>(
|
|||
buf: &mut BumpString<'a>,
|
||||
defs: Vec<roc_parse::ast::Def<'a>>,
|
||||
env_module_id: ModuleId,
|
||||
env_module_ids: &'a ModuleIds,
|
||||
interns: &mut Interns,
|
||||
) -> DocsResult<()> {
|
||||
let mut env_pool = Pool::with_capacity(1024);
|
||||
|
@ -34,12 +36,12 @@ pub fn defs_to_html<'a>(
|
|||
&mut env_pool,
|
||||
&mut var_store,
|
||||
dep_idents,
|
||||
env_module_ids,
|
||||
&interns.module_ids,
|
||||
exposed_ident_ids,
|
||||
);
|
||||
|
||||
let mut scope = lang::scope::Scope::new(env.home, env.pool, env.var_store);
|
||||
scope.fill_scope(&env, interns)?;
|
||||
scope.fill_scope(&env, &mut interns.all_ident_ids)?;
|
||||
|
||||
let region = Region::new(0, 0, 0, 0);
|
||||
|
||||
|
@ -74,7 +76,10 @@ fn write_def_to_bump_str_html<'a, 'b>(
|
|||
interns,
|
||||
)?;
|
||||
|
||||
println!("MARKUP_TREE {}", tree_as_string(def2_markup_id, &mark_node_pool));
|
||||
println!(
|
||||
"MARKUP_TREE {}",
|
||||
tree_as_string(def2_markup_id, &mark_node_pool)
|
||||
);
|
||||
|
||||
let def2_markup_node = mark_node_pool.get(def2_markup_id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue