Commit graph

28 commits

Author SHA1 Message Date
d4797c5894 Simplify creating string literal from ident 2022-11-22 10:32:17 +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
290cef06cb Desugar from the outside in 2022-11-21 14:35:10 +01:00
5c8dd1969f Desugar function calls with argument 2022-11-21 13:35:36 +01:00
8b21acac9e Add desugar command and desugar programs 2022-11-21 09:33:34 +01:00
7833ef533d Place parentheses in expressions when necessary 2022-11-20 22:53:19 +01:00
03e7f10739 Satisfy warnings 2022-11-20 22:16:10 +01:00
6533c9dcf7 Handle things separated by things differently
I noticed that programs like '{} would parse correctly while '{ } would
expect an inner element. This was because the leading space was actually
part of the element parser, which is a violation of the (as of yet
unspoken) rule that parsers should not parse surrounding whitespace.

Because whitespace whas treated differently from everywhere else and
because this implementation was wrong, I decided to reimplement it,
abstracting the concept of things separated by other things with
optional trailing things. I did this in such a way that surrounding
whitespace is not touched.
2022-11-20 21:09:59 +01:00
2be47871da Add "module" program variant 2022-11-20 18:10:15 +01:00
9658907d76 Make string literal Debug more compact 2022-11-20 17:36:28 +01:00
82e5b589e1 Parse string literals 2022-11-20 17:36:16 +01:00
867595b5b9 Remove multiline string literals from ast 2022-11-20 17:14:43 +01:00
ff3edf17e5 Parse anonymous function definitions 2022-11-19 19:13:30 +01:00
86006933d7 Add local function definitions 2022-11-19 18:58:21 +01:00
5e26d9550c Remove unused import 2022-11-19 13:05:40 +01:00
408219073a Parse binary operators
For now, they're all left associative.
2022-11-19 12:40:52 +01:00
4be5283204 Make Expr Debug more compact and less ambiguous 2022-11-19 11:38:11 +01:00
94198d126f Parse suffixes 2022-11-19 11:22:49 +01:00
3e2f118e2e Move program ast into separate file 2022-11-19 11:02:36 +01:00
e2bb847577 Simplify imports 2022-11-19 11:01:09 +01:00
36e40d254d Add function definitions to ast 2022-11-19 10:58:34 +01:00
a82b625631 Add builtins to ast and parse them 2022-11-18 21:17:05 +01:00
41723eb4ca Parse comments in whitespace 2022-11-18 20:59:51 +01:00
037a0f69a3 Split up and expand ast 2022-11-18 19:37:51 +01:00