mirror of
https://github.com/typst/typst
synced 2025-05-16 01:55:28 +08:00
don't swallow newlines in decorator lexing
This commit is contained in:
parent
16859f57e2
commit
a1d5861a58
@ -193,8 +193,8 @@ impl Lexer<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn decorator(&mut self) -> SyntaxKind {
|
fn decorator(&mut self) -> SyntaxKind {
|
||||||
while !self.s.eat_newline() {
|
let mut start = self.s.cursor();
|
||||||
let start = self.s.cursor();
|
while !self.s.peek().is_some_and(is_newline) {
|
||||||
let token = match self.s.eat() {
|
let token = match self.s.eat() {
|
||||||
Some(c) if is_space(c, self.mode) => self.whitespace(start, c),
|
Some(c) if is_space(c, self.mode) => self.whitespace(start, c),
|
||||||
Some('/') if self.s.eat_if('/') => break,
|
Some('/') if self.s.eat_if('/') => break,
|
||||||
@ -216,6 +216,7 @@ impl Lexer<'_> {
|
|||||||
|
|
||||||
let end = self.s.cursor();
|
let end = self.s.cursor();
|
||||||
self.subtree.push((token, end));
|
self.subtree.push((token, end));
|
||||||
|
start = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
SyntaxKind::Decorator
|
SyntaxKind::Decorator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user