$?OS eq 'os2' );
&readlink := { undef } if $dosish;
unless ( ( $script ~~ m:P5 [/] || ( $dosish && $script ~~ m:P5 [\\] ) )
&& -f $script )
{
for File::Spec.path(
ber<30>);
is($rule ~~ ::Automata::Cellular::Rule, Bool::True, '$rule object instantiated');
is($rule.rule_number(), 30, '$rule rule_number set correctly');
is($rule.rule ~~ Hash, 1, '$rule.rule
ormat first.
if $path ~~ s/ \{ (\w+) \} $// {
$.mode = ~$0;
}
else {
$.mode = 'view';
}
if $path ~~ s/ \. (\w+) $// {
ailing slash, if any.
$path ~~ s:g{^/|/$}{};
# A leading [NUM] with no name indicates the root revision to use.
if $path ~~ s{^ \[ (\d+) \] /?}{} {
f the path
if $path {
for split '/', $path -> $comp {
$comp ~~ /^ (\w+) [ \[ (\d+) \] ]? $/
or WWW::Kontent::error("Invalid component '$comp'",
agepath.format}.new()
unless $.renderer;
$output=$.renderer.render($r);
#};
if $! ~~ /^\[restart\]/ {
if $depth < 8 {
$r.go($depth+1);
}
else {
$.status = 504;
$.
ext/plain';
return "Error: restart limit exceeded--possible restart loop";
}
}
elsif $! ~~ /^\[(\d\d\d)\] (.*)/ {
$.status = $0;
$.type = 'text/plain';
return "Error: $1";
}
ursor.parent;
}
}
}
my $pathobj=WWW::Kontent::Path.new().parse($path);
if $path ~~ m{^/} {
# Full path--just resolve from the root page.
try { $pathobj.resolve($.root, $se
or $rev.attributes.kv -> $k, $v is copy {
$v ~~ s:perl5:g{\\}{\\\\};
$v ~~ s:perl5:g{"}{\\"};
$v ~~ s:perl5:g{\015}{};
$v ~~ s:perl5:g{\n}{\\n};
$v ~~ s:perl5:g{ }{\\t};
say qq( $k: "$v");
ext = $origtext;
say $ERR: "Parsing $origtext.chars() chars of text" if $PROGRESS;
while $text ~~ $parser_regex {
my($chunk, $tag)=(~$0, ~$1);
my $length = "$0$1".chars;
$pos += $length;
chunk.chars() literal chars followed by tag '$tag'" if $PROGRESS;
if $chunk.chars {
$chunk ~~ s:g{\s+}{ };
@stack[-1].add_text($chunk);
}
given $tag {
when "\\\\" {
# nothing
}
if $text.chars {
say $ERR: " $text.chars() literal chars left over" if $PROGRESS;
$text ~~ s:g{\s+}{ };
$base.add_text($text);
}
return $base.children;
}
my sub do_list($skel, $type, $
=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>
|
|-----------------------------------|
| ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |~~
$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
C<when> statement, because:
when $is_sheep { push @sheep, $_ }
is equivalent to:
if $_ ~~ $is_sheep { push @sheep, $_; next }
When C<$is_sheep> is a subroutine reference, that implicit sm
my $context = want;
if $context ~~ List {
my @values = block();
return { *@values };
}
elsif $context ~~ Scalar {
my $value = block();
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
4,5,6));
is($union.WHAT, Set, "set() - union");
my $stringified = $set.stringify;
ok($stringified ~~ rx:perl5/^set\(.*Person.*\)$/, "stringify");
ok($union.equal(set(0..6, $bob)), "set() - equal");
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
int STDERR "# $jsfile\n";
my $cmd = '../../pugs -I . -e \'use Grammar; if slurp("'.$jsfile.'") ~~ /^<JavaScript::ECMAScript3::Grammar::Spec::Program>$/ {say "ok"}else{say "not ok"}\' 2>&1';
pr
les);
}
sub fill_with($template: %variables?) is export {
my $return = $template;
$return ~~ s:g! <elem> | <block> !{ run_widget($/, %variables) }!;
return $return;
}
## some basic widge
hTest $test ; *@values) returns Lazy {
gather {
for @values -> $x {
take $x if $x ~~ $test;
}
}
}
multi sub Array::join (@values, Str $delimiter) returns Str
multi sub P
use v6-alpha;
use Test;
plan 1;
use Text::Glob;
my $regex = Text::Glob.new.glob_to_regex('*.pm');
ok 'Glob.pm' ~~ $regex, 'glob_to_regex works';
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
unction $test ; *@values) returns List {
gather {
for @values -> $x {
take $x if $x ~~ $test;
}
}
}
multi sub join (Str $delimiter ; *@values) returns List {
my $str = ~@v
t';
@INC = '../lib';
# Don't interfere with the taintedness of %ENV, this could perturbate tests
%ENV<PERL_CORE> = 1 unless $*TAINT;
$0 ~~ s/\.dp$//; # for the test.deparse make target
1;
#=Beispielverknüpfungen
$a != $b;
$a ~~ $b; # smart-match, mehr dazu gleich
#=Verknüpfungen in Perl 5:
$a < $b && $b <= $c;
$a > $b && $b >= $c;
#=Perl 6: Verkettung ist möglich:
$a < $b <= $c;