NAME
Catmandu::Fix::Parser - the parser of the Catmandu::Fix language
SYNOPSIS
use
Catmandu::Sane;
use
Catmandu::Fix;
use
Data::Dumper;
my
$parser
= Catmandu::Fix::Parser->new;
my
$fixes
;
try
{
$fixes
=
$parser
->parse(
<<EOF);
add_field(test,123)
EOF
}
catch
{
printf
"[%s]\nscript:\n%s\nerror: %s\n"
,
ref
(
$_
)
,
$_
->source
,
$_
->message;
};
my
$fixer
= Catmandu::Fix->new(
fixes
=>
$fixes
);
Dumper(
$fixer
->fix({}));
DESCRIPTION
Programmers are discouraged to use the Catmandu::Parser directly in code but use the Catmandu package that provides the same functionality:
use
Catmandu;
my
$fixer
= Catmandu->fixer(
<<EOF);
add_field(test,123)
EOF
Dumper(
$fixer
->fix({}));
METHODS
new()
Create a new Catmandu::Fix parser
parse($string)
Reads a string and returns a blessed object with parsed Catmandu::Fixes. Throws an Catmandu::ParseError on failure.
SEE ALSO
Or consult the webpages below for more information on the Catmandu::Fix language
http://librecat.org/Catmandu/#fixes http://librecat.org/Catmandu/#fix-language