<!-- Wigwam
    Options:
     plugins=DirectiveSet;
-->
<< Wigwam
    Options:
     plugins=DirectiveSet;
>>

[!!

#EXIT %<
    EXPR #expr {
        #parameters < varname varshow struct fold cur_depth >
        " (" &Style.inactive(struct`ref) ")"
        !!>
            <Div id="list_[!! UNIQUE '_' #id_safe varname !!]" style="[!!
                #ifelse fold "display:none" !!>display:url([!! IMG_EXPANDED !!])<!!
            !!]">
        <!~
        #indent #add 9 cur_depth { struct`html }
        !!>
            </Div>
        <!~
    }

    GLOB #expr {
        #parameters < varname varshow struct fold cur_depth >
        #if struct`blessed { " (" &Style.inactive(struct`ref) ") " }
    }
    HASH #expr {
        #parameters < varname varshow struct fold cur_depth >
        #if struct`blessed { " (" &Style.inactive(struct`ref) ") " }
        #given struct`size {
            #when 0  { ' has no pairs ' &Style.inactive "(empty)" }
            #when 1  { ' has ' :given ' pair: ' }
            #default { ' has ' :given ' pairs: ' }
        }
    }
    ARRAY #expr {
        #parameters < varname varshow struct fold cur_depth >
        #if struct`blessed { " (" &Style.inactive(struct`ref) ")" }
        #given struct`size {
            #when 0 { ' has no elements ' &Style.inactive "(empty)" }
            #when 1 { ' has ' :given ' element: ' }
            #default { ' has ' :given ' elements: ' }
        }
    }
    REF #expr {
        #parameters < varname varshow struct fold cur_depth >
        #if struct`blessed { " (" &Style.inactive(struct`ref) ") " }
    }
    STRING *Scalar
    SCALAR #expr {
        GenericRef
        Scalar
    }
    CODE #expr &GenericRef :args
    IO   #expr &GenericRef :args
>

##INIT {
    #module 'Core/Html'
    #module 'Core/Debug/Data'
    #parameters < Style UNIQUE IMG_EXPANDED IMG_COLLAPSED >
    #macro Scalar {
        #parameters < varname varshow struct fold cur_depth reference >
        #if !struct`defined
            { &Style.inactive " is undefined" }
        #elsif #gt struct`length 100
            &Scalar_Hide :args
        #elsif struct`length
             { " = " &Style.literal(struct) }
        #else
             { &Style.inactive " is empty" }
    }

    #macro Scalar_Hide {
        #parameters < varname varshow struct fold cur_depth reference >
        !!>
            <Div id="list_[!!
                UNIQUE '_' #id_safe varname '"'
                #if fold 'style="display:none"'
            !!]>
              [!! &Style.literal(struct) !!]
            </Div>
        <!~
    }
    #macro GenericRef {
        #parameters < varname varshow struct fold cur_depth reference >
        " (" &Style.inactive(struct`refinfo) ")"
    }
}

!!]