 'use strict'
 
 parser = require './parser'
+bindingParser = require 'neft-binding/parser'
 
 {utils, Renderer, assert} = Neft
 
 ATTRIBUTE = 'attribute'
 
 # options
-i = 1
-BINDING_THIS_TO_TARGET_OPTS = 1
+{BINDING_THIS_TO_TARGET_OPTS} = bindingParser
 
 ids = idsKeys = itemsKeys = extensions = queries = null
-
-repeatString = (str, amount) ->
-	r = str
-	for i in [0...amount-1] by 1
-		r += str
-	r
 
 isAnchor = (obj) ->
 	assert obj.type is ATTRIBUTE, "isAnchor: type must be an attribute"

isBinding = (obj) ->
	assert obj.type is ATTRIBUTE, "isBinding: type must be an attribute"

	try
		func = new Function 'console', "'use strict'; return #{obj.value};"
		func.call null
		return false

	true

getByTypeDeep = (elem, type, callback) ->
	if elem.type is type

	else
		r

isPublicBindingId = (id) ->
	id is 'this' or id is 'app' or id is 'view' or ids.hasOwnProperty(id) or id of Renderer

bindingAttributeToString = (obj) ->
	binding = bindingParser.parse obj.value, isPublicBindingId, obj._parserOptions
	args = idsKeys+''
	func = "function(#{args}){return #{binding.hash}}"

	"[#{func}, [#{binding.connections}]]"

stringify =
	function: (elem) ->
