aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/paths.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/event_parser/grammar/paths.rs')
-rw-r--r--src/parser/event_parser/grammar/paths.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/parser/event_parser/grammar/paths.rs b/src/parser/event_parser/grammar/paths.rs
index a254ab05e..bf3c8aedd 100644
--- a/src/parser/event_parser/grammar/paths.rs
+++ b/src/parser/event_parser/grammar/paths.rs
@@ -1,10 +1,18 @@
1use super::*; 1use super::*;
2 2
3pub(crate) fn is_path_start(p: &Parser) -> bool { 3pub(super) fn is_path_start(p: &Parser) -> bool {
4 AnyOf(&[IDENT, SELF_KW, SUPER_KW, COLONCOLON]).is_ahead(p) 4 AnyOf(&[IDENT, SELF_KW, SUPER_KW, COLONCOLON]).is_ahead(p)
5} 5}
6 6
7pub(crate) fn use_path(p: &mut Parser) { 7pub(super) fn use_path(p: &mut Parser) {
8 path(p)
9}
10
11pub(super) fn type_path(p: &mut Parser) {
12 path(p)
13}
14
15fn path(p: &mut Parser) {
8 if !is_path_start(p) { 16 if !is_path_start(p) {
9 return; 17 return;
10 } 18 }
@@ -24,6 +32,7 @@ pub(crate) fn use_path(p: &mut Parser) {
24 } 32 }
25} 33}
26 34
35
27fn path_segment(p: &mut Parser, first: bool) { 36fn path_segment(p: &mut Parser, first: bool) {
28 let segment = p.start(); 37 let segment = p.start();
29 if first { 38 if first {