std/dump

Standard Library documentation

Structured value dumper for ZuzuScript.

Module

Name
std/dump
Area
Standard Library
Source
modules/std/dump.zzm

NAME

std/dump - Structured value dumper for ZuzuScript.

SYNOPSIS

  from std/dump import Dumper;

  let text := Dumper.dump(
    { nums: [ 1, 2, 3 ] },
    { pretty: true, sort_keys: true }
  );

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module provides a pure-Zuzu Dumper class which serializes Zuzu values into code-like text.

If a value cannot be realistically dumped (for example a function), Dumper emits a warning and inserts null in that location.

EXPORTS

Classes

  • Dumper

    Pure-Zuzu structured value dumper.

    • Dumper.dump(value, options?)

      Parameters: value is any ZuzuScript value and options is an optional dictionary. Returns: String. Serializes value into code-like text.

COPYRIGHT AND LICENCE

std/dump is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.