Skip to content

Refactor related parameterized rule and inline rule - #536

Merged
ydah merged 12 commits into
ruby:masterfrom
ydah:refactor-parameterized
Feb 16, 2025
Merged

Refactor related parameterized rule and inline rule#536
ydah merged 12 commits into
ruby:masterfrom
ydah:refactor-parameterized

Conversation

@ydah

@ydah ydah commented Feb 10, 2025

Copy link
Copy Markdown
Member

The following refactoring was performed

  • Use "Parameterized" instead of "Parameterizing".
    • Reduce the number of feature name types and organize them a bit
  • Implement inline rule resolution with dedicated resolver class.

@ydah
ydah force-pushed the refactor-parameterized branch from 22d16d3 to 02eb9fa Compare February 10, 2025 23:30
@ydah ydah changed the title Use "Parameterized" instead of "Parameterizing" Refactor related parameterized rule and inline rule Feb 10, 2025
@ydah
ydah force-pushed the refactor-parameterized branch from 06ed102 to 851bd18 Compare February 13, 2025 13:45
@ydah

ydah commented Feb 13, 2025

Copy link
Copy Markdown
Member Author

Resolve conflicts

@ydah
ydah force-pushed the refactor-parameterized branch from 851bd18 to c4f1dab Compare February 14, 2025 14:37
@ydah
ydah requested a review from yui-knk February 16, 2025 00:59
@yui-knk

yui-knk commented Feb 16, 2025

Copy link
Copy Markdown
Collaborator

I will review this PR.

@yui-knk

yui-knk commented Feb 16, 2025

Copy link
Copy Markdown
Collaborator

I agree to use "parameterized" in code base, actually "parameterized" is used in menhir code base.
One point need consideration is the name of this feature https://github.com/ruby/lrama/pull/536/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R45 because it's "parameterizing" when users define new parameterized rules.
Other seems good to me.

@ydah

ydah commented Feb 16, 2025

Copy link
Copy Markdown
Member Author

I agree to use "parameterized" in code base, actually "parameterized" is used in menhir code base. One point need consideration is the name of this feature https://github.com/ruby/lrama/pull/536/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R45 because it's "parameterizing" when users define new parameterized rules. Other seems good to me.

@yui-knk Indeed it is. We have reverted the function name to remain “Parameterizing” in fb02d43
When indicating the name of a function, “Parameterizing” in Upper CamelCase is used.

@yui-knk

yui-knk commented Feb 16, 2025

Copy link
Copy Markdown
Collaborator

LGTM

grammar.parameterizing_rule_resolver.redefined_rules.each do |rule|
@logger.warn("parameterizing rule redefined: #{rule}")
grammar.parameterized_resolver.redefined_rules.each do |rule|
@logger.warn("parameterized rule redefined: #{rule}")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

MEMO) I had a little difficulty here. Since this is a warning against “parameterized rules” rather than function names, I did not use Parameterizing. I don't have any strong opinions on this, so I will revert back if it feels different.

@ydah
ydah merged commit fe80a27 into ruby:master Feb 16, 2025
@ydah
ydah deleted the refactor-parameterized branch February 16, 2025 02:42
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