Class: TRuby::ParserCombinator::TokenDeclarationParser::ParseError
- Inherits:
-
Object
- Object
- TRuby::ParserCombinator::TokenDeclarationParser::ParseError
- Defined in:
- lib/t_ruby/parser_combinator/token/token_declaration_parser.rb
Overview
Parse error with location info
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(message, token: nil) ⇒ ParseError
constructor
A new instance of ParseError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, token: nil) ⇒ ParseError
Returns a new instance of ParseError.
13 14 15 16 17 18 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 13 def initialize(, token: nil) = @token = token @line = token&.line || 1 @column = token&.column || 1 end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
11 12 13 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 11 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
11 12 13 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 11 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 11 def end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
11 12 13 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 11 def token @token end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/t_ruby/parser_combinator/token/token_declaration_parser.rb', line 20 def to_s "Line #{@line}, Column #{@column}: #{@message}" end |