Module: Prism::Merge::Comment

Defined in:
lib/prism/merge/comment.rb,
lib/prism/merge/comment/line.rb,
lib/prism/merge/comment/block.rb,
lib/prism/merge/comment/parser.rb

Overview

Ruby-specific comment AST nodes for prism-merge.

These classes extend the generic Ast::Merge::Comment classes with
Ruby-specific features like magic comment detection.

Examples:

Parsing Ruby comments

lines = ["# frozen_string_literal: true", "", "# A comment"]
nodes = Comment::Parser.parse(lines)
nodes.first.contains_magic_comment? #=> true

Defined Under Namespace

Classes: Block, Line, Parser