mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
debugging wrong id in docs test
This commit is contained in:
parent
a272765fc7
commit
0a77b3f334
17 changed files with 164 additions and 191 deletions
|
@ -5,16 +5,7 @@ use crate::{
|
|||
|
||||
use super::from_expr2::expr2_to_markup;
|
||||
|
||||
use roc_ast::{
|
||||
ast_error::ASTResult,
|
||||
lang::{
|
||||
core::{
|
||||
ast::ASTNodeId,
|
||||
def::def2::{Def2, DefId},
|
||||
},
|
||||
env::Env,
|
||||
},
|
||||
};
|
||||
use roc_ast::{ast_error::ASTResult, lang::{core::{ast::ASTNodeId, def::def2::{Def2, DefId, def2_to_string}}, env::Env}};
|
||||
use roc_module::symbol::Interns;
|
||||
|
||||
pub fn def2_to_markup<'a>(
|
||||
|
@ -26,6 +17,8 @@ pub fn def2_to_markup<'a>(
|
|||
) -> ASTResult<MarkNodeId> {
|
||||
let ast_node_id = ASTNodeId::ADefId(def2_node_id);
|
||||
|
||||
dbg!("DEF2: {}", def2_to_string(def2_node_id, env.pool));
|
||||
|
||||
let mark_node_id = match def2 {
|
||||
Def2::ValueDef {
|
||||
identifier_id,
|
||||
|
|
|
@ -15,15 +15,7 @@ use crate::{
|
|||
};
|
||||
|
||||
use itertools::Itertools;
|
||||
use roc_ast::{ast_error::{ASTResult}, lang::{core::{
|
||||
ast::ASTNodeId,
|
||||
expr::{
|
||||
expr2::{Expr2, ExprId},
|
||||
record_field::RecordField,
|
||||
},
|
||||
pattern::{get_identifier_string, Pattern2},
|
||||
val_def::ValueDef,
|
||||
}, env::{Env}}};
|
||||
use roc_ast::{ast_error::{ASTResult}, lang::{core::{ast::ASTNodeId, expr::{expr2::{Expr2, ExprId}, expr2_to_string, record_field::RecordField}, pattern::{get_identifier_string, Pattern2}, val_def::ValueDef}, env::{Env}}};
|
||||
use roc_module::{module_err::ModuleResult, symbol::Interns};
|
||||
|
||||
// make Markup Nodes: generate String representation, assign Highlighting Style
|
||||
|
@ -35,10 +27,9 @@ pub fn expr2_to_markup<'a>(
|
|||
interns: &Interns,
|
||||
indent_level: usize,
|
||||
) -> ASTResult<MarkNodeId> {
|
||||
dbg!("EXPR2: {}", roc_ast::lang::core::expr::expr2_to_string::expr2_to_string(expr2_node_id, env.pool));
|
||||
let ast_node_id = ASTNodeId::AExprId(expr2_node_id);
|
||||
|
||||
println!("EXPR2 {:?}", expr2);
|
||||
|
||||
let mark_node_id = match expr2 {
|
||||
Expr2::SmallInt { text, .. }
|
||||
| Expr2::I128 { text, .. }
|
||||
|
@ -302,6 +293,9 @@ pub fn expr2_to_markup<'a>(
|
|||
|
||||
env.ident_ids.get_name_str_res(ident_id)
|
||||
}
|
||||
Pattern2::Shadowed{ shadowed_ident} => {
|
||||
Ok(shadowed_ident.as_str(env.pool))
|
||||
}
|
||||
other => {
|
||||
todo!(
|
||||
"TODO: support the following pattern2 as function arg: {:?}",
|
||||
|
@ -341,6 +335,8 @@ pub fn expr2_to_markup<'a>(
|
|||
let args_mn_id = mark_node_pool.add(args_mn);
|
||||
|
||||
let body_expr = env.pool.get(*body_id);
|
||||
println!("BODY_EXPR: {}", roc_ast::lang::core::expr::expr2_to_string::expr2_to_string(*body_id, env.pool));
|
||||
|
||||
let body_mn_id = expr2_to_markup(
|
||||
env,
|
||||
body_expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue