Class: Mirah::AST::UnquoteAssign

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

Instance Attribute Summary

Attributes inherited from Node

#children, #inferred_type, #newline, #parent, #position

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#<<, ===, #[], #[]=, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children

Constructor Details

This class inherits a constructor from Mirah::AST::Node

Class Method Details

._load(str) ⇒ Object



191
192
193
194
195
196
197
# File 'lib/mirah/ast/intrinsics.rb', line 191

def self._load(str)
  position, index, value = Marshal.load(str)
  holder = UnquotedValueAssign.new(nil, position)
  holder << Unquote.__injected[index].dup
  holder << value
  holder
end

Instance Method Details

#_dump(depth) ⇒ Object



183
184
185
186
187
188
# File 'lib/mirah/ast/intrinsics.rb', line 183

def _dump(depth)
  vals = Unquote.__extracted
  index = vals.size
  vals << self.name
  Marshal.dump([position, index, self.value])
end

#infer(typer, expression) ⇒ Object

Raises:



179
180
181
# File 'lib/mirah/ast/intrinsics.rb', line 179

def infer(typer, expression)
  raise Mirah::SyntaxError.new("UnquoteAssign used outside of macro")
end