summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-syntax/src/highlight.rs3
-rw-r--r--crates/typst-syntax/src/kind.rs4
-rw-r--r--crates/typst-syntax/src/lexer.rs4
3 files changed, 11 insertions, 0 deletions
diff --git a/crates/typst-syntax/src/highlight.rs b/crates/typst-syntax/src/highlight.rs
index 0c1f3d5f..7128c358 100644
--- a/crates/typst-syntax/src/highlight.rs
+++ b/crates/typst-syntax/src/highlight.rs
@@ -286,6 +286,9 @@ pub fn highlight(node: &LinkedNode) -> Option<Tag> {
SyntaxKind::Destructuring => None,
SyntaxKind::DestructAssignment => None,
+ // TODO
+ SyntaxKind::Decorator => Some(Tag::Comment),
+
SyntaxKind::LineComment => Some(Tag::Comment),
SyntaxKind::BlockComment => Some(Tag::Comment),
SyntaxKind::Error => Some(Tag::Error),
diff --git a/crates/typst-syntax/src/kind.rs b/crates/typst-syntax/src/kind.rs
index 7505dbc6..769cdd72 100644
--- a/crates/typst-syntax/src/kind.rs
+++ b/crates/typst-syntax/src/kind.rs
@@ -278,6 +278,9 @@ pub enum SyntaxKind {
Destructuring,
/// A destructuring assignment expression: `(x, y) = (1, 2)`.
DestructAssignment,
+
+ /// A decorator: `/! allow("amogus")`
+ Decorator,
}
impl SyntaxKind {
@@ -498,6 +501,7 @@ impl SyntaxKind {
Self::FuncReturn => "`return` expression",
Self::Destructuring => "destructuring pattern",
Self::DestructAssignment => "destructuring assignment expression",
+ Self::Decorator => "decorator",
}
}
}
diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs
index dd05e73f..502c458d 100644
--- a/crates/typst-syntax/src/lexer.rs
+++ b/crates/typst-syntax/src/lexer.rs
@@ -151,6 +151,10 @@ impl Lexer<'_> {
}
}
+ fn decorator(&mut self) -> SyntaxKind {
+ todo!()
+ }
+
fn line_comment(&mut self) -> SyntaxKind {
self.s.eat_until(is_newline);
SyntaxKind::LineComment