Skip to content

Commit 07c978c

Browse files
committed
fix: Capture name offset
1 parent 43470a0 commit 07c978c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

crates/plotnik-lib/src/parser/grammar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ impl Parser<'_> {
706706
fn try_parse_capture(&mut self, checkpoint: Checkpoint) {
707707
if self.peek() == SyntaxKind::At {
708708
self.start_node_at(checkpoint, SyntaxKind::Capture);
709+
self.drain_trivia();
709710
self.parse_capture_suffix();
710711
self.finish_node();
711712
}

crates/plotnik-lib/src/parser/tests/grammar/trivia_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ fn whitespace_preserved() {
1717
ParenOpen "("
1818
Id "identifier"
1919
ParenClose ")"
20+
Whitespace " "
2021
At "@"
2122
Id "name"
22-
Whitespace " "
2323
Newline "\n"
2424
"#);
2525
}

0 commit comments

Comments
 (0)