diff options
author | Nobuhiro IMAI <nov@yo.rim.or.jp> | 2020-02-12 19:16:12 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-02-15 21:52:03 +0900 |
commit | 961630126b8081ea57b57cde3184e9ecfd86ff96 (patch) | |
tree | 2cb6acff5aa1f03efc3fee6ae523e303dbb6e6fc /lib/irb | |
parent | 38f1e84c37b91ddf9e61428d298eb27bee3bd2bc (diff) | |
download | ruby-961630126b8081ea57b57cde3184e9ecfd86ff96.tar.gz |
[ruby/irb] fix reserved words and completion for them
https://github.com/ruby/irb/commit/6184b227ad
Diffstat (limited to 'lib/irb')
-rw-r--r-- | lib/irb/completion.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 8c0474dcc5..723674738d 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -17,11 +17,12 @@ module IRB # Set of reserved words used by Ruby, you should not use these for # constants or variables ReservedWords = %w[ + __ENCODING__ __LINE__ __FILE__ BEGIN END alias and begin break case class - def defined do + def defined? do else elsif end ensure false for if in @@ -255,7 +256,7 @@ module IRB else candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s} - conditions |= ReservedWords + candidates |= ReservedWords if doc_namespace candidates.find{ |i| i == input } |