Exception: Rubycc::Front::ConstantEvaluator::DivisionByZero
- Inherits:
-
StandardError
- Object
- StandardError
- Rubycc::Front::ConstantEvaluator::DivisionByZero
- 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
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ DivisionByZero
constructor
A new instance of DivisionByZero.
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
#token ⇒ Object (readonly)
Returns the value of attribute token.
46 47 48 |
# File 'lib/rubycc/front/constant_evaluator.rb', line 46 def token @token end |