Alt-Math-Prime-FastSieve-Inline
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
8081828384858687888990919293949596979899#==============================================================================
sub
import
{
my
$class
=
shift
;
$class
->import_heavy(
@_
);
}
sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
croak M02_usage();
}
$CONFIG
{
$pkg
}{template} ||=
$default_config
;
inc/Inline/C.pm view on Meta::CPAN
387388389390391392393394395396397398399400401402403404405406407sub
parse {
my
$o
=
shift
;
return
if
$o
->{ILSM}{parser};
return
if
$o
->{ILSM}{XSMODE};
my
$parser
=
$o
->{ILSM}{parser} =
$o
->get_parser;
$parser
->{data}{typeconv} =
$o
->{ILSM}{typeconv};
$parser
->{data}{AUTOWRAP} =
$o
->{ILSM}{AUTOWRAP};
Inline::Struct::parse(
$o
)
if
$o
->{STRUCT}{
'.any'
};
$parser
->code(
$o
->{ILSM}{code})
or croak
<<END;
Bad $o->{API}{language} code passed to Inline at @{[caller(2)]}
END
}
# Create and initialize a parser
sub
get_parser {
my
$o
=
shift
;
Inline::C::_parser_test(
$o
->{CONFIG}{DIRECTORY},
"Inline::C::get_parser called\n"
)
if
$o
->{CONFIG}{_TESTING};
Inline::C::Parser::RecDescent::get_parser(
$o
);
inc/Inline/denter.pm view on Meta::CPAN
151617181920212223242526272829303132333435# Prevent a taint exception being thrown by AutoLoader.pm.
# Serves no other purpose.
sub
DESTROY {
}
sub
undent {
local
$/ =
"\n"
;
my
(
$o
,
$text
) =
@_
;
my
(
$comma
) =
$o
->{comma};
my
$package
=
caller
;
$package
=
caller
(1)
if
$package
eq
'Inline::denter'
;
%{
$o
->{xref}} = ();
@{
$o
->{objects}} = ();
@{
$o
->{context}} = ();
my
$glob
=
''
;
chomp
$text
;
@{
$o
->{lines}} =
split
$/,
$text
;
$o
->{level} = 0;
$o
->{line} ||= 1;
$o
->_setup_line;
while
(not
$o
->{done}) {
inc/Inline/denter.pm view on Meta::CPAN
201202203204205206207208209210211212213214215216217218219220221
croak
$o
->M01_invalid_indent_width
unless
/^(( {
$width
})*)(\S.*)$/;
$o
->{level} =
length
($1) /
$width
;
$o
->{content} = $3;
last
;
}
}
sub
indent {
my
$o
=
shift
;
my
$package
=
caller
;
$package
=
caller
(1)
if
$package
eq
'Inline::denter'
;
my
$stream
=
''
;
$o
->{key} =
''
;
while
(
@_
) {
local
$_
=
shift
;
$stream
.=
$o
->indent_name(
$_
,
shift
),
next
if
(/^\
*$package
\::\w+$/);
$stream
.=
$o
->indent_data(
$_
);
}
return
$stream
;
}
( run in 0.256 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )