47 Commits

Author SHA1 Message Date
Laurenz
56b6a2a908 Impl Eq for syntax tree types 2023-02-17 10:01:40 +01:00
Laurenz
17e9805b34 Let eval take code instead of markup 2023-02-13 17:45:08 +01:00
Laurenz
c987f07b76 HTML highlighting 2023-01-29 23:23:03 +01:00
Laurenz
406de22ee5 Remove method call syntax kind 2023-01-28 18:32:58 +01:00
Laurenz
4809e685a2 More capable math calls 2023-01-28 15:36:32 +01:00
Laurenz
a96141a3ea Autocomplete methods 2023-01-27 16:09:35 +01:00
Laurenz
a8fd64f928 Hashtags everywhere! 2023-01-27 11:54:30 +01:00
Laurenz
b73b4f33bc Fix a few clippy lints 2023-01-20 14:21:59 +01:00
Laurenz
dd331f007c Rewrite parser 2023-01-20 14:05:35 +01:00
Laurenz
40561e57fb Remove most fields from SyntaxKind enum 2023-01-15 12:40:27 +01:00
Laurenz
ab03f32240 Reorganize syntax module 2023-01-14 12:34:17 +01:00
Laurenz
b476de87b7 Rename two syntax types 2022-11-22 14:53:03 +01:00
Laurenz
2ce727fc95 Make inner node and node data private 2022-11-22 14:40:56 +01:00
Laurenz
eb951c008b Style changes 2022-11-04 11:38:09 +01:00
Laurenz
37a7afddfa Split crates 2022-11-03 13:35:39 +01:00
Laurenz
e218226655 Merge some modules 2022-10-17 20:04:22 +02:00
Laurenz
5de791d9e6 Rename SyntaxTree to Markup
Also `SyntaxNode` -> `MarkupNode`.
2021-09-15 13:05:01 +02:00
Laurenz
0dd4ae0a7a Prune derives 2021-08-21 17:30:21 +02:00
Laurenz
594809e35b Library functions behave more imperatively
- Templates scope state changes
- State-modifying function operate in place instead of returning a template
- Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map
- No more wide calls
2021-08-17 22:20:37 +02:00
Laurenz
f6814b7732 Optimize memory sizes 2021-08-13 18:17:24 +02:00
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
6a4823461f Reference-count complex values
Rename some nodes types
2021-07-10 23:10:17 +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
Laurenz
285c2f617b Cleanse library
- Remove doc-comments for Typst functions from library
- Reduce number of library source files
2021-06-26 13:06:37 +02:00
Laurenz
4dbd9285c9 Basic enums 2021-06-11 14:00:06 +02:00
Laurenz
5afb42ad89 Lists with indent-based parsing
- Unordered lists with indent-based parsing and basic layout using stacks
- Headings are now also indent based
- Removes syntax functions since they will be superseded by select & transform
2021-06-09 00:37:13 +02:00
Laurenz
72478946c2 Make frames serializable 📚
This also makes serialization support non-optional since it's too much feature-management for too little benefit.
2021-04-21 21:17:25 +02: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
1711b67877 Move all pretty printing into one module and pretty print values 🦋 2021-02-11 17:33:13 +01:00
Laurenz
f9197dcfef Add arguments value 🏓 2021-02-09 22:56:44 +01:00
Laurenz
06ca740d01 Split evaluation and execution 🔪 2021-02-09 19:46:57 +01:00
Laurenz
8de1f8b770 Fix counting bug 2021-02-04 00:38:30 +01:00
Laurenz
d86a5e8a1f Tidy up raw blocks 🧹
- Better trimming (only trim at the end if necessary)
- Fixed block-level layouting
- Improved pretty printing
- Flip inline variable to block
- Flip inline variable to display for math formulas
2021-02-03 21:34:49 +01:00
Laurenz
67047047e8 Interpret two backticks as single-backtick block 2021-01-30 15:24:11 +01:00
Laurenz
89eb8bae49 New syntax 💎
- Everything everywhere!
  - Blocks with curly braces: {}
  - Templates with brackets: []
  - Function templates with hashtag: `#[f]`
- Headings with equals sign: `= Introduction`
2021-01-30 12:09:26 +01:00
Laurenz
010ddc4795 More straightforward pretty printing tests 🧹 2021-01-26 21:57:56 +01:00
Laurenz
d2ba1b705e Group and block expressions, unary plus 🧩 2021-01-12 18:55:12 +01:00
Laurenz
105cda0e69 Braced content -> Bracketed templates ✏ 2021-01-10 21:38:58 +01:00
Laurenz
59d811aeba Inline literal enum into expression enum 🔀 2021-01-06 21:06:48 +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
1c40dc42e7 Dynamic values, Types, Arrays, and Dictionaries 🚀
- Identifiers are now evaluated as variables instead of being plain values
- Constants like `left` or `bold` are stored as dynamic values containing the respective rust types
- We now distinguish between arrays and dictionaries to make things more intuitive (at the cost of a bit more complex parsing)
- Spans were removed from collections (arrays, dictionaries), function arguments still have spans for the top-level values to enable good diagnostics
2021-01-02 19:37:10 +01:00
Laurenz
8cad78481c A few small improvements ♻ 2021-01-01 17:54:31 +01:00
Laurenz
2b6ccd8248 Better parser testing 2021-01-01 16:43:58 +01:00
Laurenz
c216a4fc26 Flatten ast module back into syntax module 🌪 2020-10-10 22:41:56 +02:00