Skip to content
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

Remove KEYWORD_ALIASES which handled special alias name of irb_break irb_catch and irb_next command #1004

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Sep 11, 2024

This comment is outdated. We don't need KEYWORD_ALIASES anymore.

# because all input will eventually be evaluated as Ruby code,
# command names that conflict with Ruby keywords need special workaround
# we can remove them once we implemented a better command system for IRB
KEYWORD_ALIASES = { ... }

[:catch, OVERRIDE_PRIVATE_ONLY]

Just like exit and exit!, catch is already defined as a private method of Object.
IRB's command usually sets OVERRIDE_PRIVATE_ONLY in this case.

[:next , OVERRIDE_ALL], [:break , OVERRIDE_ALL]

both next a break a are always syntax error. These input should be always treated as a command even if a method with the same name is defined.

@tompng tompng mentioned this pull request Sep 11, 2024
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Good catch 👍 Just a small suggestion.

lib/irb/context.rb Outdated Show resolved Hide resolved
lib/irb/context.rb Outdated Show resolved Hide resolved
@st0012 st0012 added the bug Something isn't working label Sep 12, 2024
Co-authored-by: Stan Lo <stan001212@gmail.com>
@tompng tompng merged commit f256d78 into ruby:master Sep 12, 2024
30 checks passed
@tompng tompng deleted the simplifty_next_catch_break_alias branch September 12, 2024 15:04
matzbot pushed a commit to ruby/ruby that referenced this pull request Sep 12, 2024
of irb_break irb_catch and irb_next command
(ruby/irb#1004)

* Remove KEYWORD_ALIASES which handled special alias name of irb_break irb_catch and irb_next command

* Remove unused instance variable user_aliases

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

ruby/irb@f256d7899f

Co-authored-by: Stan Lo <stan001212@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants