mirror of
https://github.com/typst/typst
synced 2025-07-01 09:42:53 +08:00
separate DecoratorMarker from Decorator
This commit is contained in:
parent
ad6cc41261
commit
9f9ba7ba5a
@ -286,8 +286,8 @@ pub fn highlight(node: &LinkedNode) -> Option<Tag> {
|
|||||||
SyntaxKind::Destructuring => None,
|
SyntaxKind::Destructuring => None,
|
||||||
SyntaxKind::DestructAssignment => None,
|
SyntaxKind::DestructAssignment => None,
|
||||||
|
|
||||||
// TODO
|
SyntaxKind::DecoratorMarker => Some(Tag::Comment),
|
||||||
SyntaxKind::Decorator => Some(Tag::Comment),
|
SyntaxKind::Decorator => None,
|
||||||
|
|
||||||
SyntaxKind::LineComment => Some(Tag::Comment),
|
SyntaxKind::LineComment => Some(Tag::Comment),
|
||||||
SyntaxKind::BlockComment => Some(Tag::Comment),
|
SyntaxKind::BlockComment => Some(Tag::Comment),
|
||||||
|
@ -13,6 +13,8 @@ pub enum SyntaxKind {
|
|||||||
LineComment,
|
LineComment,
|
||||||
/// A block comment: `/* ... */`.
|
/// A block comment: `/* ... */`.
|
||||||
BlockComment,
|
BlockComment,
|
||||||
|
/// A decorator's marker: `/!`
|
||||||
|
DecoratorMarker,
|
||||||
|
|
||||||
/// The contents of a file or content block.
|
/// The contents of a file or content block.
|
||||||
Markup,
|
Markup,
|
||||||
@ -374,6 +376,7 @@ impl SyntaxKind {
|
|||||||
Self::Error => "syntax error",
|
Self::Error => "syntax error",
|
||||||
Self::LineComment => "line comment",
|
Self::LineComment => "line comment",
|
||||||
Self::BlockComment => "block comment",
|
Self::BlockComment => "block comment",
|
||||||
|
Self::DecoratorMarker => "decorator marker",
|
||||||
Self::Markup => "markup",
|
Self::Markup => "markup",
|
||||||
Self::Text => "text",
|
Self::Text => "text",
|
||||||
Self::Space => "space",
|
Self::Space => "space",
|
||||||
|
@ -233,7 +233,7 @@ impl Lexer<'_> {
|
|||||||
// Already collected all we need from the decorator.
|
// Already collected all we need from the decorator.
|
||||||
self.s.jump(start + 2);
|
self.s.jump(start + 2);
|
||||||
|
|
||||||
SyntaxKind::Decorator
|
SyntaxKind::DecoratorMarker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user