e501caa073
[parser] Remove unused import
2024-10-26 06:53:53 -07:00
e55bc140f9
[parser] Move ItemSet
2024-10-26 06:53:36 -07:00
2d5c73f0b0
[parser] Remove LR0 and SLR1
...
Sorry, when this was educational it was nice to have the other
generators but as part of cleaning I'm just getting rid of them.
2024-10-15 07:43:52 -07:00
bb94fc6c9c
[parser] clean clean clean
2024-10-11 07:52:48 -07:00
2656a1d328
[parser] Remove bad LALR implementation, start cleanup
2024-10-10 07:58:16 -07:00
da7ca95a86
[dingus] Output is modal between tree and errors
2024-10-09 07:40:39 -07:00
aedb02dda4
[dingus] Functional core, imperative shell (kinda)
2024-10-08 08:13:33 -07:00
ba65c1929c
[dingus] Start to render errors
2024-10-08 06:42:54 -07:00
15a7feac07
[dingus] Color syntax nodes red when they are errors
2024-10-06 08:06:54 -07:00
1a8c768772
[dingus] Reset the grammar globals every time
...
Now I can rewrite the grammar
2024-10-06 07:44:11 -07:00
474bbf6964
[test] Correct doc comment
2024-10-05 16:02:39 -07:00
eef1db72da
[parser] Pager's algorithm. Faster.
...
As good as LALR but the implementation isn't embarassing. (Still
pretty bad though.)
Honestly the next thing to do is to delete LALR and just use Pager's
and also rebuild ConfigSet et al to be ItemSet so that Pager's alg
can go even faster. I think I want to keep LR1 just for completeness
so I might as well not delete SLR and LR0, although I *could* I
suppose.
2024-10-05 16:00:41 -07:00
5e3b1141ca
[dingus] Remove unused code
2024-10-02 07:18:06 -07:00
5a84086469
[dingus] Render the output
2024-10-01 18:47:37 -07:00
0620ae0be5
[dingus] Save and restore documents to local storage for goofs
2024-10-01 07:48:20 -07:00
3f51b83850
[dingus] Abstract document handling
2024-10-01 07:39:49 -07:00
bcf1bbb948
[dingus] Parse and report status
2024-10-01 07:23:59 -07:00
efc6eac842
[dingus] Build lexer and parser
2024-09-30 22:32:04 -07:00
361f470431
[dingus] Status and loading and whatnot
2024-09-30 22:28:50 -07:00
aaa28f6d7f
[dingus] Missed some files
2024-09-30 07:36:31 -07:00
99c481e089
Version
2024-09-30 07:35:04 -07:00
1d650b79f9
[dingus] sugnid
2024-09-30 07:34:23 -07:00
22b7b4d185
And ignore even more
2024-09-30 06:47:54 -07:00
904a2b5f3f
Ignore more
2024-09-30 06:47:24 -07:00
20aebb5048
[dingus] Trying to get a web dingus working with pyodide
2024-09-30 06:46:08 -07:00
ccdda886ff
[parser] Actually add the new tests
...
Whoops, missed a file.
2024-09-22 08:49:33 -07:00
bb52ab8da5
[parser] Error recovery tests
...
Based on the blog post "Resilient LL Parsing Tutorial" by Alex Kladov, at
https://matklad.github.io/2023/05/21/resilient-ll-parsing-tutorial.html
Because I was trying to be "simple" in my grammar definition I found
a bug in the grammar class, whoops! :)
2024-09-22 08:46:54 -07:00
071cd29d8f
[readme] Rewrite the readme and add a helper
...
The helper is nice actually.
2024-09-21 08:45:49 -07:00
b1f4c56f49
[wadler] One more bit of writing.
2024-09-21 07:45:59 -07:00
1a3ce02d48
[wadler] Re-factor into multiple modules
...
Hard split between builder and runtime, as is proper.
2024-09-21 07:42:52 -07:00
1f84752538
[wadler] Refactor: data and runtime split
...
Now we convert the grammar into data for a pretty-printer, so in
theoryw e could write the pretty-printer in a different language.
2024-09-21 06:44:53 -07:00
e4585170d8
[wadler] Fixup EOF trivia
...
Trivia handling feels pretty good now actually.
2024-09-19 20:23:02 -07:00
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
71b59302fa
Mess with wrapping and whatnot
2024-09-14 07:28:24 -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
39ae937ddc
Comments
...
Not really.
2024-09-13 23:16:46 -07:00
eea05ecd30
Show the result of pretty-printing in the harness
2024-09-13 22:50:43 -07:00
c8fef52c0c
Support prefix newlines, stop generating empty productions
...
This required rebuilding the matcher compiler significantly, and it
was a lot a lot of work. But now we don't generate so many spurious
newlines and the document we produce is a lot a lot better.
2024-09-13 22:41:33 -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
46770419e6
Dumb harness for working with wrapping
...
It's pretty manual but I want to see how bad it is.
2024-09-13 15:29:18 -07:00
8845bcfdab
Fix accidental group duplication
...
Leading to unnecessary ambiguities
2024-09-13 15:28:50 -07:00
ca240906c9
Remove the text follow stuff
...
I think we have a good solution to the problem.
2024-09-13 12:02:44 -07:00
d7a6891519
Finish annotating test grammar, forced breaks, fixes
...
Forced breaks force a newline in a spot, which is sometimes what we
want. (Like, this syntax should *never* be on a single line.)
2024-09-13 11:57:16 -07:00
938f0e5c69
Support newline replacements
...
This allows us to do maybe more complicated spacing.
Still unclear about identifier/punctuation spacing.
2024-09-12 11:09:14 -07:00