diff options
Diffstat (limited to 'src/syntax/mod.rs')
| -rw-r--r-- | src/syntax/mod.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index c3a57ee6..f7321c77 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -62,15 +62,17 @@ pub enum Node { /// Whitespace containing less than two newlines. Space, /// Whitespace with more than two newlines. - Newline, + Parbreak, + /// A forced line break. + Linebreak, /// Plain text. Text(String), + /// Lines of raw text. + Raw(Vec<String>), /// Italics were enabled / disabled. ToggleItalic, /// Bolder was enabled / disabled. ToggleBolder, - /// Monospace was enabled / disabled. - ToggleMonospace, /// A submodel, typically a function invocation. Model(Box<dyn Model>), } @@ -80,11 +82,12 @@ impl PartialEq for Node { use Node::*; match (self, other) { (Space, Space) => true, - (Newline, Newline) => true, + (Parbreak, Parbreak) => true, + (Linebreak, Linebreak) => true, (Text(a), Text(b)) => a == b, + (Raw(a), Raw(b)) => a == b, (ToggleItalic, ToggleItalic) => true, (ToggleBolder, ToggleBolder) => true, - (ToggleMonospace, ToggleMonospace) => true, (Model(a), Model(b)) => a == b, _ => false, } @@ -107,6 +110,7 @@ pub enum Decoration { /// ^^^^^^ /// ``` InvalidFuncName, + /// A key of a keyword argument: /// ```typst /// [box: width=5cm] @@ -119,12 +123,11 @@ pub enum Decoration { /// ^^^^ ^^^^^ /// ``` ObjectKey, + /// An italic word. Italic, /// A bold word. Bold, - /// A monospace word. - Monospace, } impl dyn Model { |
