88 Commits

Author SHA1 Message Date
Laurenz
3481d8cc81 More utility functions
- join("a", "b", "c", sep: ", ")
- int("12")
- float("31.4e-1")
- str(10)
- sorted((3, 2, 1))
2021-08-31 12:59:53 +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
6a3385e4e7 Argument collection and spreading 2021-08-13 16:55:45 +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
3932bb2cb9 New source loading architecture 2021-08-09 11:26:41 +02:00
Laurenz
fbd3d19113 Call args span now includes parens 2021-07-31 22:41:06 +02:00
Laurenz
e35fca54a0 Change indent from 4 to 2 spaces 2021-07-30 18:49:20 +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
36b3067c19 Eco string 🌱 2021-07-10 13:07:39 +02:00
Laurenz
9950627789 Even shorter error annotations
Error annotations are now relative to the first following non-comment line.
2021-07-09 10:50:25 +02:00
Laurenz
0c74290519 Compare functions and templates by identity 2021-07-08 23:36:20 +02:00
Laurenz
7e2c217cbc Rename some library arguments
- font
  - color -> fill
  - shorthands for families and size
- decoration functions
  - color -> stroke
  - strength -> thickness
  - position -> offset
  - invert offsets: now positive goes downwards just like the rest of typst
2021-07-08 21:42:36 +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
f85e5aac64 URL special case for line comments 2021-07-08 19:37:38 +02:00
Laurenz
5a500fb8a7 Range operator 2021-07-08 19:12:07 +02:00
Laurenz
c5635d8a3f Handle missing arguments to with expr 2021-07-08 18:56:52 +02:00
Laurenz
44d8028b49 Allow wide calls only directly in templates 2021-06-30 22:49:11 +02:00
Laurenz
17e8946884
Remove color literals (#39) 2021-06-30 22:32:24 +02:00
Laurenz
45812b7001
Merge pull request #35 from typst/wide-calls
Wide calls
2021-06-30 11:04:53 +02:00
Laurenz
2f44d10aa4 Make test separators commentable 2021-06-29 16:05:05 +02:00
Laurenz
32a6b673bc Make use of wide calls 2021-06-29 13:49:50 +02:00
Laurenz
b89cd128ae Wide calls 2021-06-29 13:49:50 +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
63cf361496 Make font take everything as keyword arguments 2021-06-25 18:14:19 +02:00
Laurenz
bca035172c Join semantics 2021-06-18 11:59:05 +02:00
Laurenz
5611c26577 Restructure tests 2021-06-10 16:46:01 +02:00
Martin Haug
73fa2eda2c Introduce frs 2021-06-09 22:44:40 +02:00
Laurenz
c7416f18bd Move invalid syntax tests into appropriate places 2021-06-09 10:51:19 +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
37e0846037 Test cases for include and import 2021-05-31 22:33:40 +02:00
Laurenz
14f093bfee A few predefined colors for testing 2021-05-23 22:59:25 +02:00
Laurenz
8b58171d7c Reorganize test cases 2021-05-18 00:36:11 +02:00