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

15 lines
301 B
Rust
Raw Normal View History

2018-01-09 21:32:18 +01:00
use super::*;
pub(crate) fn use_path(p: &mut Parser) {
if !AnyOf(&[IDENT, COLONCOLON]).is_ahead(p) {
return;
}
node(p, PATH, |p| {
p.eat(COLONCOLON);
path_segment(p);
})
}
fn path_segment(p: &mut Parser) -> bool {
node_if(p, IDENT, PATH_SEGMENT, |p| ())
}