diff options
Diffstat (limited to 'src/parser_api.rs')
-rw-r--r-- | src/parser_api.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/parser_api.rs b/src/parser_api.rs index c739b1321..58002a8fc 100644 --- a/src/parser_api.rs +++ b/src/parser_api.rs | |||
@@ -6,6 +6,7 @@ use { | |||
6 | 6 | ||
7 | #[derive(Clone, Copy)] | 7 | #[derive(Clone, Copy)] |
8 | pub(crate) struct TokenSet(pub(crate) u128); | 8 | pub(crate) struct TokenSet(pub(crate) u128); |
9 | |||
9 | fn mask(kind: SyntaxKind) -> u128 { | 10 | fn mask(kind: SyntaxKind) -> u128 { |
10 | 1u128 << (kind as usize) | 11 | 1u128 << (kind as usize) |
11 | } | 12 | } |
@@ -154,7 +155,7 @@ impl Marker { | |||
154 | pub(crate) fn complete(mut self, p: &mut Parser, kind: SyntaxKind) -> CompletedMarker { | 155 | pub(crate) fn complete(mut self, p: &mut Parser, kind: SyntaxKind) -> CompletedMarker { |
155 | self.bomb.defuse(); | 156 | self.bomb.defuse(); |
156 | p.0.complete(self.pos, kind); | 157 | p.0.complete(self.pos, kind); |
157 | CompletedMarker(self.pos) | 158 | CompletedMarker(self.pos, kind) |
158 | } | 159 | } |
159 | 160 | ||
160 | /// Abandons the syntax tree node. All its children | 161 | /// Abandons the syntax tree node. All its children |
@@ -165,7 +166,7 @@ impl Marker { | |||
165 | } | 166 | } |
166 | } | 167 | } |
167 | 168 | ||
168 | pub(crate) struct CompletedMarker(u32); | 169 | pub(crate) struct CompletedMarker(u32, SyntaxKind); |
169 | 170 | ||
170 | impl CompletedMarker { | 171 | impl CompletedMarker { |
171 | /// This one is tricky :-) | 172 | /// This one is tricky :-) |
@@ -178,4 +179,8 @@ impl CompletedMarker { | |||
178 | pub(crate) fn precede(self, p: &mut Parser) -> Marker { | 179 | pub(crate) fn precede(self, p: &mut Parser) -> Marker { |
179 | Marker::new(p.0.precede(self.0)) | 180 | Marker::new(p.0.precede(self.0)) |
180 | } | 181 | } |
182 | |||
183 | pub(crate) fn kind(&self) -> SyntaxKind { | ||
184 | self.1 | ||
185 | } | ||
181 | } | 186 | } |