From 3cbca56a7195bb2a7996530d584300d697c11dc8 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 17 Aug 2020 16:25:09 +0200 Subject: =?UTF-8?q?Parse=20braced=20expressions=20and=20bracketed=20calls?= =?UTF-8?q?=20in=20headers=20=F0=9F=97=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refactors the tokenizer to be lazy: It does not emit pre-parsed function tokens, but instead allows it's mode to be changed. The modes are tracked on a stack to allow nested compute/typesetting (pop/push). - Introduces delimited groups into the parser, which make it easy to parse delimited expressions without handling the delimiters in the parsing code for the group's content. A group is started with `start_group`. When reaching the group's end (matching delimiter) the eat and peek methods will simply return `None` instead of the delimiter, stopping the content parser and bubbling up the call stack until `end_group` is called to clear up the situation. --- src/layout/tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/layout/tree.rs') diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 39e111bd..092ba582 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -123,7 +123,7 @@ impl<'a> TreeLayouter<'a> { ..self.ctx }).await; - self.feedback.extend_offset(pass.feedback, call.span.start); + self.feedback.extend(pass.feedback); if let Value::Commands(commands) = pass.output { for command in commands { -- cgit v1.2.3