Skip to content

Add tool name to grmtools section entries - #664

Draft
ratmice wants to merge 2 commits into
softdevteam:masterfrom
ratmice:grmtools_section_user_entries
Draft

Add tool name to grmtools section entries#664
ratmice wants to merge 2 commits into
softdevteam:masterfrom
ratmice:grmtools_section_user_entries

Conversation

@ratmice

@ratmice ratmice commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

So here is a first foray into adding a default "tool name" for %grmtools section entries,
This turned out a bit more complex than I had thought, for one it seemed that since lex_flags largely get passed
directly into the regex crate, we should name those regex.foo rather than grmtools.foo.

I named this "tool name" because there is already a thing we call namespace in this area, and that like YaccKind:: and the like.

let mut map = HashMap::new();
let grmtools = [
"yacckind",
"lexerkind",

@ratmice ratmice Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ratmice

ratmice commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

I guess I should mention this just adds default "tool names" to the existing entries.
It doesn't actually allow any user specified values yet.

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(|| {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would target name be better than tool name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants