summaryrefslogtreecommitdiff
path: root/src/syntax/tree.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-29 17:26:49 +0200
committerGitHub <noreply@github.com>2020-08-29 17:26:49 +0200
commit2a6cde72726c057e2166fb4277b8fe53c398b3f9 (patch)
tree0899e1cc799fff1aedec8a19e63170a671cf969f /src/syntax/tree.rs
parent236750c35fbad916b63774df917cbc436f1d1a8c (diff)
parentd68367f32a9e698923b554984c59f0671e27ba5f (diff)
Merge pull request #11 from typst/code-blocks
Added code blocks 🚟
Diffstat (limited to 'src/syntax/tree.rs')
-rw-r--r--src/syntax/tree.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/syntax/tree.rs b/src/syntax/tree.rs
index 31f334d2..44acd023 100644
--- a/src/syntax/tree.rs
+++ b/src/syntax/tree.rs
@@ -33,6 +33,8 @@ pub enum SyntaxNode {
Text(String),
/// Lines of raw text.
Raw(Vec<String>),
+ /// An optionally highlighted (multi-line) code block.
+ Code(Code),
/// A function call.
Call(CallExpr),
}
@@ -199,3 +201,10 @@ impl CallExpr {
}
}
}
+/// A code block.
+#[derive(Debug, Clone, PartialEq)]
+pub struct Code {
+ pub lang: Option<Spanned<Ident>>,
+ pub lines: Vec<String>,
+ pub block: bool,
+}