diff options
author | Aleksey Kladov <[email protected]> | 2018-01-09 20:32:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-01-09 20:32:18 +0000 |
commit | 5ea7e5fb7ab9f9ed762c8b5220ba01a29796a871 (patch) | |
tree | e67b91e3fe1d046d886bce5e896bb045e327169e /src/parser/event_parser/grammar/paths.rs | |
parent | 1544e89c49c67df00fc72d841f3e39be792cbe2b (diff) |
G: simplest use items
Diffstat (limited to 'src/parser/event_parser/grammar/paths.rs')
-rw-r--r-- | src/parser/event_parser/grammar/paths.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/parser/event_parser/grammar/paths.rs b/src/parser/event_parser/grammar/paths.rs new file mode 100644 index 000000000..96966b380 --- /dev/null +++ b/src/parser/event_parser/grammar/paths.rs | |||
@@ -0,0 +1,15 @@ | |||
1 | use super::*; | ||
2 | |||
3 | pub(crate) fn use_path(p: &mut Parser) { | ||
4 | if !AnyOf(&[IDENT, COLONCOLON]).is_ahead(p) { | ||
5 | return; | ||
6 | } | ||
7 | node(p, PATH, |p| { | ||
8 | p.eat(COLONCOLON); | ||
9 | path_segment(p); | ||
10 | }) | ||
11 | } | ||
12 | |||
13 | fn path_segment(p: &mut Parser) -> bool { | ||
14 | node_if(p, IDENT, PATH_SEGMENT, |p| ()) | ||
15 | } \ No newline at end of file | ||