diff options
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/event.rs | 4 | ||||
-rw-r--r-- | src/parser/grammar/items/mod.rs | 4 | ||||
-rw-r--r-- | src/parser/parser/imp.rs | 12 | ||||
-rw-r--r-- | src/parser/parser/mod.rs | 1 | ||||
-rw-r--r-- | src/parser/token_set.rs | 1 |
5 files changed, 8 insertions, 14 deletions
diff --git a/src/parser/event.rs b/src/parser/event.rs index 4af16d783..1c0905a38 100644 --- a/src/parser/event.rs +++ b/src/parser/event.rs | |||
@@ -140,9 +140,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil | |||
140 | } | 140 | } |
141 | builder.leaf(kind, len); | 141 | builder.leaf(kind, len); |
142 | } | 142 | } |
143 | &Event::Error { ref msg } => builder.error(ErrorMsg { | 143 | &Event::Error { ref msg } => builder.error(ErrorMsg { msg: msg.clone() }), |
144 | msg: msg.clone(), | ||
145 | }), | ||
146 | } | 144 | } |
147 | } | 145 | } |
148 | builder.finish() | 146 | builder.finish() |
diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index 18ee8af86..3af6d13a1 100644 --- a/src/parser/grammar/items/mod.rs +++ b/src/parser/grammar/items/mod.rs | |||
@@ -94,7 +94,7 @@ fn item(p: &mut Parser) { | |||
94 | 94 | ||
95 | // test unsafe_auto_trait | 95 | // test unsafe_auto_trait |
96 | // unsafe auto trait T {} | 96 | // unsafe auto trait T {} |
97 | IDENT if p.at_kw("auto") && la == TRAIT_KW => { | 97 | IDENT if p.at_contextual_kw("auto") && la == TRAIT_KW => { |
98 | p.bump_remap(AUTO_KW); | 98 | p.bump_remap(AUTO_KW); |
99 | traits::trait_item(p); | 99 | traits::trait_item(p); |
100 | TRAIT_ITEM | 100 | TRAIT_ITEM |
@@ -109,7 +109,7 @@ fn item(p: &mut Parser) { | |||
109 | 109 | ||
110 | // test unsafe_default_impl | 110 | // test unsafe_default_impl |
111 | // unsafe default impl Foo {} | 111 | // unsafe default impl Foo {} |
112 | IDENT if p.at_kw("default") && la == IMPL_KW => { | 112 | IDENT if p.at_contextual_kw("default") && la == IMPL_KW => { |
113 | p.bump_remap(DEFAULT_KW); | 113 | p.bump_remap(DEFAULT_KW); |
114 | traits::impl_item(p); | 114 | traits::impl_item(p); |
115 | IMPL_ITEM | 115 | IMPL_ITEM |
diff --git a/src/parser/parser/imp.rs b/src/parser/parser/imp.rs index 03c044091..f2641c388 100644 --- a/src/parser/parser/imp.rs +++ b/src/parser/parser/imp.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use parser::input::{ParserInput, InputPosition}; | 1 | use parser::input::{InputPosition, ParserInput}; |
2 | use parser::event::Event; | 2 | use parser::event::Event; |
3 | 3 | ||
4 | use SyntaxKind; | 4 | use SyntaxKind; |
5 | use syntax_kinds::{TOMBSTONE, EOF}; | 5 | use syntax_kinds::{EOF, TOMBSTONE}; |
6 | 6 | ||
7 | /// Implementation details of `Parser`, extracted | 7 | /// Implementation details of `Parser`, extracted |
8 | /// to a separate struct in order not to pollute | 8 | /// to a separate struct in order not to pollute |
@@ -29,7 +29,6 @@ impl<'t> ParserImpl<'t> { | |||
29 | self.events | 29 | self.events |
30 | } | 30 | } |
31 | 31 | ||
32 | |||
33 | pub(super) fn nth(&self, n: u32) -> SyntaxKind { | 32 | pub(super) fn nth(&self, n: u32) -> SyntaxKind { |
34 | self.inp.kind(self.pos + n) | 33 | self.inp.kind(self.pos + n) |
35 | } | 34 | } |
@@ -92,9 +91,9 @@ impl<'t> ParserImpl<'t> { | |||
92 | if idx == self.events.len() - 1 { | 91 | if idx == self.events.len() - 1 { |
93 | match self.events.pop() { | 92 | match self.events.pop() { |
94 | Some(Event::Start { | 93 | Some(Event::Start { |
95 | kind: TOMBSTONE, | 94 | kind: TOMBSTONE, |
96 | forward_parent: None, | 95 | forward_parent: None, |
97 | }) => (), | 96 | }) => (), |
98 | _ => unreachable!(), | 97 | _ => unreachable!(), |
99 | } | 98 | } |
100 | } | 99 | } |
@@ -114,7 +113,6 @@ impl<'t> ParserImpl<'t> { | |||
114 | new_pos | 113 | new_pos |
115 | } | 114 | } |
116 | 115 | ||
117 | |||
118 | fn event(&mut self, event: Event) { | 116 | fn event(&mut self, event: Event) { |
119 | self.events.push(event) | 117 | self.events.push(event) |
120 | } | 118 | } |
diff --git a/src/parser/parser/mod.rs b/src/parser/parser/mod.rs index 618b439be..58f820738 100644 --- a/src/parser/parser/mod.rs +++ b/src/parser/parser/mod.rs | |||
@@ -126,7 +126,6 @@ impl Drop for Marker { | |||
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | |||
130 | pub(crate) struct CompletedMarker(u32); | 129 | pub(crate) struct CompletedMarker(u32); |
131 | 130 | ||
132 | impl CompletedMarker { | 131 | impl CompletedMarker { |
diff --git a/src/parser/token_set.rs b/src/parser/token_set.rs index 82558fa2e..a800f200d 100644 --- a/src/parser/token_set.rs +++ b/src/parser/token_set.rs | |||
@@ -22,4 +22,3 @@ macro_rules! token_set { | |||
22 | token_set!($($t),*) | 22 | token_set!($($t),*) |
23 | }; | 23 | }; |
24 | } | 24 | } |
25 | |||