 { deep_merge, indent, new_attrs, safe } = require './util'
 EVENTS = ['add', 'attr', 'attr:remove', 'text', 'remove', 'close']
 
-new_tag = (builder, name, attrs, children, opts) ->
+
+new_tag = (name, attrs, children, opts) ->
     unless typeof attrs is 'object'
         [opts, children, attrs] = [children, attrs, {}]
     else

            @end()
        @_new_tag parent, name, attrs, self_ending_children_scope, opts

    tag: (args...) =>
        @level--
        tag = @_new_tag.apply this, [this].concat args
        @level++
        tag

    $tag: (args...) =>
        @level--
        tag = @_new_sync_tag.apply this, [this].concat args
        @level++
        tag


        @Tag = @opts.Tag or Tag

    _new_tag: (parent, args...) =>
        new_tag.apply parent, args

    _new_sync_tag: (parent, name, attrs, children, opts) =>
        # sync tag, - same as normal tag, but closes it automaticly
