Skip to content

Commit e9079a1

Browse files
committed
Add consume spaces to grammar parser.
This lets us handle fragments such as: ``` TOKEN : DEFINITION ``` where there is space before the colon in the rule.
1 parent 942a245 commit e9079a1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/grammar.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ impl EBNFParser {
199199
self.parse_priority();
200200
}
201201

202+
self.consume_space();
203+
202204
if self.peek(0) == Some(':') {
203205
self.consume(1);
204206
} else {
@@ -230,6 +232,8 @@ impl EBNFParser {
230232
self.parse_priority();
231233
}
232234

235+
self.consume_space();
236+
233237
if self.peek(0) == Some(':') {
234238
self.consume(1);
235239
} else {

0 commit comments

Comments
 (0)