8a17cfd586
[wadler] Prettier handling of trivia
...
Split the rules for pre- and post- trivia, understand when we want to
do either, handle multi-line-break (in an unsatisfying way, I guess)
but otherwise lay the groundwork for thinking about it better.
Also now we don't generate lazy "Text" nodes because I thought I might
want to actually look at the newlines in the source but I don't yet.
I *can* now, though. (I can also detect EOF so there's that.)
2024-09-19 16:39:32 -07:00
c31d527077
[wadler] Trivia escapes groups
...
This means that forced breaks from comments don't screw up the
following single-line things. But this still isn't right; we need to
fine tune how we represent trivia.
2024-09-15 08:51:18 -07:00
9d55588a35
[wadler] Cons has a list of documents in it
...
I think I want to start thinking about "leftmost" and "rightmost" and
it's just easier and faster if cons has an actual list in it instead
of dotted pairs.
2024-09-15 08:12:30 -07:00
d5ccd5b147
Really messing around with trivia, it's not good yet
...
It's really not clear how to track it and how to compose it with
groups yet. Really very difficult.
2024-09-14 17:14:07 -07:00
f3a4c4348a
Custom indentation
2024-09-14 07:28:18 -07:00
a1fa03615c
Fix pretty display: don't re-wrap, account for gutter
2024-09-14 06:24:35 -07:00
eea05ecd30
Show the result of pretty-printing in the harness
2024-09-13 22:50:43 -07:00
709ba060b4
Hack for metadata in the document
2024-09-13 16:53:51 -07:00
265f07fd5a
Add document rendering to harness
...
To debug pretty-printing. Noticing some weirdness!
2024-09-13 16:45:54 -07:00
9cdfda6ec5
Fix broken harness
...
Whoops
2024-09-13 16:23:19 -07:00
d03dc6e3d9
Harness uses grammar-generated token stream
2024-08-27 16:47:42 -07:00
e04aa1966e
Start moving the examples into tests
2024-06-15 07:52:16 -07:00
7b3c94c469
Move things into more modules
...
It will help with testing and profiling
It breaks pyright (it's probably time to abandon pyright)
2024-06-10 05:50:09 -07:00
c3098aa435
Various bug fixes related to the end of file
2024-06-09 17:18:44 -07:00
a3786c62ba
Proper positions for synthetic tokens
2024-06-09 07:24:19 -07:00
0c3e6b211c
Lots of logging tweaks
2024-06-09 07:12:35 -07:00
38837f5c4d
Don't crash with empty lists
2024-06-09 07:12:14 -07:00
c74a36463e
Fix: handle zero-length children correctly
2024-06-09 07:11:39 -07:00
bea7903686
Line numbers
...
Getting flickery :D
2024-06-09 06:22:31 -07:00
bc5a018ce9
Logging, scrolling bad
2024-06-08 18:35:39 -07:00
1dcc86e9fe
Prettier harness, start logging properly
2024-06-08 18:12:16 -07:00
a837d662dd
Error recovery: lame version of CPCT+
2024-06-08 17:30:59 -07:00
973445a8d8
Scored results
2024-06-06 17:09:14 -07:00
07164d51a0
Fix end of file error reporting
2024-06-06 17:05:41 -07:00
22029edbb2
Even more threaded parsing
2024-06-06 17:02:07 -07:00
68a8e9298b
Simplify token handling in parsing
2024-06-06 08:16:38 -07:00
b60b38d78e
Start making parsing thread-based
2024-06-06 08:05:40 -07:00
d6131ad53e
Stop deleting blank space in errors
2024-06-02 08:09:32 -07:00
e203e27407
Allow the grammar to specify a preference for a generator
...
Overridable, like start production
2024-06-01 05:42:40 -07:00
fee1c68dea
Wrap errors
...
Maybe people want to see them
2024-05-31 08:31:47 -07:00
d93b779538
More argument parsing
2024-05-31 07:54:28 -07:00
1500849390
Argument parsing, render refactor
2024-05-31 06:30:13 -07:00
561dcd87ff
Allow nonterminals to be renamed
2024-05-30 19:15:20 -07:00
4b8fef9ad6
Starts and ends in the output
2024-05-30 08:36:35 -07:00
dfef449c33
Better tree output
2024-05-30 08:24:36 -07:00
56d24c5fb9
Chaos: split tables, interactions, Terminal
...
- Tables are split into `actions` and `goto` now to make formatting
nicer
- Token is renamed Terminal
- Likes are now Florps
- Lexer now loaded dynamically (badly)
2024-05-30 08:02:47 -07:00
71078f76b4
Interactive grammar editing
2024-05-29 19:28:42 -07:00
45a9303a27
Transparent rules
...
Better parsing/action types
Good grief
2024-05-29 09:07:19 -07:00
4f8aef3f89
Start working on the harness
2024-05-29 07:48:55 -07:00
7c4705714e
Faster still.
...
Also somehow I was not merging things correctly for LALR; this merges
more completely and winds up with 215 states for the fine grammar,
which is like half of what it used to be?
2024-05-28 08:07:11 -07:00
28634677bf
A little more faster.
2024-05-28 05:56:44 -07:00
8d58c64040
Fix LALR. Small, but very very slow.
2024-05-27 22:31:33 -07:00
0fc04cf11e
Fix grammar bugs, work on debugging harness.
2024-05-27 19:02:10 -07:00