跳到內文 跳到搜尋

包裝正規表示法,並針對每個原始檔案的註解進行測試。

命名空間
方法
A

實體公開方法

註釋(檔案)

# File railties/lib/rails/source_annotation_extractor.rb, line 26
def annotations(file)
  result = Prism.parse_file(file)
  return [] unless result.success?

  result.comments.filter_map do |comment|
    Annotation.new(comment.location.start_line, $1, $2) if comment.location.slice =~ pattern
  end
end