diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
commit | 23863ff75d3ec9205d5f365b98b6608e38a93749 (patch) | |
tree | 362b9fc870edb3820ef488a6618baf5669d3aa48 /lib/rdoc/ruby_lex.rb | |
parent | 0d715e1b7540e1c876a4c53862355d5c43dd8683 (diff) | |
download | ruby-23863ff75d3ec9205d5f365b98b6608e38a93749.tar.gz |
* lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513)
https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016--
https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ruby_lex.rb')
-rw-r--r-- | lib/rdoc/ruby_lex.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index e772e660e0..11ac8da85c 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -102,10 +102,10 @@ class RDoc::RubyLex @exp_line_no = @line_no = 1 @here_readed = [] @readed = [] + @current_readed = @readed @rests = [] @seek = 0 - @here_header = false @indent = 0 @indent_stack = [] @lex_state = :EXPR_BEG @@ -161,7 +161,7 @@ class RDoc::RubyLex end readed = @readed.join("") - @readed = [] + @readed.clear readed end @@ -171,13 +171,9 @@ class RDoc::RubyLex @rests.push nil unless buf_input end c = @rests.shift - if @here_header - @here_readed.push c - else - @readed.push c - end + @current_readed.push c @seek += 1 - if c == "\n" + if c == "\n".freeze @line_no += 1 @char_no = 0 else @@ -283,7 +279,7 @@ class RDoc::RubyLex @indent_stack = [] @lex_state = :EXPR_BEG @space_seen = false - @here_header = false + @current_readed = @readed @continue = false prompt @@ -462,8 +458,8 @@ class RDoc::RubyLex @indent_stack.pop end end - @here_header = false - @here_readed = [] + @current_readed = @readed + @here_readed.clear Token(TkNL) end @@ -1021,7 +1017,7 @@ class RDoc::RubyLex doc = '"' end - @here_header = false + @current_readed = @readed while l = gets l = l.sub(/(:?\r)?\n\z/, "\n") if (indent ? l.strip : l.chomp) == quoted @@ -1038,7 +1034,7 @@ class RDoc::RubyLex doc << '"' end - @here_header = true + @current_readed = @here_readed @here_readed.concat reserve while ch = reserve.pop ungetc ch |