summaryrefslogtreecommitdiff
path: root/crates/typst-syntax/src/lib.rs
diff options
context:
space:
mode:
authorcAttte <26514199+cAttte@users.noreply.github.com>2025-06-12 11:09:37 -0300
committerGitHub <noreply@github.com>2025-06-12 14:09:37 +0000
commitf9897479d2a8a865c4033bc44ec9a85fb5000795 (patch)
tree498f159589cb1cf14c171a31750189023cad8327 /crates/typst-syntax/src/lib.rs
parentbd41fb9427f3965b91ac467fe12045bbb793b5e9 (diff)
Unify `EvalMode` and `LexMode` into `SyntaxMode` (#6432)
Diffstat (limited to 'crates/typst-syntax/src/lib.rs')
-rw-r--r--crates/typst-syntax/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/typst-syntax/src/lib.rs b/crates/typst-syntax/src/lib.rs
index 1249f88e..4741506c 100644
--- a/crates/typst-syntax/src/lib.rs
+++ b/crates/typst-syntax/src/lib.rs
@@ -30,5 +30,16 @@ pub use self::path::VirtualPath;
pub use self::source::Source;
pub use self::span::{Span, Spanned};
-use self::lexer::{LexMode, Lexer};
+use self::lexer::Lexer;
use self::parser::{reparse_block, reparse_markup};
+
+/// The syntax mode of a portion of Typst code.
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
+pub enum SyntaxMode {
+ /// Text and markup, as in the top level.
+ Markup,
+ /// Math atoms, operators, etc., as in equations.
+ Math,
+ /// Keywords, literals and operators, as after hashes.
+ Code,
+}