summaryrefslogtreecommitdiff
path: root/src/library/val.rs
AgeCommit message (Collapse)Author
2020-08-16Add Value type and replace dyn-nodes with call-exprs 🏗Laurenz
- In addition to syntax trees there are now `Value`s, which syntax trees can be evaluated into (e.g. the tree is `5+5` and the value is `10`) - Parsing is completely pure, function calls are not parsed into nodes, but into simple call expressions, which are resolved later - Functions aren't dynamic nodes anymore, but simply functions which receive their arguments as a table and the layouting context - Functions may return any `Value` - Layouting is powered by functions which return the new `Commands` value, which informs the layouting engine what to do - When a function returns a non-`Commands` value, the layouter simply dumps the value into the document in monospace
2020-08-16Remove tuples and objects in favor of tables 🛢Laurenz
This refactores the parser tests to make them more concise and flexible with regards to spans.
2020-08-14Desugar body into last argument 🍩Laurenz
2020-08-14Always parse bodies as syntax trees 🌳Laurenz
Previously they were passed as strings to the function parser, now they are parsed and then passed as trees to the function. This allows making bodies sugar for a last content argument. While it removes some flexibility allowing function to parse arbitrary syntaxes in their bodies, these can be modelled as (raw) string arguments.
2020-08-04Refactor function parsing ♻Laurenz