-
Notifications
You must be signed in to change notification settings - Fork 38
feedback on mod _cache_information_ instead of CACHE_INFORMATION comment.
#504
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
feedback on mod _cache_information_ instead of CACHE_INFORMATION comment.
#504
Conversation
|
FWIW, been doing local testing using the following patch, this PR is now in a state where diff --git a/lrpar/examples/calc_actions/build.rs b/lrpar/examples/calc_actions/build.rs
|
|
Just going to go ahead and unmark this as draft since the |
|
Please squash. |
The quote crate doesn't deal with comments, since there isn't a comment token. This patch migrates the cache information to a module. The module is nested within the `lrpar_mod!` module in order to avoid introducing multiple modules with the same name at top-level when generating multiple parsers. When possible it generate constants, otherwise it generates a function. Together these are intended to satisfy the same purpose as the previous `CACHE INFORMATION` comment.
9cf906d to
c5073e0
Compare
|
Squashed. |
This moves away from a
/* CACHE INFORMATIONcomment. Instead it uses a module and places all the data into constant values. Because thequotecrate relies heavily on proc-macro2 token types which lacks a comment token. So it doesn't actually have any representation for comments.One trick is to the attribute for a doc comment but hide the doc comment in some inner scope.
This is fairly hacky, and inconvenient because rustdoc still will want it to be properly formatted documentation, there is also the possibility that it the tools become smart enough to figure out that these doc strings are unreachable.
Instead this patch migrates the cache information to a module with constant values. This module is nested within the
lrpar_mod!module in order to avoid introducing multiple modules with thecache_informationname at top-level when generating multiple parsers.