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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pub mod en {
    use r_derive::LocalizedParser;
    #[derive(Parser, Clone, Copy, LocalizedParser)]
    #[grammar = "grammar/localizations/en.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;

    use crate::parser::Style;
    impl From<Rule> for Style {
        fn from(rule: Rule) -> Self {
            match rule {
                Rule::hl_sym => Self::Symbol,
                Rule::hl_callname => Self::Call,
                Rule::hl_value => Self::Value,
                Rule::hl_num => Self::Number,
                Rule::hl_str => Self::String,
                Rule::hl_comment => Self::Comment,
                Rule::hl_function => Self::Function,
                Rule::hl_signal => Self::Signal,
                Rule::hl_control => Self::ControlFlow,
                Rule::hl_open | Rule::hl_brackets => Self::Brackets,
                Rule::hl_ops => Self::Operators,
                Rule::hl_infix => Self::Infix,
                _ => Self::None,
            }
        }
    }
}

pub mod es {
    use r_derive::{LocalizedParser, Translate};
    #[derive(Parser, Clone, Copy, Translate, LocalizedParser)]
    #[grammar = "grammar/localizations/es.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;
}

pub mod zh {
    use r_derive::{LocalizedParser, Translate};
    #[derive(Parser, Clone, Copy, Translate, LocalizedParser)]
    #[grammar = "grammar/localizations/zh.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;
}

pub mod de {
    use r_derive::{LocalizedParser, Translate};
    #[derive(Parser, Clone, Copy, Translate, LocalizedParser)]
    #[grammar = "grammar/localizations/de.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;
}

pub mod pirate {
    use r_derive::{LocalizedParser, Translate};
    #[derive(Parser, Clone, Copy, Translate, LocalizedParser)]
    #[grammar = "grammar/localizations/pirate.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;
}

pub mod emoji {
    use r_derive::{LocalizedParser, Translate};
    #[derive(Parser, Clone, Copy, Translate, LocalizedParser)]
    #[grammar = "grammar/localizations/emoji.pest"]
    #[grammar = "grammar/grammar.pest"]
    pub struct Parser;
}