#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release use web_lisp::node::Node; use web_lisp::{ lexer::{self, Token}, parser, }; fn main() { let abc = lexer::lex_string(include_str!("../web_lisp_src/hello_world.wisp").to_string()); let alksjdhfhlkj = parser::parse_vec(abc.as_slice()); eframe::run_native( "Web Lisp Browser", eframe::NativeOptions::default(), Box::new(|_cc| Box::new(MyApp::new(abc))), ); } use eframe::egui::{self, Label, RichText, TextEdit}; struct MyApp { omnibar: String, tokens: Vec, root_node: Node, } impl MyApp { fn new(tokens: Vec) -> Self { let mut root_node = Node::default(); root_node.text = "hi".to_string(); root_node.size = Some(30.0); Self { omnibar: "".to_string(), tokens, root_node, } } } impl eframe::App for MyApp { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { _frame.set_window_title("title"); ui.text_edit_singleline(&mut self.omnibar); ui.separator(); let rn = &self.root_node; let tx = RichText::new(rn.text.clone()) .size(rn.size.unwrap_or(12.0)) .underline(); ui.add(Label::new(tx)); }); } }