Add tool name to grmtools section entries - #664
Draft
ratmice wants to merge 2 commits into
Draft
Conversation
ratmice
commented
Aug 25, 2026
| let mut map = HashMap::new(); | ||
| let grmtools = [ | ||
| "yacckind", | ||
| "lexerkind", |
Collaborator
Author
There was a problem hiding this comment.
grmtools as the notion of a "tool name" is kind of awkward.
I was wondering if it might be better to have lrpar.yacckind and lrlex.lexerkind
instead of grmtools.* for all the crates?
Not sure if it is better to have uniformity across the crates, or indication of who uses it.
Collaborator
Author
|
I guess I should mention this just adds default "tool names" to the existing entries. |
ratmice
commented
Aug 25, 2026
| static RE_DIGITS: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"^[0-9]+").unwrap()); | ||
| static RE_STRING: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"^\"(\\.|[^"\\])*\""#).unwrap()); | ||
|
|
||
| static DEFAULT_TOOLNAME: LazyLock<HashMap<&'static str, &'static str>> = LazyLock::new(|| { |
Collaborator
Author
There was a problem hiding this comment.
would target name be better than tool name?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So here is a first foray into adding a default "tool name" for
%grmtoolssection entries,This turned out a bit more complex than I had thought, for one it seemed that since
lex_flagslargely get passeddirectly into the
regexcrate, we should name thoseregex.foorather thangrmtools.foo.I named this "tool name" because there is already a thing we call
namespacein this area, and that likeYaccKind::and the like.