summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-17 16:25:09 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-17 16:25:09 +0200
commit3cbca56a7195bb2a7996530d584300d697c11dc8 (patch)
tree2a9242442bb79ae4b70895cabeb95b7aff2a4f5d /src/lib.rs
parent8a80503188804d576636265e71f72e9f55a7961a (diff)
Parse braced expressions and bracketed calls in headers 🗳
- 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.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index e30e41b2..30196034 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -87,7 +87,7 @@ impl Typesetter {
/// Parse source code into a syntax tree.
pub fn parse(&self, src: &str) -> Pass<SyntaxTree> {
- parse(src, Pos::ZERO)
+ parse(src)
}
/// Layout a syntax tree and return the produced layout.