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.
3023 3024 3025 3026 3027 |
# File 'lib/adlint/cc1/syntax.rb', line 3023 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.
3029 3030 3031 |
# File 'lib/adlint/cc1/syntax.rb', line 3029 def expression @expression end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
3030 3031 3032 |
# File 'lib/adlint/cc1/syntax.rb', line 3030 def type_name @type_name end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3044 3045 3046 |
# File 'lib/adlint/cc1/syntax.rb', line 3044 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
3032 3033 3034 |
# File 'lib/adlint/cc1/syntax.rb', line 3032 def location head_location end |
#to_s ⇒ Object
3036 3037 3038 3039 3040 3041 3042 |
# File 'lib/adlint/cc1/syntax.rb', line 3036 def to_s if @expression "__typeof__(#{@expression.to_s})" else "__typeof__(#{@type_name.to_s})" end end |