ruby / irb

interactive Ruby
BSD 2-Clause "Simplified" License
392 stars 119 forks source link

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

Closed tompng closed 2 months ago

tompng commented 2 months ago

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.