Glues data from a child node to the output
 Example:
   glue(:@user) { attribute :name }
424764
def glue(data)
      return unless block_given?

      template = sub_compile(data) { yield }

      template.nodes.each_value do |value|
        @attributes.add name: value.name, attr: "#{data}.#{value.attr}", nested: value.nested
      end
    end
646746
def make_node(clss, node, *params):
        ''' 
        '''
        if node is None:
            node = clss()

        if node.token != 'PARAMLIST':
            return clss.make_node(None, node, *params)

        for i in params:
            if i is not None:
                node.appendChild(i)

        return node
355149
public function setAttribute($name, $value, $glue = false)
    {
        //get attributes
        $attrbs = AnConfig::unbox(pick($this->attribs, array()));

        //get the existing value
        $old = isset($attrbs[$name]) ? $attrbs[$name] : null;

        //if glue and existing value then stich the old and new using the glue
        if ($glue && $old) {
            $value = $old.(string) $glue.$value;
        }

        //put the attributes back
        $attrbs[$name] = $value;
        $this->attribs = $attrbs;

        return $this;
    }
1205024
def attach_dummy_node(node, name, runtime_object=_marker):
    
    enode = nodes.EmptyNode()
    enode.object = runtime_object
    _attach_local_node(node, enode, name)
362526
def node(name, type, options = {}, &block)
      attr_reader name.to_sym
      options[:local_context] = @local_context
      xpath = NodeXPath.new(name, options).xpath
      define_method("parse_#{name}".to_sym) do
        evaluate_args = [xpath, AwesomeXML::Type.for(type, self.class.name), options]
        instance_variable_set(
          "@#{name}",
          evaluate_nodes(*evaluate_args, &block)
        )
      end
      register(name, options[:private])
    end
503576
function getNodesByNameHelper(childArray, name) {
  let nodes = [].concat(childArray.filter(element => element.name === name));
  let otherNodes = [];
  childArray.forEach(node => {
    if (hasChildren(node)) {
      otherNodes = otherNodes.concat(getNodesByNameHelper(node.children, name));
    }
  });
  return nodes.concat(otherNodes);
}
99643
def link_(a, nodes, b)
      if nodes.empty?
        if a.nil?
          @first = b
        else
          a.instance_variable_set(:@next, b)
        end
        if b.nil?
          @last = a
        else
          b.instance_variable_set(:@prev, a)
        end
      else
        # connect `a' and `b'
        first = nodes.first
        if a.nil?
          @first = first
        else
          a.instance_variable_set(:@next, first)
        end
        last = nodes.last
        if b.nil?
          @last = last
        else
          b.instance_variable_set(:@prev, last)
        end

        # connect `nodes'
        if nodes.length == 1
          node = nodes[0]
          node.instance_variable_set(:@prev, a)
          node.instance_variable_set(:@next, b)
        else
          first.instance_variable_set(:@next, nodes[ 1])
          first.instance_variable_set(:@prev, a)
          last. instance_variable_set(:@prev, nodes[-2])
          last. instance_variable_set(:@next, b)
          (1...nodes.length-1).each do |i|
            n = nodes[i]
            n.instance_variable_set(:@prev, nodes[i-1])
            n.instance_variable_set(:@next, nodes[i+1])
          end
        end
      end
    end
934920
function(){
    var obj = new nodes.Object
      , id, val, comma, hash;
    this.expect('{');
    this.skipWhitespace();

    while (!this.accept('}')) {
      if (this.accept('comment')
        || this.accept('newline')) continue;

      if (!comma) this.accept(',');
      id = this.accept('ident') || this.accept('string');

      if (!id) {
        this.error('expected "ident" or "string", got {peek}');
      }

      hash = id.val.hash;

      this.skipSpacesAndComments();
      this.expect(':');

      val = this.expression();

      obj.setValue(hash, val);
      obj.setKey(hash, id.val);

      comma = this.accept(',');
      this.skipWhitespace();
    }

    return obj;
  }
196396
def parse(node)
      @fill = PresentationFill.new(parent: self).parse(node)
      @line_join = LineJoin.new(parent: self).parse(node)
      node.attributes.each do |key, value|
        case key
        when 'w'
          @width = OoxmlSize.new(value.value.to_f, :emu)
        when 'algn'
          @align = value_to_symbol(value)
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'headEnd'
          @head_end = LineEnd.new(parent: self).parse(node_child)
        when 'tailEnd'
          @tail_end = LineEnd.new(parent: self).parse(node_child)
        when 'ln'
          return TableCellLine.new(parent: self).parse(node_child)
        end
      end
      self
    end
1339376
def make_node(cls, *args):
        
        new_args = []

        args = [x for x in args if not is_null(x)]
        for x in args:
            assert isinstance(x, Symbol)
            if x.token == 'BLOCK':
                new_args.extend(SymbolBLOCK.make_node(*x.children).children)
            else:
                new_args.append(x)

        result = SymbolBLOCK(*new_args)
        return result
159595
function maintain_this_binding(parent, orig, val) {
        if (parent instanceof AST_UnaryPrefix && parent.operator == "delete"
            || parent instanceof AST_Call && parent.expression === orig
                && (val instanceof AST_PropAccess || val instanceof AST_SymbolRef && val.name == "eval")) {
            return make_node(AST_Seq, orig, {
                car: make_node(AST_Number, orig, {
                    value: 0
                }),
                cdr: val
            });
        }
        return val;
    }
1243600
function childrenByName(node, name) {
  var children = [];
  var childNodes = node.childNodes;

  for (var childKey in childNodes) {
    var child = childNodes[childKey];

    if (child.nodeName === name) {
      children.push(child);
    }
  }
  return children;
}
635247
function (glue, pieces) {

            var retVal = "",
                tGlue  = "";

            if (arguments.length === 1) {
                pieces = glue;
                glue   = "";
            }

            if (typeof pieces === "object") {
                if ($this.type(pieces) === "array") {
                    return pieces.join(glue);
                }

                $this.each(pieces, function (i) {
                    retVal += tGlue + pieces[i];
                    tGlue = glue;
                });

                return retVal;
            }
        }
488645
def prepend_child(node)
      raise "argument to << must be a String or Ox::Node." unless node.is_a?(String) or node.is_a?(Node)
      @nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
      @nodes.unshift(node)
      self
    end
614782
function(node, obj) {
        var children = node.childNodes;
        var child, nodeName, value;
        for(var i=0, len=children.length; i<len; ++i) {
            child = children[i];
            if(child.nodeType == 1) {
                nodeName = child.nodeName.split(":").pop();
                value = child.getAttribute("value");
                if(!obj[nodeName]) {
                    obj[nodeName] = value;
                } else {
                    if(typeof obj[nodeName] == "string") {
                        obj[nodeName] = [obj[nodeName]];
                    }
                    obj[nodeName].push(value);
                }
            }
        }
    }
615640
private DefaultMutableTreeNode makeNode(Object userObject,
            MutableTreeNode parent) {

        DefaultMutableTreeNode node = new DefaultMutableTreeNode(userObject);

        if (parent != null) {
            treeModel.insertNodeInto(node, parent, parent.getChildCount());
        }

        return node;
    }
178425
function(prefix, phash, glue) {
		var i = 0, ext = '', p, name;
		
		prefix = this.i18n(false, prefix);
		phash = phash || this.cwd().hash;
		glue = (typeof glue === 'undefined')? ' ' : glue;

		if (p = prefix.match(/^(.+)(\.[^.]+)$/)) {
			ext    = p[2];
			prefix = p[1];
		}
		
		name   = prefix+ext;
		
		if (!this.fileByName(name, phash)) {
			return name;
		}
		while (i < 10000) {
			name = prefix + glue + (++i) + ext;
			if (!this.fileByName(name, phash)) {
				return name;
			}
		}
		return prefix + Math.random() + ext;
	}