Class: UnexpectedTokenError

Inherits:
CompilerError show all
Defined in:
lib/compiler_error.rb

Instance Method Summary collapse

Methods inherited from CompilerError

#to_s

Constructor Details

#initialize(token) ⇒ UnexpectedTokenError



182
183
184
185
186
# File 'lib/compiler_error.rb', line 182

def initialize token
  super token.position
  @type = token.type
  @value = token.value
end

Instance Method Details

#infoObject



188
189
190
# File 'lib/compiler_error.rb', line 188

def info
  "unexpected #{@type.to_s.downcase} : '#{@value}'"
end