Source

pynie / src / classes / pyniedict.pir

Full commit
allisonrandal 7634b13 






















































.sub '' :anon :init :load
    $P0 = subclass 'Hash', [ 'dict' ]

#    $P1 = get_global [ 'type' ], 'wrap_class'
#    $P1('dict', $P0)

#    $P2 = get_class 'Hash'
#    $P1 = getinterp
#    $P1.'hll_map'($P2, $P0)
.end

.namespace [ 'dict' ]

.sub 'get_string' :vtable
    .local pmc iterator
    .local string result

    iterator = iter self

    result = '{'
    unless iterator goto done

    # first element separately, to handle commas properly
    $S0 = shift iterator
    $P0 = self[$S0]
    $S1 = 'repr'($S0)
    result .= $S1
    result .= ': '
    $S1 = 'repr'($P0)
    result .= $S1

loop:
    unless iterator goto done
    result .= ', '

    $S0 = shift iterator
    $P0 = self[$S0]
    $S1 = 'repr'($S0)
    result .= $S1
    result .= ':'
    $S1 = 'repr'($P0)
    result .= $S1
    goto loop

done:
    result .= '}'
    .return (result)
.end


# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: