rust/src/parser/event_parser/grammar/expressions.rs

17 lines
386 B
Rust
Raw Normal View History

2018-01-07 19:46:10 +01:00
use super::*;
pub(super) fn literal(p: &mut Parser) -> bool {
2018-01-20 19:49:58 +01:00
match p.current() {
TRUE_KW | FALSE_KW |
INT_NUMBER | FLOAT_NUMBER |
BYTE | CHAR |
STRING | RAW_STRING | BYTE_STRING | RAW_BYTE_STRING => {
2018-01-20 21:25:34 +01:00
let lit = p.start();
2018-01-20 19:49:58 +01:00
p.bump();
2018-01-20 21:25:34 +01:00
lit.complete(p, LITERAL);
2018-01-20 19:49:58 +01:00
true
}
_ => false
}
}