Exception: Inform::UnexpectedToken
- Defined in:
- lib/runtime/grammar_parser.rb
Overview
The UnexpectedToken error class
Constant Summary collapse
- UnknownString =
'unknown'.freeze
Instance Attribute Summary collapse
-
#file ⇒ Object
writeonly
Sets the attribute file.
-
#line ⇒ Object
writeonly
Sets the attribute line.
Instance Method Summary collapse
-
#initialize(expected, found) ⇒ UnexpectedToken
constructor
A new instance of UnexpectedToken.
- #to_s ⇒ Object
Constructor Details
#initialize(expected, found) ⇒ UnexpectedToken
Returns a new instance of UnexpectedToken.
242 243 244 245 246 247 248 |
# File 'lib/runtime/grammar_parser.rb', line 242 def initialize(expected, found) super() @expected = expected @found = found @file = UnknownString @line = UnknownString end |
Instance Attribute Details
#file=(value) ⇒ Object (writeonly)
Sets the attribute file
240 241 242 |
# File 'lib/runtime/grammar_parser.rb', line 240 def file=(value) @file = value end |
#line=(value) ⇒ Object (writeonly)
Sets the attribute line
240 241 242 |
# File 'lib/runtime/grammar_parser.rb', line 240 def line=(value) @line = value end |
Instance Method Details
#to_s ⇒ Object
250 251 252 |
# File 'lib/runtime/grammar_parser.rb', line 250 def to_s "(#{@file}):#{@line}: token error, unexpected '#{@found}', expecting '#{@expected}'" end |