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

        @Tag = Tag
        @tag = new_tag
        @$tag = sync_tag

    end: () =>
        if @pending.length
            @closed = 'pending'
            @pending[0].once 'end', @end
        else
            @emit 'end' if not @closed or @closed is 'pending'
            @closed = yes
        this

    ready: (callback) =>

    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
