logo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use syn::{punctuated::Punctuated, token::Comma, Expr, Ident, LitStr, Path};

mod gen;
mod parse;

#[derive(Debug)]
pub struct Menus {
    items: Punctuated<Menu, Comma>,
}

#[derive(Debug)]
struct Menu {
    name: Ident,
    items: Punctuated<MenuItem, Comma>,
}

#[derive(Debug)]
enum MenuItem {
    Entry(Box<MenuEntry>),
    Section(MenuSection),
}

#[derive(Debug)]
struct MenuEntry {
    string: LitStr,
    action_ty: Path,
    value: Option<Expr>,
}

#[derive(Debug)]
struct MenuSection {
    name: Ident,
    items: Punctuated<MenuItem, Comma>,
}