From 236750c35fbad916b63774df917cbc436f1d1a8c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 29 Aug 2020 12:02:07 +0200 Subject: =?UTF-8?q?Remove=20par=20nodes=20in=20favor=20of=20parbreaks=20?= =?UTF-8?q?=F0=9F=94=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This basically reverts the earlier change from parbreaks to par nodes because: - It is simpler and less nested - It works way better with functions that layout their body inline like `font`, which where buggy before, previously The original reasons for changing to par nodes were: - the envisioned design of the layouter at that time (based on dynamic nodes etc.), which is not relevant anymore - possibly existing benefits with regards to incremental compilation, which are unsure and outweighed by the immediate benefits of the parbreak-representation --- src/syntax/tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/syntax/tree.rs') diff --git a/src/syntax/tree.rs b/src/syntax/tree.rs index ae2e9892..31f334d2 100644 --- a/src/syntax/tree.rs +++ b/src/syntax/tree.rs @@ -23,6 +23,8 @@ pub enum SyntaxNode { Spacing, /// A forced line break. Linebreak, + /// A paragraph break. + Parbreak, /// Italics were enabled / disabled. ToggleItalic, /// Bolder was enabled / disabled. @@ -31,8 +33,6 @@ pub enum SyntaxNode { Text(String), /// Lines of raw text. Raw(Vec), - /// A paragraph of child nodes. - Par(SyntaxTree), /// A function call. Call(CallExpr), } -- cgit v1.2.3