aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/expressions.rs
blob: a943b8c813a6db2c7edb881535bead865f0805f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

pub(super) fn literal(p: &mut Parser) -> bool {
    match p.current() {
        TRUE_KW | FALSE_KW |
        INT_NUMBER | FLOAT_NUMBER |
        BYTE | CHAR |
        STRING | RAW_STRING | BYTE_STRING | RAW_BYTE_STRING => {
            let lit = p.start();
            p.bump();
            lit.complete(p, LITERAL);
            true
        }
        _ => false
    }
}