Class: StarlarkCompiler::AST::VariableAssignment

Inherits:
Node
  • Object
show all
Defined in:
lib/starlark_compiler/ast.rb

Constant Summary collapse

TYPE =
:Statement

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, var) ⇒ VariableAssignment

Returns a new instance of VariableAssignment.



127
128
129
130
131
132
133
134
# File 'lib/starlark_compiler/ast.rb', line 127

def initialize(name, var)
  @name = name
  if node(var).class::TYPE != :Expression
    raise "Unsupported type on rhs for assignment: #{var.class}"
  end

  @var = node(var)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



126
127
128
# File 'lib/starlark_compiler/ast.rb', line 126

def name
  @name
end

#varObject (readonly)

Returns the value of attribute var.



126
127
128
# File 'lib/starlark_compiler/ast.rb', line 126

def var
  @var
end