-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document unsupported syntax #36
Comments
Hi! So I initially looked at what was counted as unsupported and it seems like there is some stuff to just automatically flag it, though it doesn't always work, so I went through this to find things that weren't implemented or didn't appear to be implemented in an expected way. So to get the list below I went through the various examples (obviously with other stuff added if needed) and parsed it to see if the parse function would work. So far I go this from Java8 just as a sort of preliminary thing:
So I guess the question is what I should do from here. I think implementing a function to automatically check functionality by checking that the parsed regex behaves as expected when compared to the initial regex (and maybe generate the documentation for unsupported features) might be a good idea, but I would like some input. (the specific reasoning behind the automatic documentation generation / testing is because some people presumably want to implement these things, so the docs might become out of date relative to the implementations) |
Hey, I commented on the PR before seeing this. Let me try to add a bit more context.
If these exist on all targets then they would be great to add.
These are already fairly exotic, as I mentioned on the PR we are more focused on solidifying what we have and maybe adding very frequently used features. I think a lot of devs don't even know these are a thing, so low priority.
This is one of the things where you need to look at it from the Regal syntax perspective. It doesn't make sense to support these because they're just another way to write the same thing. If we wanted to "support" this would we take an integer but treat it as an octal? You can use
Similar reasoning as above. They are aliases. What's also problematically is that these can be subtly different between platforms that have them, or even between different Java versions. What I could imagine happening is that we add constants for the equivalent regal forms, so people get the same convenience, but in a cross-platform regal-first kind of way.
I'm not sure what these are, but probably a similar reasoning as with POSIX.
Same
I didn't even realize this was a separate thing from just "whitespace". Could be worth adding. If all platforms implement it the same way then it's easy to do, otherwise it gets more elaborate because then we want to settle on the semantics that Regal will adopt, and output an equivalent regex on platforms that don't match that (e.g.
This one's tricky because it depends on if the regex is multiline or not, we currently don't support any flags like that, so for us
Today I learned! Seems low priority, would need research into cross-platform support.
Deliberately not implemented due to lack of cross platform support, although that could change, some JS implementations do have it now.
Deliberately not supported at the moment because we don't have a good cross-platform story, and I feel like it would generally complicate things for us since it influences the semantics of certain forms. On the other hand some of these are very commonly used and useful, so I do feel we need to find a good story for at least the common ones at some point.
As I pointed out on the PR we do have a bunch of tests that are driven by data, which try to validate the individual parts of the library based off of the same data. But these are formulated starting from the Regal form, which is by design. Still I could imagine adding cases in there for future extension. Something like :horizontal-whitespace
^:not-implemented [_ ["\\h" "\t"] ["\\h" " "]] Here I've omitted the regal form ( |
I think this makes sense to document, so I think it's reasonable to keep open, especially since we have notes from Arne. |
@plexus Hi Arne! I wonder why named capturing groups are not implemented? Why is cross-platform support missing? It looks like:
Am I missing something obvious? Thank you! |
Most of the syntax we don't support is pretty rare (especially once lazy qualifiers are added), but it would be nice to document what we don't support. I think we can do Java 8 & 9, ECMA, and RE2 in that order.
The text was updated successfully, but these errors were encountered: