TITLE
yaml_dumper.pir - PIR version of a YAML dumper, ala Data::Dumper
VERSION
version 0.1
SYNOPSIS
... # dump the P0 register yaml( P0 ) # dump the P0 register, with "name" yaml( P0, "name" ) ... END .include "library/yaml_dumper.pir"
DESCRIPTION
PIR implementation of Perl 5's Data::Dumper module to dump YAML format.
FUNCTIONS
This library provides the following functions:
- yaml( pmc, ?name, ?indent] ) This is the public (non object) interface to the yaml dumper library.
- pmc Required. The PMC to dump.
- name Optional. The name of the PMC.
- indent Optional. The indent used at the start of each line printed.
- _register_dumper( id, sub ) Registers a dumper for new PMC type. EXCEPTION_UNIMPLEMENTED But see method __dump below.
- id the PMC id, as returned by the
- sub a Sub pmc, that gets called in order to dump the content of the given PMC
- __dump(pmc yaml, str label) method If a method
- yaml =_global_dumper() (internal) Internal helper function.Returns the global dumper instance used by the non object interface.
print
.Note: #2 Hash keys are now sorted using _sort()
(library/sort.pir)
typeof
op.
sub = find_name "_dump_PerlArray" _register_dumper( .PerlArray, sub )This function returns nothing.
__dump
exists in the namespace of the class, it will be called with the current dumper object and the label of the PMC.
AUTHOR
Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.
COPYRIGHT
Copyright (C) 2004-2008, Parrot Foundation.