disp/
disp.rs

1use fluid_parser::lexer::Lexer;
2use fluid_parser::parser::Parser;
3
4const TEST: &str = r#"# data file for the Fltk User Interface Designer (fluid)
5version 1.0400
6header_name {.h}
7code_name {.cxx}
8avoid_early_includes
9class UserInterface {open
10} {
11  Function {make_window()} {open
12  } {
13    Fl_Window Hello {open
14      xywh {821 256 400 344} type Double align 80 resizable visible callback { println!(""); show_window(); }
15    } {
16      Fl_Flex {} {open
17        xywh {5 5 390 335} resizable gap 5 set_size_tuples {2  0 30  2 30 } visible
18      } {
19        Fl_Flex Nmae {open
20          xywh {5 40 390 265} type HORIZONTAL gap 5
21        } {
22          Fl_Text_Display {} {
23            xywh {5 40 390 265} visible
24          }
25        }
26      }
27      Fl_Box this {
28        xywh {5 40 390 265} shortcut 0xff textsize 12
29      }
30    }
31  }
32}"#;
33
34fn main() {
35    let l = Lexer::new(TEST);
36    let mut p = Parser::new(l);
37    match p.parse() {
38        Ok(a) => println!("{:#?}", a),
39        Err(e) => eprintln!("An error occurred: {:?}", e),
40    }
41}