Commit graph

16 commits

Author SHA1 Message Date
b2e7d15fb8 Report actual error positions in token errors 2025-02-16 08:06:18 -08:00
13f1353134 [runtime] When all else fails ask the author
Better error messages by allowing the author to customize the string.
(This kinda works actually.)
2024-10-28 06:24:47 -07:00
c44083b610 [runtime] Slightly better messages
Picking the final reduction seems to get to a better place.
2024-10-28 06:06:23 -07:00
063584fb7e [runtime] Better error messages?
(Sometimes.)
2024-10-27 09:10:31 -07:00
0a0f7b3612 [parser] Comment cleanup, documentation cleanup 2024-10-27 08:36:16 -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
b3b2102864 Record trivia in tokens
This will make our formatting better I think.
2024-09-12 06:22:49 -07:00
49b76b9bcc Teach trees to format themselves. 2024-09-09 06:22:56 -07:00
f8b62bf4a4 Terminal 'value' is 'name', compile_lexer is method 2024-08-29 08:22:23 -07:00
0be0075cfe Generic token stream
Compatible with the harness
2024-08-27 16:47:26 -07:00
7a5f17f74b Specify and honor trivia tokens
e.g. "this is how machine-generated parsers know to skip blanks and
comments"

The run time implementation could be better; we don't really want to
just discard trivia because it's useful for e.g. doc comments and the
like. BUT for now this is fine.
2024-08-24 10:01:40 -07:00
f29ec5072f Augment number pattern, tests
More robust testing. Error messages would be nice but.
2024-08-24 09:38:21 -07:00
72052645d6 Generated lexers actually kinda work
But regular expressions are underpowered and verbose
2024-08-23 15:32:35 -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