feat(editor): render Expr2::GlobalTag

This commit is contained in:
rvcas 2021-02-11 08:59:19 -05:00
parent cc81c6e5ba
commit eddc85a365
2 changed files with 37 additions and 5 deletions

View file

@ -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 region = Region::new(0, 0, 0, 0);
let (expr2, _) = crate::lang::expr::str_to_expr2( let (expr2, _) = crate::lang::expr::str_to_expr2(
&arena, &arena, "True", &mut env, &mut scope, region,
"\"hello\"",
&mut env,
&mut scope,
region,
) )
.unwrap(); .unwrap();

View file

@ -33,6 +33,30 @@ pub fn render_expr2<'a>(
queue_code_text_draw(&code_text, glyph_brush); 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, .. } => { Expr2::Float { text, .. } => {
let code_text = Text { let code_text = Text {
position, position,
@ -57,6 +81,18 @@ pub fn render_expr2<'a>(
queue_code_text_draw(&code_text, glyph_brush); 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), rest => todo!("implement {:?} render", rest),
}; };
} }