From ed4fdcb0ada909f1cc3d7436334e253f0ec14d55 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 4 Aug 2020 11:46:04 +0200 Subject: =?UTF-8?q?Par=20nodes=20=F0=9F=A7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/tree.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/syntax/tree.rs') diff --git a/src/syntax/tree.rs b/src/syntax/tree.rs index 28997e7c..73734d28 100644 --- a/src/syntax/tree.rs +++ b/src/syntax/tree.rs @@ -14,20 +14,20 @@ pub type SyntaxTree = SpanVec; #[derive(Debug, Clone)] pub enum SyntaxNode { /// Whitespace containing less than two newlines. - Space, - /// Whitespace with more than two newlines. - Parbreak, + Spacing, /// A forced line break. Linebreak, - /// Plain text. - Text(String), - /// Lines of raw text. - Raw(Vec), /// Italics were enabled / disabled. ToggleItalic, /// Bolder was enabled / disabled. ToggleBolder, - /// A dynamic node, create through function invocations in source code. + /// Plain text. + Text(String), + /// Lines of raw text. + Raw(Vec), + /// A paragraph of child nodes. + Par(SyntaxTree), + /// A dynamic node, created through function invocations in source code. Dyn(Box), } @@ -35,13 +35,13 @@ impl PartialEq for SyntaxNode { fn eq(&self, other: &SyntaxNode) -> bool { use SyntaxNode::*; match (self, other) { - (Space, Space) => true, - (Parbreak, Parbreak) => true, + (Spacing, Spacing) => true, (Linebreak, Linebreak) => true, - (Text(a), Text(b)) => a == b, - (Raw(a), Raw(b)) => a == b, (ToggleItalic, ToggleItalic) => true, (ToggleBolder, ToggleBolder) => true, + (Text(a), Text(b)) => a == b, + (Raw(a), Raw(b)) => a == b, + (Par(a), Par(b)) => a == b, (Dyn(a), Dyn(b)) => a == b, _ => false, } -- cgit v1.2.3