class YARD::Parser::Ruby::Legacy::Statement
def clean_tokens(tokens)
def clean_tokens(tokens) last_tk = nil tokens.reject do |tk| tk.is_a?(RubyToken::TkNL) || (last_tk.is_a?(RubyToken::TkSPACE) && last_tk.class == tk.class) && last_tk = tk end end
def first_line
def first_line to_s.split(/\n/)[0] end
def initialize(tokens, block = nil, comments = nil)
def initialize(tokens, block = nil, comments = nil) @tokens = tokens @block = block @comments = comments @comments_hash_flag = false end
def inspect
def inspect l = line - 1 to_s(false).split(/\n/).map do |text| "\t#{l += 1}: #{text}" end.join("\n") end
def line
-
(Fixnum)- the first line of Ruby source
def line tokens.first.line_no end
def line_range
- Since: - 0.5.4
Returns:
-
(Range- the first to last lines of Ruby source)
def line_range tokens.first.line_no..tokens.last.line_no end
def show
def show "\t#{line}: #{first_line}" end
def to_s(include_block = true)
def to_s(include_block = true) tokens.map do |token| RubyToken::TkBlockContents === token ? (include_block ? block.to_s : '') : token.text end.join end