Exception: Rubycc::Front::ConstantEvaluator::DivisionByZero

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rubycc/front/constant_evaluator.rb

Overview

Raised when a division or remainder operator that is reached at evaluation time (one on the taken side of "&&"/"||"/"?:" — the other side is never evaluated, so a zero divisor there raises nothing) has a zero right operand. token is the operator's token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ DivisionByZero

Returns a new instance of DivisionByZero.



48
49
50
51
# File 'lib/rubycc/front/constant_evaluator.rb', line 48

def initialize(token)
  @token = token
  super("division by zero in constant expression")
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



46
47
48
# File 'lib/rubycc/front/constant_evaluator.rb', line 46

def token
  @token
end