Skip to content

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

Merged
tompng merged 2 commits into
ruby:masterfrom
tompng:simplifty_next_catch_break_alias
Sep 12, 2024
Merged

Remove KEYWORD_ALIASES which handled special alias name of irb_break irb_catch and irb_next command#1004
tompng merged 2 commits into
ruby:masterfrom
tompng:simplifty_next_catch_break_alias

Conversation

@tompng

@tompng tompng commented Sep 11, 2024

Copy link
Copy Markdown
Member

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

@st0012 st0012 left a comment

Copy link
Copy Markdown
Member

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.

Comment thread lib/irb/context.rb Outdated
Comment thread lib/irb/context.rb Outdated
@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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants