Class: AdLint::Cc1::TypeofTypeSpecifier
- Inherits:
-
TypeSpecifier
- Object
- SyntaxNode
- TypeSpecifier
- AdLint::Cc1::TypeofTypeSpecifier
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(expr, type_name) ⇒ TypeofTypeSpecifier
constructor
A new instance of TypeofTypeSpecifier.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(expr, type_name) ⇒ TypeofTypeSpecifier
Returns a new instance of TypeofTypeSpecifier.
3042 3043 3044 3045 3046 |
# File 'lib/adlint/cc1/syntax.rb', line 3042 def initialize(expr, type_name) super() @expression = expr @type_name = type_name end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3048 3049 3050 |
# File 'lib/adlint/cc1/syntax.rb', line 3048 def expression @expression end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
3049 3050 3051 |
# File 'lib/adlint/cc1/syntax.rb', line 3049 def type_name @type_name end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3063 3064 3065 |
# File 'lib/adlint/cc1/syntax.rb', line 3063 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
3051 3052 3053 |
# File 'lib/adlint/cc1/syntax.rb', line 3051 def location head_location end |
#to_s ⇒ Object
3055 3056 3057 3058 3059 3060 3061 |
# File 'lib/adlint/cc1/syntax.rb', line 3055 def to_s if @expression "__typeof__(#{@expression.to_s})" else "__typeof__(#{@type_name.to_s})" end end |