class AdLint::Cc1::Initializer

Attributes

expression[R]
initializers[R]

Public Class Methods

new(expr, inits) click to toggle source
Calls superclass method AdLint::Cc1::SyntaxNode::new
# File lib/adlint/cc1/syntax.rb, line 4418
def initialize(expr, inits)
  super()
  @expression = expr
  @initializers = inits
end

Public Instance Methods

inspect(indent = 0) click to toggle source
# File lib/adlint/cc1/syntax.rb, line 4442
def inspect(indent = 0)
  " " * indent + short_class_name
end
location() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 4427
def location
  head_location
end
to_s() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 4431
def to_s
  case
  when @expression
    @expression.to_s
  when @initializers
    "{#{@initializers.map { |ini| ini.to_s }.join(",")}}"
  else
    "{}"
  end
end