Commit graph

142 commits

Author SHA1 Message Date
f6c9835e29 Hide warnings in pretty module for now 2022-11-22 21:50:20 +01:00
736174d470 Desugar away named nil in table literals 2022-11-22 17:49:12 +01:00
39099037a5 Remove unused functions 2022-11-22 17:39:56 +01:00
f8fa044259 Desugar all expressions 2022-11-22 17:39:02 +01:00
26dc3c3469 Desugar all function definitions 2022-11-22 17:27:06 +01:00
40c28d9496 Simplify creating Var 2022-11-22 17:14:52 +01:00
6f7683ad1e Simplify creating Field 2022-11-22 17:06:56 +01:00
009be99aaa Simplify creating Call 2022-11-22 16:55:27 +01:00
78d08968eb Move BoundedSeparated helper functions into ast 2022-11-22 16:45:31 +01:00
58106c4c5a Simplify creating TableConstrElem 2022-11-22 16:44:33 +01:00
c191486864 Simplify creating TableLitElem 2022-11-22 16:35:16 +01:00
45caafdc38 Simplify creating Lit 2022-11-22 16:29:31 +01:00
fafc567447 Simplify creating Expr 2022-11-22 16:29:21 +01:00
42369628b6 Simplify boxing Expr 2022-11-22 15:32:23 +01:00
5a977e6dde Simplify creating TableLit and TableConstr 2022-11-22 15:21:40 +01:00
c769d9e16f Simplify creating BoundedSeparated
Along with this comes the decision to no longer track whitespace and
comments across desugarings in most cases. The main reason for this
decision is that not having to track whitespace simplifies the code and
reasoning necessary.

While implementing desugarings, I also realized that the current comment
model doesn't let me accurately track whitespace across desugarings. I'm
fairly sure I haven't yet found a good model for whitespace and
comments. Once I find one, adding pretty printing support for those
should hopefully be easy though.
2022-11-22 15:21:35 +01:00
d6a0bbf2af Desugar simple anonymous function definitions 2022-11-22 12:56:09 +01:00
830ffa92c4 Desugar table destructuring 2022-11-22 10:32:27 +01:00
d4797c5894 Simplify creating string literal from ident 2022-11-22 10:32:17 +01:00
af6c171eb4 Desugar table constructors 2022-11-22 09:44:29 +01:00
74d1f640b5 Fix pretty printing of empty BoundedSeparated 2022-11-22 09:21:44 +01:00
94ea196933 Remove Separated 2022-11-22 00:00:43 +01:00
198f56226e Switch TablePattern to BoundedSeparated 2022-11-21 23:57:58 +01:00
0e9cfd67c2 Switch TablConstr to BoundedSeparated 2022-11-21 23:54:40 +01:00
e3fa3500d4 Switch TableLit and Program to BoundedSeparated 2022-11-21 23:54:30 +01:00
a1867fdc4e Add BoundedSeparated with parser and printer
This type should be able to replace Separated (with a bit of effort).

The hope is that this type is a better representation for table-like
syntax with optional trailing delimiter that will let me remove_map
elements without too much difficulty. This is necessary for desugaring
table constructors.
2022-11-21 22:56:50 +01:00
9591b23082 Fix span of field ident string expression 2022-11-21 15:14:28 +01:00
ca979edd7c Desugar variable access and assignment 2022-11-21 15:14:18 +01:00
27ba13e8a2 Desugar field assignment via ident 2022-11-21 14:44:15 +01:00
621ea8f1d4 Desugar field access via ident 2022-11-21 14:38:45 +01:00
290cef06cb Desugar from the outside in 2022-11-21 14:35:10 +01:00
ebc48fff5a Desugar field assignment 2022-11-21 14:05:07 +01:00
3f8320941a Desugar field access 2022-11-21 13:49:37 +01:00
b84d5ae0c8 Create new objects with existing span
I've decided that attempting to create smaller spans is more difficult
and will also lead to worse error messages later on. It makes more sense
to just tag every newly created syntax tree element with the span of the
element it comes from.
2022-11-21 13:36:21 +01:00
5c8dd1969f Desugar function calls with argument 2022-11-21 13:35:36 +01:00
7bfaebc05f Desugar function calls with table constructor 2022-11-21 13:07:10 +01:00
29aa474b6a Use diff tool to visualize desugaring changes 2022-11-21 13:01:15 +01:00
a3d6efcaec Desugar function calls without args 2022-11-21 12:35:53 +01:00
52c1aeba35 Desugar literals 2022-11-21 12:05:24 +01:00
8278442d3f Expand expression desugaring 2022-11-21 11:43:31 +01:00
13b7db79b0 Desugar separated elements 2022-11-21 11:35:58 +01:00
8b21acac9e Add desugar command and desugar programs 2022-11-21 09:33:34 +01:00
6eee1ba930 Simplify pretty printing separated elements 2022-11-21 00:49:04 +01:00
9d6cd580d4 Pretty print module elems 2022-11-21 00:17:51 +01:00
b3eaa40902 Pretty print function definitions 2022-11-21 00:16:15 +01:00
c45a45f0b6 Rename parser::func_defs to parser::func_def 2022-11-21 00:08:59 +01:00
e7416fbc1e Pretty print table destructors 2022-11-21 00:07:57 +01:00
c7fc8584ff Pretty print variable accesses and assignments 2022-11-21 00:02:12 +01:00
5bd43ee37a Pretty print field accesses and assignments 2022-11-20 23:50:53 +01:00
81e2a28b06 Pretty print function calls 2022-11-20 23:45:28 +01:00