Exception: Ast::Merge::ParseError
- Defined in:
- lib/ast/merge.rb
Overview
Base class for parse errors in merge operations.
This class provides a flexible interface that can be extended by
specific merge implementations. It supports:
- An
errorsarray for parser-specific error objects - An optional
contentattribute for the source that failed to parse
Subclasses (TemplateParseError, DestinationParseError) identify whether
the error occurred in the template or destination file.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ String?
readonly
The source content that failed to parse (optional).
-
#errors ⇒ Array
readonly
Parser-specific error objects (e.g., Prism::ParseError, RBS::BaseError).
Instance Method Summary collapse
-
#initialize(message = nil, errors: [], content: nil) ⇒ ParseError
constructor
Initialize a new ParseError.
Constructor Details
#initialize(message = nil, errors: [], content: nil) ⇒ ParseError
Initialize a new ParseError.
51 52 53 54 55 |
# File 'lib/ast/merge.rb', line 51 def initialize( = nil, errors: [], content: nil) @errors = Array(errors) @content = content super( || ) end |
Instance Attribute Details
#content ⇒ String? (readonly)
Returns The source content that failed to parse (optional).
44 45 46 |
# File 'lib/ast/merge.rb', line 44 def content @content end |
#errors ⇒ Array (readonly)
Returns Parser-specific error objects (e.g., Prism::ParseError, RBS::BaseError).
41 42 43 |
# File 'lib/ast/merge.rb', line 41 def errors @errors end |