Sha256: 271e36f80ac1ca293dcb51232bbc12140d6f7759ad9ce37573376c46a50e6dc4
Contents?: true
Size: 1.04 KB
Versions: 10
Compression:
Stored size: 1.04 KB
Contents
module YARD module Parser::Ruby::Legacy class Statement attr_reader :tokens, :comments, :block attr_accessor :comments_range def initialize(tokens, block = nil, comments = nil) @tokens = tokens @block = block @comments = comments end def first_line to_s(false) end def to_s(include_block = true) tokens.map do |token| RubyToken::TkBlockContents === token ? block.to_s : token.text end.join end alias source to_s def inspect l = line - 1 to_s.split(/\n/).map do |text| "\t#{l += 1}: #{text}" end.join("\n") end alias show inspect def line tokens.first.line_no end private 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 end end end
Version data entries
10 entries across 10 versions & 1 rubygems