summaryrefslogtreecommitdiff
path: root/src/compute/table.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/compute/table.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/compute/table.rs')
-rw-r--r--src/compute/table.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compute/table.rs b/src/compute/table.rs
index f11eacfc..75effd60 100644
--- a/src/compute/table.rs
+++ b/src/compute/table.rs
@@ -270,7 +270,7 @@ impl<V> SpannedEntry<V> {
/// Create an entry with the same span for key and value.
pub fn val(val: Spanned<V>) -> Self {
- Self { key: Span::ZERO, val }
+ Self { key: val.span, val }
}
/// Convert from `&SpannedEntry<T>` to `SpannedEntry<&T>`