Closed CosmicHorrorDev closed 11 months ago
Alright, I'm quite happy with things now. Most of the code is from implementing our own replacement capture parsing to match upstream or building up the custom error to show the user. Making sure that we match upstream's implementation was the part I was most concerned with, but I'm rather happy with how the tests turned out, so that should hopefully be fine
This should be good enough to merge now :+1:
Fixes #44
(Still a draft. Needs a lot of cleanup)This is a
mostlyworking implementation that errors on capture names that are a number followed by a non-number valid capture char (a-zA-Z_). It's a decent chunk of code mostly becauseregex-automata
doesn't expose a replacement capture name iterator (and couldn't without a non-trivial refactoring of their code based on the current implementation). Instead we provide our own which requires a lot of care to matchregex-automata
's implementationAnyhoo, here's what the error looks like