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.
240 241 242 243 244 245 246 |
# File 'lib/story_teller/grammar_parser.rb', line 240 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
238 239 240 |
# File 'lib/story_teller/grammar_parser.rb', line 238 def file=(value) @file = value end |
#line=(value) ⇒ Object (writeonly)
Sets the attribute line
238 239 240 |
# File 'lib/story_teller/grammar_parser.rb', line 238 def line=(value) @line = value end |
Instance Method Details
#to_s ⇒ Object
248 249 250 |
# File 'lib/story_teller/grammar_parser.rb', line 248 def to_s "(#{@file}):#{@line}: token error, unexpected '#{@found}', expecting '#{@expected}'" end |