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 ‘errors` array for parser-specific error objects
-
An optional ‘content` attribute 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.
48 49 50 51 52 |
# File 'lib/ast/merge.rb', line 48 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).
41 42 43 |
# File 'lib/ast/merge.rb', line 41 def content @content end |
#errors ⇒ Array (readonly)
Returns Parser-specific error objects (e.g., Prism::ParseError, RBS::BaseError).
38 39 40 |
# File 'lib/ast/merge.rb', line 38 def errors @errors end |