mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
feat(editor): render Expr2::GlobalTag
This commit is contained in:
parent
cc81c6e5ba
commit
eddc85a365
2 changed files with 37 additions and 5 deletions
|
@ -303,11 +303,7 @@ fn run_event_loop(file_path_opt: Option<&Path>) -> Result<(), Box<dyn Error>> {
|
|||
let region = Region::new(0, 0, 0, 0);
|
||||
|
||||
let (expr2, _) = crate::lang::expr::str_to_expr2(
|
||||
&arena,
|
||||
"\"hello\"",
|
||||
&mut env,
|
||||
&mut scope,
|
||||
region,
|
||||
&arena, "True", &mut env, &mut scope, region,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
|
|
@ -33,6 +33,30 @@ pub fn render_expr2<'a>(
|
|||
|
||||
queue_code_text_draw(&code_text, glyph_brush);
|
||||
}
|
||||
Expr2::I128 { text, .. } => {
|
||||
let code_text = Text {
|
||||
position,
|
||||
area_bounds,
|
||||
color: CODE_COLOR.into(),
|
||||
text: env.pool.get_str(text),
|
||||
size: CODE_FONT_SIZE,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
queue_code_text_draw(&code_text, glyph_brush);
|
||||
}
|
||||
Expr2::U128 { text, .. } => {
|
||||
let code_text = Text {
|
||||
position,
|
||||
area_bounds,
|
||||
color: CODE_COLOR.into(),
|
||||
text: env.pool.get_str(text),
|
||||
size: CODE_FONT_SIZE,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
queue_code_text_draw(&code_text, glyph_brush);
|
||||
}
|
||||
Expr2::Float { text, .. } => {
|
||||
let code_text = Text {
|
||||
position,
|
||||
|
@ -57,6 +81,18 @@ pub fn render_expr2<'a>(
|
|||
|
||||
queue_code_text_draw(&code_text, glyph_brush);
|
||||
}
|
||||
Expr2::GlobalTag { name, .. } => {
|
||||
let code_text = Text {
|
||||
position,
|
||||
area_bounds,
|
||||
color: CODE_COLOR.into(),
|
||||
text: env.pool.get_str(name),
|
||||
size: CODE_FONT_SIZE,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
queue_code_text_draw(&code_text, glyph_brush);
|
||||
}
|
||||
rest => todo!("implement {:?} render", rest),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue