Sha256: 12c35edc4737a1567c0e212658c942331c4adb28bc6938ab046974e3d0982ece
Contents?: true
Size: 773 Bytes
Versions: 12
Compression:
Stored size: 773 Bytes
Contents
module Parser module Source class Comment attr_reader :text attr_reader :location alias_method :loc, :location def self.associate(ast, comments) associator = Associator.new(comments, ast) associator.associate end def initialize(location) @location = location @text = location.source.freeze freeze end def type case text when /^#/ :inline when /^=begin/ :document end end def inline? type == :inline end def document? type == :document end def ==(other) other.is_a?(Source::Comment) && @location == other.location end end end end
Version data entries
12 entries across 12 versions & 1 rubygems