use v6-alpha;
use Rosetta::Shell;
my Str @cmd_line_args = @*ARGS.grep:{ $_ ~~ m/^<[a-zA-Z:_]>+$/ };
my ($engine_name, @user_lang_prefs) = @cmd_line_args;
$engine_name //= 'Rosetta::Engine::Example'
{ }
method parse (Str $str is copy) {
my $request_line;
if ($str ~~ s/^(.*)\n//) {
$request_line = $0;
} else {
$request_line = $str;
$str = "";
}
my $self = self.SUPER::parse($str);
given ($self) {
my ($method, $uri, $protocol) = $request_line.split(' ');
.meth
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");
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';
use v6-alpha;
say "1..1";
my $str = 'abcbcaddd';
$str ~~ s:P5:g/bc/oz/;
if $str eq 'aozozaddd' { say "ok 1" } else { say "not ok 1" }
1;
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;
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
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
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
= %*ENV<QUERY_STRING> // %*ENV<REDIRECT_QUERY_STRING>;
if ($.query_string ~~ /<[;&=]>/) {
$.query.parse_params($.query_string);
} else {
resents a
# meta-circularity issue, and it
# loops endlessly
unless $self ~~ ::Class;
return bool::false;
});
## I ended here ... to be continued
::Class.HOW.add_method
er .= chomp;
},
string => -> ($str) { $buffer ~= $str }
);
my $file = $?FILE;
$file ~~ s:P5/basic.t/sample.kwid/;
lives_ok {
parse($file, %events);
}, '... we parsed the sample fil
for %StatusCode.kv -> $code, $message is copy {
$message .= uc;
$message ~~ s:g/<[ \-]>/_/;
&HTTP::Status::("RC_" ~ $message) := sub () { $code };
&H
( Str $iso8601 ) returns Duration::Gregorian is export {
# FIXME - missing XXXX
$iso8601 ~~ $iso8601_duration_re_anchored
or die "can't match '$iso8601' to available ISO-8601 duratio
uoted string
\, | \= | \{ | \( | \[ | \} | \) | \] | \w+
)
};
my @b = $pil2 ~~ $tokens;
my $tabs = 1;
my $tab = ' ';
for @b {
if $_ eq ',' {
print $_, "\n", $tab
item) returns Str {
my $str_item = ~$item;
$str_item ~= $item.WHICH()
if $str_item ~~ rx:perl5/^\<obj\:/; #/#cperl-mode--
return $str_item;
}
method insert($self: *@items) returns
b *infix:<~~> (Set $one, $member) returns Bool {
$one.includes($member);
}
# XXX -- IIRC, there's a "is commutative" or such, so duplicating shouldn't be
# necessary.
multi sub *infix:<~~> ($membe
use v6-alpha;
#package PIL2;
my $debug_traverse = 0;
# tokenizer
sub tokenize ( $s ) {
$s ~~ m:g:perl5 {(\"(?:\\\\|\\"|.)*?\"|[\:\,\=\{\(\[\}\)\]]|\w+)}; #"
}
# JSON parser - creates an A
$var_name, $var_value {
my Str $var_value_as_str = $var_value // $EMPTY_STR;
$text ~~ s:g/\<$var_name\>/$var_value_as_str/;
}
return $text;
}
################################
ch
Number The numeric value of the matched string (i.e. given
"foo123bar"~~/\d+/, then $/ in numeric context will be 123)
Boolean True if success, false otherwise
=h
mit> and <cut> (see below).
=head2 Modifiers
Used as adverbial modifiers:
"foO bar" ~~ m:s:ignorecase:g/[o | r] ./
and can appear within rules
sub rule { <foo> [:i <ba