-
Notifications
You must be signed in to change notification settings - Fork 38
Initial implementation of parse_map
#592
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
Conversation
|
So, after adding the tests I don't really feel any longer that we need porting over the serde stuff. |
Aha, that does sound plausible. At which point I'm fine with this approach!
That's what I'm hoping! One test of this would be if we can express the existing |
It is the case, the stuff in #589 (comment) was generated this way
It isn't possible, |
|
OOOPS! I meant |
|
I went ahead and added that test which checks their equivalence, but perhaps we could remove a lot of code by reimplementing In hindsight I wonder if you meant actually changing the Edit: After thinking about it, I don't know if |
I hadn't even thought about [I'm now wondering if |
|
Off-hand as pretty much a functional programmer, and someone terrible at naming things, I thought I'm uncertain about deprecating them because e.g. For instance, I tend to use the |
I wonder if we can/should make Warning: I haven't thought this through, and perhaps keeping things as-is is the best outcome! |
I think that'll actually work, it means duplicating the |
|
Good question about whether |
lrlex/src/lib/ctbuilder.rs
Outdated
| let input = fs::read_to_string(&path)?; | ||
| let l: LRNonStreamingLexer<LexerTypesT> = | ||
| closure_lexerdef.lexer(&input); | ||
| #[allow(deprecated)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed one here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in f8f5157
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this the only calls left to these deprecated functions should be in the testsuite code.
|
Looks good! Can we move |
|
Yeah we can, I think perhaps a good place might be wherever we want the serialization types for I don't know if we have a good name for that module, I had been calling it Maybe if we call it something like |
|
Where in the module/file hierarchy are you thinking that such a file might live? |
|
I was thinking |
|
I guess, ideally, the test stuff would be moved outside the lrpar crate, but that might not be possible. Idle thought: perhaps we need a generic |
|
I think it'd be awkward to have the If we did want to have a
So it does look like that testing code at least can be pushed out of |
|
So I think rather there is no impediment to moving the For instance we can see the My thinking is that it is pretty user surface visible stuff and seems likely to need a deprecation cycle? |
|
For |
|
Right, I guess I mean more than This also brings up an interesting issue, we have added |
I see your point! Could/should we put a |
|
What I would like to try and see if I can make it work is to:
So, after a deprecation cycle we can remove the entirety of I think that seems feasible, but does it sound reasonable? |
|
Sounds like a good plan to me: I like a route to deprecation where users get a warning (rather than an error). |
|
It required some hacks to do that, e.g. deprecating a type alias and then re-exporting the hidden concrete instance. One thing to note is that the |
|
Looks good! I think we're ready to squash. |
|
I noticed a couple of places where Squashed. |
|
Had to tweak the docs to avoid the doc link to |
Here is an initial attempt to implement something like
parse_map, which was discussed as a part of #589 ,I'm marking as draft because it is totally untested, it at least still needs the following:
and that the constraints that these function pointers are under from utilizing the
%parse_paramfieldsin this RtParserBuilder context doesn't overconstrain things such that the serde stuff is actually implementable.
But it seemed a good place to check that this is the kind of thing you were thinking of, or if I misinterpreted something.
I wasn't able to figure out what you meant by having separate
Nodetypes forTermandNonterm, or how thatwould be implementable, given that the type of the return from
parse_*is generically threaded through to constrain the return type of actions for bothTermandNonTerm(if that makes sense). But by using a single node type, for bothTermandNontermseemed feasible.Questions I have:
Nodefor the return type? I just fear that we have bothparser::Node<...>and Node as a generic type parameter, I would maybe just consider usingT