151 Commits

Author SHA1 Message Date
Laurenz
1ee1d078e2 Fatal errors
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free
- Parsing still recovers and can produce multiple errors
- Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import)
- The single error that could occur during execution is removed for now
- Removes Value::Error variant
2021-07-30 18:49:19 +02:00
Laurenz
312dcd070c Move EcoString and OptionExt into util 2021-07-29 11:35:49 +02:00
Laurenz
adb71ee040 Move and refactor 2021-07-25 01:03:38 +02:00
Laurenz
b0e5212973 Fs builder methods + tidy up 2021-07-21 11:28:33 +02:00
Laurenz
9488b1b850 Main context struct 2021-07-21 11:28:29 +02:00
Laurenz
8000783f95 FileId instead of Path + FileHash 2021-07-20 18:35:05 +02:00
Laurenz
36b3067c19 Eco string 🌱 2021-07-10 13:07:39 +02:00
Laurenz
470f8001a1 No more collisions between syntax::Tree and layout::Tree 2021-06-30 11:40:27 +02:00
Martin
80a9b300d1 Ref count the frames 2021-06-18 13:01:55 +02:00
Laurenz
7218892c72 Refactor path handling 2021-06-01 12:55:07 +02:00
Laurenz
e023bf2ac9 Module loading system
Detects cyclic imports and loads each module only once per compilation.
2021-05-31 22:33:40 +02:00
Laurenz
0bfee5b777 Refactored loading and cache architecture 2021-05-28 12:46:43 +02:00
Martin Haug
8e700606bb Add a cache for unchanged layouts
Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-05-26 23:50:40 +02:00
Laurenz
de20a21a58 Reshaping with unsafe-to-break
Co-Authored-By: Martin <mhaug@live.de>
2021-04-05 22:32:09 +02:00
Laurenz
e8057a5385 Make pdf module top-level 🧱 2021-03-24 21:48:25 +01:00
Laurenz
73615f7e3c Text shaping 🚀
- Shapes text with rustybuzz
- Font fallback with family list
- Tofus are shown in the first font

Co-Authored-By: Martin <mhaug@live.de>
2021-03-24 17:12:34 +01:00
Laurenz
5e08028fb3 Syntax functions 🚀
This adds overridable functions that markup desugars into. Specifically:
- \ desugars into linebreak
- Two newlines desugar into parbreak
- * desugars into strong
- _ desugars into emph
- = .. desugars into heading
- `..` desugars into raw
2021-03-21 17:50:56 +01:00
Laurenz
264a7dedd4 Scheduled maintenance 🔨
- New naming scheme
  - TextNode instead of NodeText
  - CallExpr instead of ExprCall
  - ...
- Less glob imports
- Removes Value::Args variant
- Removes prelude
- Renames Layouted to Fragment
- Moves font into env
- Moves shaping into layout
- Moves frame into separate module
2021-03-19 17:57:31 +01:00
Laurenz
271b0f953b Fixes in TextMate grammar 2021-03-17 14:47:11 +01:00
Laurenz
146eda102a Move span directly into diagnostics 🚚 2021-02-11 19:26:47 +01:00
Laurenz
06ca740d01 Split evaluation and execution 🔪 2021-02-09 19:46:57 +01:00
Laurenz
d763f0f5a6 Split state and scopes, less ref-counting 🔀 2021-01-15 16:53:02 +01:00
Laurenz
7b4d4d6002 Pretty printing 🦋
- Syntax tree and value pretty printing
- Better value evaluation (top-level strings and content are evaluated plainly, everything else is pretty printed)
2021-01-06 01:32:59 +01:00
Laurenz
aae67bd572 Move and rename many things 🚛 2021-01-03 00:12:09 +01:00
Laurenz
475ca7a62e Basic environment and resource loader 🏞 2020-11-27 22:35:42 +01:00
Laurenz
761931405c Use newly stabilized intra doc links ↩ 2020-11-24 16:12:41 +01:00
Laurenz
1a70cb6a33 Naming and grammar ✔ 2020-10-12 18:01:22 +02:00
Laurenz
38157b0e0c Synchronous layout 🪀 2020-10-12 17:10:01 +02:00
Laurenz
92c01da360 Switch back to custom geometry types, unified with layout primitives 🏞 2020-10-10 22:19:36 +02:00
Laurenz
d2e220245d Move deco, pass and feedback into diagnostics module ↩ 2020-10-07 18:24:47 +02:00
Laurenz
537545e7f8 Evaluation and node-based layouting 🚀 2020-10-07 17:07:44 +02:00
Laurenz
335fa2d118 Small improvements 🍪 2020-10-04 23:31:35 +02:00
Laurenz
ef8aa763fa Shorten some names ↔ 2020-10-04 20:22:11 +02:00
Laurenz
c1dd872b34 Remove unncessary wrappers and typedefs 🛑 2020-10-04 19:57:39 +02:00
Laurenz
0f7c70fd93 Separate state and constraints 🧶 2020-10-04 19:06:20 +02:00
Laurenz
6672f8f7df Remove Typesetter in favor of typeset function 🎯 2020-10-04 18:18:55 +02:00
Laurenz
262a8fa36a Refactor and move shaping out of the layout module 2020-10-04 18:01:56 +02:00
Laurenz
54e0da59e3 Small documentation fixes 🧾 2020-10-03 18:15:09 +02:00
Laurenz
0fc25d732d Port to kurbo 🎋 2020-10-03 13:23:59 +02:00
Laurenz
f8770d2b2a Generalize layouting primitives 🛤 2020-10-01 15:35:09 +02:00
Laurenz
e676ab53dd Rename compute to eval ✏ 2020-10-01 15:13:04 +02:00
Laurenz
7c12f0c07f Flatten compute module 2020-10-01 15:10:35 +02:00
Laurenz
7fcad452b8 Reorganize ast types 🏕 2020-10-01 15:03:37 +02:00
Laurenz
3e791e3337 Move decoration into mod.rs 🔙 2020-09-30 12:49:30 +02:00
Laurenz
bc1b4216a8 Reorganize syntax types into two modules 📦 2020-09-30 12:45:33 +02:00
Laurenz
181f756a9e Format everything with rustfmt! 💚 2020-08-30 22:18:55 +02:00
Laurenz
3cbca56a71 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.
2020-08-17 16:25:09 +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
691423a40a Basic table type 📔
- Keys are strings or integers
- Access with borrowed or owned keys
- `push` method for array-like pattern
- No iteration support yet
2020-08-14 11:40:34 +02:00
Laurenz
2467cd6272 Refactor function parsing ♻ 2020-08-04 13:48:07 +02:00