class SyntaxTree::Index::FileComments

When you’re using the instruction sequence backend, this class is used to lazily parse comments out of the source code.

Attributes

source[R]

Public Class Methods

new(source) click to toggle source
# File lib/syntax_tree/index.rb, line 139
def initialize(source)
  @source = source
end

Public Instance Methods

comments() click to toggle source
# File lib/syntax_tree/index.rb, line 143
def comments
  @comments ||= Parser.new(source.source).tap(&:parse).comments
end