Class: Prism::Translation::Parser::Diagnostic
- Inherits:
-
Parser::Diagnostic
- Object
- Parser::Diagnostic
- Prism::Translation::Parser::Diagnostic
- Defined in:
- lib/prism/translation/parser.rb
Overview
The parser gem has a list of diagnostics with a hard-coded set of error messages. We create our own diagnostic class in order to set our own error messages.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
The message generated by prism.
Instance Method Summary collapse
-
#initialize(message, location) ⇒ Diagnostic
constructor
Initialize a new diagnostic with the given message and location.
Constructor Details
#initialize(message, location) ⇒ Diagnostic
Initialize a new diagnostic with the given message and location.
20 21 22 23 |
# File 'lib/prism/translation/parser.rb', line 20 def initialize(, location) @message = super(:error, :prism_error, {}, location, []) end |
Instance Attribute Details
#message ⇒ Object (readonly)
The message generated by prism.
17 18 19 |
# File 'lib/prism/translation/parser.rb', line 17 def @message end |