# File lib/astrolabe/node.rb, line 23 def initialize(type, children = [], properties = {}) @mutable_attributes = {} # ::AST::Node#initialize freezes itself. super # #parent= would be invoked multiple times for a node because there are pending nodes while # constructing AST and they are replaced later. # For example, `lvar` and `send` type nodes are initially created as an `ident` type node and # fixed to each type later. # So, the #parent attribute needs to be mutable. each_child_node do |child_node| child_node.parent = self end end