1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge rdoc-6.1.0.beta2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aycabta 2018-10-17 06:28:20 +00:00
parent 2a59b579fe
commit 1b43644edc
38 changed files with 602 additions and 528 deletions

View file

@ -25,12 +25,10 @@ module RDoc::Parser::RubyTools
tk = @scanner[@scanner_point]
@scanner_point += 1
@read.push tk[:text]
puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
end
else
@read.push @unget_read.shift
tk = @tokens.shift
puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
end
if tk == nil || :on___end__ == tk[:kind]
@ -111,17 +109,27 @@ module RDoc::Parser::RubyTools
@scanner_point = 0
end
def tk_nl?(tk)
:on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
##
# Skips whitespace tokens including newlines
def skip_tkspace
tokens = []
while (tk = get_tk) and (:on_sp == tk[:kind] or :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]) do
tokens.push(tk)
end
unget_tk(tk)
tokens
end
##
# Skips whitespace tokens including newlines if +skip_nl+ is true
# Skips whitespace tokens excluding newlines
def skip_tkspace(skip_nl = true)
def skip_tkspace_without_nl
tokens = []
while (tk = get_tk) and (:on_sp == tk[:kind] or (skip_nl and tk_nl?(tk))) do
while (tk = get_tk) and :on_sp == tk[:kind] do
tokens.push(tk)
end