diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
commit | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/irb/completion.rb | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/completion.rb')
-rw-r--r-- | lib/irb/completion.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 26339f217d..a31bee0c76 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -1,5 +1,5 @@ # -# irb/completor.rb - +# irb/completor.rb - # $Release Version: 0.9$ # $Revision$ # by Keiju ISHITSUKA([email protected]) @@ -15,16 +15,16 @@ module IRB ReservedWords = [ "BEGIN", "END", - "alias", "and", - "begin", "break", + "alias", "and", + "begin", "break", "case", "class", "def", "defined", "do", "else", "elsif", "end", "ensure", - "false", "for", - "if", "in", - "module", + "false", "for", + "if", "in", + "module", "next", "nil", "not", - "or", + "or", "redo", "rescue", "retry", "return", "self", "super", "then", "true", @@ -32,10 +32,10 @@ module IRB "when", "while", "yield", ] - + CompletionProc = proc { |input| bind = IRB.conf[:MAIN_CONTEXT].workspace.binding - + # puts "input: #{input}" case input @@ -63,7 +63,7 @@ module IRB candidates = Proc.instance_methods.collect{|m| m.to_s} candidates |= Hash.instance_methods.collect{|m| m.to_s} select_message(receiver, message, candidates) - + when /^(:[^:.]*)$/ # Symbol if Symbol.respond_to?(:all_symbols) @@ -137,7 +137,7 @@ module IRB gv = eval("global_variables", bind).collect{|m| m.to_s} lv = eval("local_variables", bind).collect{|m| m.to_s} cv = eval("self.class.constants", bind).collect{|m| m.to_s} - + if (gv | lv | cv).include?(receiver) # foo.func and foo is local var. candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s} @@ -157,7 +157,7 @@ module IRB rescue Exception name = "" end - next if name != "IRB::Context" and + next if name != "IRB::Context" and /^(IRB|SLex|RubyLex|RubyToken)/ =~ name candidates.concat m.instance_methods(false).collect{|x| x.to_s} } @@ -177,7 +177,7 @@ module IRB else candidates = eval("methods | private_methods | local_variables | self.class.constants", bind).collect{|m| m.to_s} - + (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/) end } |