diff options
Diffstat (limited to 'src/parser/event_parser/grammar')
-rw-r--r-- | src/parser/event_parser/grammar/paths.rs | 13 |
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 108545bc2..d6887a9ba 100644 --- a/src/parser/event_parser/grammar/paths.rs +++ b/src/parser/event_parser/grammar/paths.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use super::*; | 1 | use super::*; |
2 | 2 | ||
3 | pub(crate) fn use_path(p: &mut Parser) { | 3 | pub(crate) fn use_path(p: &mut Parser) { |
4 | if !AnyOf(&[IDENT, COLONCOLON]).is_ahead(p) { | 4 | if !AnyOf(&[IDENT, SELF_KW, SUPER_KW, COLONCOLON]).is_ahead(p) { |
5 | return; | 5 | return; |
6 | } | 6 | } |
7 | let mut prev = p.mark(); | 7 | let mut prev = p.mark(); |
@@ -23,6 +23,15 @@ fn path_segment(p: &mut Parser, first: bool) { | |||
23 | if first { | 23 | if first { |
24 | p.eat(COLONCOLON); | 24 | p.eat(COLONCOLON); |
25 | } | 25 | } |
26 | p.expect(IDENT); | 26 | match p.current() { |
27 | IDENT | SELF_KW | SUPER_KW => { | ||
28 | p.bump(); | ||
29 | }, | ||
30 | _ => { | ||
31 | p.error() | ||
32 | .message("expected identifier") | ||
33 | .emit(); | ||
34 | } | ||
35 | }; | ||
27 | }) | 36 | }) |
28 | } \ No newline at end of file | 37 | } \ No newline at end of file |