15 Commits

Author SHA1 Message Date
Laurenz
bc1b4216a8 Reorganize syntax types into two modules 📦 2020-09-30 12:45:33 +02:00
Laurenz
7f8f225cb3 Split up parser into multiple files 🧱
Splits up into:
- escaping: resolving of escape sequences
- parser: the parsing code
- tests: all integrated parsing tests

Also moves Ident from the root syntax module into the tree module.
2020-09-03 19:16:19 +02:00
Martin Haug
d986bc4b0a Add section headings 👨‍🦲
Co-authored-by: Laurenz Mädje <laurmaedje@gmail.com>
2020-09-01 13:10:48 +02:00
Laurenz
181f756a9e Format everything with rustfmt! 💚 2020-08-30 22:18:55 +02:00
Martin Haug
d68367f32a Newlines are complicated, y'all 😱
Co-authored-by: laurmaedje@outlook.de <laurmaedje@outlook.de>
2020-08-29 17:20:04 +02:00
Martin
5e1fd35926
Merge branch 'master' into code-blocks 2020-08-29 13:58:30 +02:00
Martin Haug
c2b6f2dc35 Added code blocks 🚟 2020-08-29 13:53:59 +02:00
Laurenz
236750c35f Remove par nodes in favor of parbreaks 🔄
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
2020-08-29 12:02:07 +02:00
Laurenz
37835e4d8e Better error reporting for nameless function 💡 2020-08-27 21:34:48 +02:00
Laurenz
77dac270a8 Make compute functions possible 💻
Ships with the amazing new `rgb` function!
2020-08-19 20:49:01 +02:00
Laurenz
30f16bbf64 Add Value type and replace dyn-nodes with call-exprs 🏗
- 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-16 22:39:21 +02:00
Laurenz
2467cd6272 Refactor function parsing ♻ 2020-08-04 13:48:07 +02:00
Laurenz
ed4fdcb0ad Par nodes 🧳 2020-08-04 11:46:04 +02:00
Laurenz
dbfb3d2ced Formatting, documentation and small improvements 🧽 2020-08-03 16:04:55 +02:00
Laurenz
266d457292 Refactor model into tree 🛒 2020-08-02 22:05:49 +02:00