347 Commits

Author SHA1 Message Date
Laurenz
3968181622 Replace .. syntax with range function 2021-10-25 13:38:32 +02:00
Laurenz
4b2c6334d0 Change precedence of range expression 2021-10-05 17:19:48 +02:00
Laurenz
9e78dbe525 Better function and closure pretty printing 2021-09-30 19:07:17 +02:00
Laurenz
6d26e15fbe Support else if 2021-09-30 19:07:06 +02:00
Laurenz
9e95502622 No hashtag before else anymore 2021-09-30 18:28:25 +02:00
Laurenz
ea921aca5d Blocks directly in template also scope 2021-09-15 13:12:07 +02:00
Laurenz
5de791d9e6 Rename SyntaxTree to Markup
Also `SyntaxNode` -> `MarkupNode`.
2021-09-15 13:05:01 +02:00
Laurenz
c18321a4c2 Bugfix and tidying 2021-09-15 13:05:00 +02:00
Laurenz
7f48e8fe66 Make user-facing "debug" representation use Debug instead of Display 2021-08-31 16:25:12 +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
9462fb17b3 Convert single-field structs to tuple structs 2021-08-16 19:15:03 +02:00
Laurenz
7e6e7e928c Adjust macros to new version 2021-08-14 23:53:57 +02:00
Laurenz
6ae6d86b9c Separate type for string values 2021-08-14 15:55:39 +02:00
Laurenz
f6814b7732 Optimize memory sizes 2021-08-13 18:17:24 +02:00
Laurenz
6a3385e4e7 Argument collection and spreading 2021-08-13 16:55:45 +02:00
Laurenz
144f208821 Add file information to spans 2021-08-13 14:33:58 +02:00
Laurenz
d002cdf451 Named arguments for user defined functions 2021-08-12 16:07:42 +02:00
Laurenz
ccb4be4da4 Make range-end exclusive 2021-08-12 14:54:52 +02:00
Laurenz
eaa3cbaa9c Array and dictionary indexing 2021-08-12 13:56:23 +02:00
Laurenz
3c92bad9a7 Pretty-printed diagnostics with traceback 2021-08-01 00:00:36 +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
312dcd070c Move EcoString and OptionExt into util 2021-07-29 11:35:49 +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
02b586cc36 Add lots of Eq impls 2021-07-08 23:16:02 +02:00
Laurenz
fd0b89a1d8 Rename Fill to Paint 2021-07-08 22:33:44 +02:00
Laurenz
551e3af9d0 Replace using with from 2021-07-08 21:16:16 +02:00
Laurenz
5c327e249e Switch to = for headings once again 2021-07-08 20:03:13 +02:00
Laurenz
5a500fb8a7 Range operator 2021-07-08 19:12:07 +02:00
Laurenz
17e8946884
Remove color literals (#39) 2021-06-30 22:32:24 +02:00
Laurenz
470f8001a1 No more collisions between syntax::Tree and layout::Tree 2021-06-30 11:40:27 +02:00
Laurenz
b89cd128ae Wide calls 2021-06-29 13:49:50 +02:00
Laurenz
6d0911d7a8 Mutable visitor 2021-06-29 10:54:34 +02:00
Laurenz
f64c772b6d Fix capturing bug 2021-06-27 12:05:36 +02:00
Laurenz
422b8e640f With expressions 2021-06-26 18:07:05 +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
bce553a991 Tidy up 2021-06-09 22:44:40 +02:00
Martin Haug
29cfef0a6d Add a grid layouter 2021-06-09 22:44:40 +02:00
Martin Haug
73fa2eda2c Introduce frs 2021-06-09 22:44:40 +02:00
Laurenz
edff2ae680 Remove template pretty printing
Was buggy and pretty useless anyway since it couldn't peek into function templates.
2021-06-09 10:45:49 +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
f26526ba75 Switch back to hashtags for headings 2021-06-07 18:17:47 +02:00
Martin Haug
9f77f09aac Parse import and include expressions
Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-05-31 22:33:40 +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
1cfc3c72b5 Show name of user-defined functions in representation 🦋 2021-03-03 18:15:33 +01:00
Laurenz
c94a18833f Closures and function definitions 🚀
Supports:
- Closure syntax: `(x, y) => z`
- Shorthand for a single argument: `x => y`
- Function syntax: `let f(x) = y`
- Capturing of variables from the environment
- Error messages for too few / many passed arguments

Does not support:
- Named arguments
- Variadic arguments with `..`
2021-03-03 17:53:40 +01:00