NAME
Zuzu::Tidy - format ZuzuScript source with consistent style
SYNOPSIS
use Zuzu::Tidy;
my $tidied = Zuzu::Tidy->tidy( $source, filename => 'main.zzs' );
my $canonical = Zuzu::Tidy->tidy(
$source,
filename => 'main.zzs',
canonical_operators => 1,
);
DESCRIPTION
Zuzu::Tidy rewrites ZuzuScript text into a consistent house style. It tokenizes with Zuzu::Lexer and validates syntax with Zuzu::Parser before rewriting. Pod sections are passed through unchanged.
The tidier applies indentation, brace placement, operator spacing, parenthesis/bracket spacing, and adds trailing statement semicolons when needed.
METHODS
tidy
Returns tidied source text as a single UTF-8 string.
Pass canonical_operators => 1 to rewrite non-canonical operator spellings such as * and |> to canonical forms such as × and ▷. This option is disabled by default.
SEE ALSO
Zuzu::Lexer, Zuzu::Parser, Zuzu::Tidy::CLI.
COPYRIGHT AND LICENCE
Zuzu::Tidy 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.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1362:
Non-ASCII character seen before =encoding in 'C<×>'. Assuming UTF-8