src/generators/template/builder.js
function createTagWithBindings(sourceNode, sourceFile, sourceCode) {
  const bindingsSelector = isRootNode(sourceNode) ? null : createBindingSelector()
  const cloneNode = createBindingsTag(sourceNode, bindingsSelector)
  const tagOpeningHTML = nodeToString(cloneNode)

  switch(true) {
  // EACH bindings have prio 1
  case hasEachAttribute(cloneNode):
    return [tagOpeningHTML, [eachBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // IF bindings have prio 2
  case hasIfAttribute(cloneNode):
    return [tagOpeningHTML, [ifBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // TAG bindings have prio 3
  case isCustomNode(cloneNode):
    return [tagOpeningHTML, [tagBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // this node has expressions bound to it
  default:
    return [tagOpeningHTML, [simpleBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  }
}
function createTagWithBindings(sourceNode, sourceFile, sourceCode) {
  const bindingsSelector = isRootNode(sourceNode) ? null : createBindingSelector()
  const cloneNode = createBindingsTag(sourceNode, bindingsSelector)
  const tagOpeningHTML = nodeToString(cloneNode)

  switch(true) {
  // EACH bindings have prio 1
  case hasEachAttribute(cloneNode):
    return [tagOpeningHTML, [eachBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // IF bindings have prio 2
  case hasIfAttribute(cloneNode):
    return [tagOpeningHTML, [ifBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // TAG bindings have prio 3
  case isCustomNode(cloneNode):
    return [tagOpeningHTML, [tagBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  // this node has expressions bound to it
  default:
    return [tagOpeningHTML, [simpleBinding(cloneNode, bindingsSelector, sourceFile, sourceCode)]]
  }
}
function createTagWithBindings ( sourceNode , sourceFile , sourceCode ) { const bindingsSelector = isRootNode ( sourceNode ) ? null : createBindingSelector ( ) const cloneNode = createBindingsTag ( sourceNode , bindingsSelector ) const tagOpeningHTML = nodeToString ( cloneNode ) switch ( true ) { // EACH bindings have prio 1 case hasEachAttribute ( cloneNode ) : return [ tagOpeningHTML , [ eachBinding ( cloneNode , bindingsSelector , sourceFile , sourceCode ) ] ] // IF bindings have prio 2 case hasIfAttribute ( cloneNode ) : return [ tagOpeningHTML , [ ifBinding ( cloneNode , bindingsSelector , sourceFile , sourceCode ) ] ] // TAG bindings have prio 3 case isCustomNode ( cloneNode ) : return [ tagOpeningHTML , [ tagBinding ( cloneNode , bindingsSelector , sourceFile , sourceCode ) ] ] // this node has expressions bound to it default : return [ tagOpeningHTML , [ simpleBinding ( cloneNode , bindingsSelector , sourceFile , sourceCode ) ] ] } }
Create only a dynamic tag node with generating a custom selector and its bindings
@param   {RiotParser.Node} sourceNode - any kind of node parsed via riot parser
@param   {stiring} sourceFile - source file path
@param   {string} sourceCode - original source
@param   {BuildingState} state - state representing the current building tree state during the recursion
@returns {Array} array containing the html output and bindings for the current node
Create only a dynamic tag node with generating a custom selector and its bindings