|
|-----------------------------------|
| ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |~~
$comments,
===================================
.
write STDOUT;
in Perl 6 we
har><1,$width>) /;
# Squeeze the resultant substring...
(my $result = $1) ~~ s:each/ <$ws> | \v+ /\c[SPACE]/;
# Check for any more data still to come...
r:
sub expurgate (Str *@hidewords) {
return sub (Str $data is rw) {
$data ~~ s:ei/(@hidewords)/$( 'X' x length $1 )/;
return $data;
}
}
We could then
=item * C<=~> becomes the "smart match" operator C<~~>, with a whole new set
of semantics. Anywhere you used C<=~> before you now use C<~~>, but C<~~> is
much more general now. See L<Synopsis 4> for
<=~> >> macro which always fails at
compile time with a message directing the user either to use C<~~> or C<~=> instead,
or to put a space between if they really wanted to assign a stringified value.)
smartmatches the
endpoints in the domain of the object being matched, so C<< 1.5 ~~
1^..^2 >> is true. (But C<< 2.1 ~~ 1..2 >> is false.)
=item * The unary C<^> operator generates a range from C<0>
"This should never happen"}
default {
my @index = split('',$didget);
@index = grep {$_ ~~ /^<[A..Za..z0..9+\/=]>+$/},@index;
[~] map {chr ($_)}, decode(@index)}
}
}
# 1716151
hc --version`;
%attrs<pugs_revision> = %?CONFIG<pugs_revision>;
%attrs<uname> = chomp `uname -a`;
# Obscure hostname for privacy
%attrs<uname> ~~ s/<after \s+> (\S+)/HOSTOBSCURED/;
say %attrs.yaml;
my $src = "";
while $_ = =<> {$src ~= $_;}
my $m = $src ~~ rx/oo/;
say "(mapcar 'delete-overlay (overlays-in (point-min) (point-max)))";
say "(overlay-put (make-overlay {$m.from +1} {$m.to +1} nil
ep (MatchTest $test ; *@values --> Lazy ) {
gather {
for @values -> $x {
take $x if $x ~~ $test;
}
}
}
# copied from S29draft.pod 8651.
multi List::join (Str $delimiter ; *@values
IL::Util::Pad $.parent;
has Str @.names;
method lookup_pad($name) {
if (grep { $_ ~~ $name }, @.names) {
self;
}
else {
$.parent ?? $.parent.lo
Pipe::open("$PIL $optional_args $tempfilename");
my $pilresult = $pilfh.readline();
$pilresult ~~ s:P5/\r//;
$pilfh.close();
unlink($tempfilename);
return $pilresult;
}
$Test::Pil::Descript
d y $& ab
a(?{"{"}})b - c - Unmatched right curly bracket
a(?{$bl="\{"}).b caxbd y $bl {
x(~~)*(?:(?:F)?)? x~~ y - -
^a(?#xxx){3}c aaac y $& aaac
'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
(?<![cd])b d
% 26];
@.table[@lower[$_]] = @lower[($_ + $shift) % 26];
}
}
if $mode ~~ m:P5:i/^de/ {
my @tt;
for @.table.kv { @tt[$^value] = $^key }
@.table = @t
$dir;
for $dir.readdir.sort:{numerically} -> $fn {
my ($pugsrev, $parserrev) = $fn ~~ /(\d+)-(\d+)/ err next;
next if $XXX_handwaving($pugsrev, $parserrev); # against %?CONFI
$ret;
}
my @pil2 = =<>;
my $pil2 = @pil2.join('');
# my $pil2 = =<>.slurp; ???
my @b = $pil2 ~~ $tokens;
# say "Tokens: ", @b.join('><');
my $ast = parse( << { >>, 'hash', << } >>, @b );
say $as
my Automata::Cellular $ca .= new(:@state, :$rule, :$steps, :$display_width);
is($ca ~~ ::Automata::Cellular, Bool::True, '$ca object instantiated');
is($ca.stage, 1,
;
#my $pil2 = @pil2.join('');
# slurp stdin - xinming++
my $pil2 = ** $*IN.slurp;
my @b = $pil2 ~~ $tokens;
# say "Tokens: ", @b.join('><');
my $ast = parse( << { >>, 'hash', << } >>, @b );
# say $
WTemplate
=cut
#use_ok('WTemplate');
skip_rest "unreliable test results"; exit;
if eval('!("a" ~~ /a/)') { skip_rest "skipped tests - rules support appears to be missing"; exit }
my $template;
my
rules, Captures are superclasses of Match. So in the example of:
my $rv = ("x-y-z-moose" ~~ /(.)-(.)-(.)-<animal> :{ return give_birth(|$/) })
C<give_birth()> gets called with 'x', 'y', and
les);
}
sub fill_with($template: %variables?) is export {
my $return = $template;
$return ~~ s:g! <elem> | <block> !{ run_widget($/, %variables) }!;
return $return;
}
## some basic widge
Kiss;
=cut
my $RAND = Math::Random::Kiss.new();
ok($RAND, 'new() Math::Random::Kiss');
ok($RAND ~~ Rand, 'Math::Random::Kiss does Rand');
ok($RAND.rand() >= 0, 'rand() returns numbers greater than
l elements
given $x { ... } # $x is now topic for block
when EXPR { ... } # perform $_ ~~ EXPR execute block and break
default { ... } # same as when true { ... }
=head2 Closur
in32 mingw msys cygwin> {
$redir_pre = ">";
$redir_post = "";
};
my $file = $?FILE;
$file ~~ s:P5/output.t/script.pl/;
my $cmd = "$*EXECUTABLE_NAME $file $redir_pre $out_fn $redir_post";
%*EN