The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Sah::Compiler::TextResultRole - Role for compilers that produce text result (array of lines)

VERSION

version 0.09

ATTRIBUTES

indent_character => STR

METHODS

$c->line($cd, @arg)

Append a line to $cd->{result}. Will use $cd->{indent_level} to indent the line. Used by compiler; users normally do not need this. Example:

 $c->line($cd, 'this is a line', ' of ', 'code');

When $cd->{indent_level} is 2 and $cd->{args}{indent_width} is 2, this line will be added with 4-spaces indent:

 this is a line of code

$c->inc_indent($cd)

Increase indent level. This is done by increasing $cd->{indent_level} by 1.

$c->dec_indent($cd)

Decrease indent level. This is done by decreasing $cd->{indent_level} by 1.

$c->indent_str($cd)

Shortcut for $c->indent_character x $cd->{indent_level}.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.