         @pretty = opts.pretty ? off
         @level = opts.level ? 0
         @builder = opts.builder # inheritence
-        @pending = [] # no open child tag
         @parent = @builder
         @closed = no
         @writable = true

                @emit event, arguments...
        pipe event for event in EVENTS

        tag.once? 'end', on_end = =>
            if @pending[0] is tag
                if tag.pending.length
                    tag.pending[0].once 'end', on_end
                else
                    @pending.shift()
                    if @closed and @pending.length is 0
                        @end()
            else
                if (i = @pending.indexOf(tag)) is -1
                    throw new Error("this shouldn't happen D:")
                @pending.splice(i, 1)
                if @closed is 'pending'
                    @end()
            return

        @pending.push tag if tag.closed is no
        @emit 'add', this, tag
        @isempty = no
        tag.emit? 'close', tag if tag.closed

    constructor: (@opts = {}) ->
        # values
        @builder = this
        @checkers = {} # all the middlewares that have to approve a new tag
        # states
        @closed = no
        @opened_tags = 0
        # defaults
        @opts.pretty ?= off
        @level = @opts.level ? -1
