mirror of
https://github.com/typst/typst
synced 2025-05-20 03:55:29 +08:00
fix decorator lexing with wrong offsets
This commit is contained in:
parent
1623a9135d
commit
ad6cc41261
@ -199,7 +199,7 @@ impl Lexer<'_> {
|
|||||||
/// Decorators.
|
/// Decorators.
|
||||||
impl Lexer<'_> {
|
impl Lexer<'_> {
|
||||||
fn decorator(&mut self) -> SyntaxKind {
|
fn decorator(&mut self) -> SyntaxKind {
|
||||||
let start = self.s.cursor() - 1;
|
let start = self.s.cursor() - 2;
|
||||||
|
|
||||||
self.decorator.clear();
|
self.decorator.clear();
|
||||||
|
|
||||||
@ -227,8 +227,11 @@ impl Lexer<'_> {
|
|||||||
self.decorator.push((token, end));
|
self.decorator.push((token, end));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The saved tokens will be removed in reverse.
|
||||||
|
self.decorator.reverse();
|
||||||
|
|
||||||
// Already collected all we need from the decorator.
|
// Already collected all we need from the decorator.
|
||||||
self.s.jump(start + 1);
|
self.s.jump(start + 2);
|
||||||
|
|
||||||
SyntaxKind::Decorator
|
SyntaxKind::Decorator
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user