Exception: Rubycc::Front::ConstantEvaluator::NotConstant
- Inherits:
-
StandardError
- Object
- StandardError
- Rubycc::Front::ConstantEvaluator::NotConstant
- Defined in:
- lib/rubycc/front/constant_evaluator.rb
Overview
Raised when some reachable part of the expression is not a
constant-expression at all — a variable reference, a function call, an
assignment, an increment/decrement, sizeof of an expression, or a
comma. token is the offending node's token, for the caller to build a
diagnostic naming its own context ("case label ...", "array size ...").
Direct Known Subclasses
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ NotConstant
constructor
A new instance of NotConstant.
Constructor Details
#initialize(token) ⇒ NotConstant
Returns a new instance of NotConstant.
35 36 37 38 |
# File 'lib/rubycc/front/constant_evaluator.rb', line 35 def initialize(token) @token = token super("expression is not a constant expression") end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
33 34 35 |
# File 'lib/rubycc/front/constant_evaluator.rb', line 33 def token @token end |