diff options
author | Aleksey Kladov <[email protected]> | 2018-01-11 19:11:44 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-01-11 19:11:44 +0000 |
commit | 89699c4803a0d12155adf653742f463872667610 (patch) | |
tree | 38afef90c9b0e9d5aa28c52e525e93428698bfca /src | |
parent | 41bf98d2493138d09e8c127f0914b2cf034cfa34 (diff) |
G: leading colon is a part of path segment
Diffstat (limited to 'src')
-rw-r--r-- | src/parser/event_parser/grammar/paths.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/parser/event_parser/grammar/paths.rs b/src/parser/event_parser/grammar/paths.rs index 74b0e0ed4..16a8ce239 100644 --- a/src/parser/event_parser/grammar/paths.rs +++ b/src/parser/event_parser/grammar/paths.rs | |||
@@ -5,16 +5,20 @@ pub(crate) fn use_path(p: &mut Parser) { | |||
5 | return; | 5 | return; |
6 | } | 6 | } |
7 | node(p, PATH, |p| { | 7 | node(p, PATH, |p| { |
8 | p.eat(COLONCOLON); | 8 | path_segment(p, true); |
9 | path_segment(p); | ||
10 | }); | 9 | }); |
11 | many(p, |p| { | 10 | many(p, |p| { |
12 | node_if(p, COLONCOLON, PATH, |p| { | 11 | node_if(p, COLONCOLON, PATH, |p| { |
13 | path_segment(p); | 12 | path_segment(p, false); |
14 | }) | 13 | }) |
15 | }); | 14 | }); |
16 | } | 15 | } |
17 | 16 | ||
18 | fn path_segment(p: &mut Parser) -> bool { | 17 | fn path_segment(p: &mut Parser, first: bool) { |
19 | node_if(p, IDENT, PATH_SEGMENT, |_| ()) | 18 | node(p, PATH_SEGMENT, |p| { |
19 | if first { | ||
20 | p.eat(COLONCOLON); | ||
21 | } | ||
22 | p.expect(IDENT); | ||
23 | }) | ||
20 | } \ No newline at end of file | 24 | } \ No newline at end of file |