Exception: Inform::UnexpectedToken
- Defined in:
- lib/story_teller/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.
255 256 257 258 259 260 261 |
# File 'lib/story_teller/grammar_parser.rb', line 255 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
253 254 255 |
# File 'lib/story_teller/grammar_parser.rb', line 253 def file=(value) @file = value end |
#line=(value) ⇒ Object (writeonly)
Sets the attribute line
253 254 255 |
# File 'lib/story_teller/grammar_parser.rb', line 253 def line=(value) @line = value end |
Instance Method Details
#to_s ⇒ Object
263 264 265 |
# File 'lib/story_teller/grammar_parser.rb', line 263 def to_s "(#{@file}):#{@line}: token error, unexpected '#{@found}', expecting '#{@expected}'" end |