CodeGen-Cpppp
view release on metacpan or search on metacpan
lib/CodeGen/Cpppp/Template.pm view on Meta::CPAN
'my sub section { unshift @_, $self; goto $self->can("current_output_section") }',
'my sub template { unshift @_, $self->context; goto $self->context->can("new_template") }',
'my $trim_comma= CodeGen::Cpppp::AntiCharacter->new(qr/,/, qr/\s*/);',
'my $trim_ws= CodeGen::Cpppp::AntiCharacter->new(qr/\s*/);',
);
}
sub _gen_BUILD_method($class, $cpppp_ver, $perl, $src_filename, $src_lineno) {
return
"sub ${class}::BUILD(\$self, \$constructor_parameters=undef) {",
" Scalar::Util::weaken(\$self);",
# Inject all the lexical functions that need to be in scope
$class->_gen_perl_scope_functions($cpppp_ver),
qq{# line $src_lineno "$src_filename"},
$perl,
"}",
}
sub _build_BUILD_method($class, $version, $perl, $src_filename, $src_lineno) {
{
no strict 'refs';
lib/CodeGen/Cpppp/Template.pm view on Meta::CPAN
autocomma => 1,
autostatementline => 1,
(map +($_ => $parse->{$_}||0), qw(
autoindent autocolumn convert_linecomment_to_c89
)),
indent => $parse->{indent},
output => CodeGen::Cpppp::Output->new,
current_output_section => 'private',
%attrs,
}, $class;
Scalar::Util::weaken($self->{context})
if $self->{context};
$self->BUILD(\%attrs);
$self->flush;
}
sub coerce_parameters($class, $params) {
my %ret;
my $parse= $class->_parse_data;
for my $k (keys $parse->{template_parameter}->%*) {
( run in 0.281 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )