def append_node(type, indent: @indents.length, add: false, value: nil)
      # add necessary stack items to match required indent
      @stacks << @stacks.last.dup while indent >= @stacks.length

      parent = @stacks[indent].last
      node = AST::NodeRegistrator.create(type, @lineno)
      parent.children << node

      node.value = value unless value.nil?

      @stacks[indent] << node if add

      node
    end
def append_node(type, indent: @indents.length, add: false, value: nil)
      # add necessary stack items to match required indent
      @stacks << @stacks.last.dup while indent >= @stacks.length

      parent = @stacks[indent].last
      node = AST::NodeRegistrator.create(type, @lineno)
      parent.children << node

      node.value = value unless value.nil?

      @stacks[indent] << node if add

      node
    end
Append element to stacks and result tree

 @param [Symbol] type