Lines Matching full:core
3 # Test the core keywords.
5 # Initially this test file just checked that CORE::foo got correctly
6 # deparsed as CORE::foo, hence the name. It's since been expanded
7 # to fully test both CORE:: versus none, plus that any arguments
16 # for weak: CORE::keyword(..) deparsed as CORE::keyword(..)
17 # for strong: CORE::keyword(..) deparsed as keyword(..)
25 # Note that tests for prefixing feature.pm-enabled keywords with CORE:: when
42 # logic to add CORE::
69 if ($expr =~ 'CORE::do') {
109 (?: (?:CORE::)?state sub \w+;
139 # with infix notation, a keyword is always interpreted as core,
140 # so no need for Deparse to disambiguate with CORE::
141 testit $keyword, "(\$a CORE::$keyword \$b)", $exp;
143 testit $keyword, "(\$a CORE::$keyword \$b)", $exp, 1;
167 for my $core (0,1) { # if true, add CORE:: to keyword being deparsed
173 if $dollar && $do_exp && ($strong && !$lexsub or $core);
178 !$core && $do_exp && $lexsub && $keyword ne 'map';
179 $args = ((!$core && !$strong) || $parens || $lex_parens)
185 ($core && !($do_exp && $strong))
186 ? "CORE::"
188 ? "CORE::" x $core
189 : $do_exp && !$core && !$strong
237 testit dbmopen => 'CORE::dbmopen(%foo, $bar, $baz);';
238 testit dbmclose => 'CORE::dbmclose %foo;';
240 testit delete => 'CORE::delete $h{\'foo\'};', 'delete $h{\'foo\'};';
241 testit delete => 'CORE::delete $h{\'foo\'};', undef, 1;
242 testit delete => 'CORE::delete @h{\'foo\'};', undef, 1;
243 testit delete => 'CORE::delete $h[0];', undef, 1;
244 testit delete => 'CORE::delete @h[0];', undef, 1;
249 testit do => 'CORE::do $a;';
251 testit do => 'CORE::do { 1 }',
253 testit do => 'CORE::do { 1 }',
254 "CORE::do {\n 1\n };", 1;
258 testit each => 'CORE::each %bar;';
259 testit each => 'CORE::each @foo;';
261 testit eof => 'CORE::eof();';
263 testit exists => 'CORE::exists $h{\'foo\'};', 'exists $h{\'foo\'};';
264 testit exists => 'CORE::exists $h{\'foo\'};', undef, 1;
265 testit exists => 'CORE::exists &foo;', undef, 1;
266 testit exists => 'CORE::exists $h[0];', undef, 1;
269 testit exec => 'CORE::exec($foo $bar);';
272 testit glob => 'CORE::glob;', 'CORE::glob($_);';
274 testit glob => 'CORE::glob $a;', 'CORE::glob($a);';
276 testit grep => 'CORE::grep { $a } $b, $c', 'grep({$a;} $b, $c);';
278 testit keys => 'CORE::keys %bar;';
279 testit keys => 'CORE::keys @bar;';
281 testit map => 'CORE::map { $a } $b, $c', 'map({$a;} $b, $c);';
283 testit not => '3 unless CORE::not $a && $b;';
285 testit pop => 'CORE::pop @foo;';
287 testit push => 'CORE::push @foo;', 'CORE::push(@foo);';
288 testit push => 'CORE::push @foo, 1;', 'CORE::push(@foo, 1);';
289 testit push => 'CORE::push @foo, 1, 2;', 'CORE::push(@foo, 1, 2);';
291 testit readline => 'CORE::readline $a . $b;';
293 testit readpipe => 'CORE::readpipe $a + $b;';
295 testit reverse => 'CORE::reverse sort(@foo);';
297 testit shift => 'CORE::shift @foo;';
299 testit splice => q{CORE::splice @foo;}, q{CORE::splice(@foo);};
300 testit splice => q{CORE::splice @foo, 0;}, q{CORE::splice(@foo, 0);};
301 testit splice => q{CORE::splice @foo, 0, 1;}, q{CORE::splice(@foo, 0, 1);};
302 testit splice => q{CORE::splice @foo, 0, 1, 'a';}, q{CORE::splice(@foo, 0, 1, 'a');};
303 testit splice => q{CORE::splice @foo, 0, 1, 'a', 'b';}, q{CORE::splice(@foo, 0, 1, 'a', 'b');};
308 testit split => 'CORE::split;', q{split(' ', $_, 1);};
310 testit split => 'CORE::split $a;', q{split(/$a/u, $_, 1);};
312 testit split => 'CORE::split $a, $b;', q{split(/$a/u, $b, 1);};
314 testit split => 'CORE::split $a, $b, $c;', q{split(/$a/u, $b, $c);};
316 testit sub => 'CORE::sub { $a, $b }',
319 testit system => 'CORE::system($foo $bar);';
321 testit unshift => 'CORE::unshift @foo;', 'CORE::unshift(@foo);';
322 testit unshift => 'CORE::unshift @foo, 1;', 'CORE::unshift(@foo, 1);';
323 testit unshift => 'CORE::unshift @foo, 1, 2;', 'CORE::unshift(@foo, 1, 2);';
325 testit values => 'CORE::values %bar;';
326 testit values => 'CORE::values @foo;';
332 testit dump => '(CORE::dump);';
333 testit dump => '(CORE::dump FOO);';
334 testit goto => '(CORE::goto);', '(goto);';
335 testit goto => '(CORE::goto FOO);', '(goto FOO);';
336 testit last => '(CORE::last);', '(last);';
337 testit last => '(CORE::last FOO);', '(last FOO);';
338 testit next => '(CORE::next);', '(next);';
339 testit next => '(CORE::next FOO);', '(next FOO);';
340 testit redo => '(CORE::redo);', '(redo);';
341 testit redo => '(CORE::redo FOO);', '(redo FOO);';
342 testit redo => '(CORE::redo);', '(redo);';
343 testit redo => '(CORE::redo FOO);', '(redo FOO);';
345 testit return => '(CORE::return);', '(return);';
360 CORE