Skip to content

Commit

Permalink
adaptations for building on the new Rakudo master
Browse files Browse the repository at this point in the history
- reordered modules in the Makefile to build in dependency order. makes
  things faster and less confusing.

- removed 'Object' in for loop signature. this should be 'Mu' nowadays, but
  'Mu' in pointy blocks is the default anyway, so no need to say it explicitly.

- added now-mandatory '()' after interpolated method name.

- replaced PIR closure in token with Perl 6 closure.

- removed a parsing ambiguity "$0li" which alpha didn't catch.
  • Loading branch information
Carl Masak committed Apr 9, 2010
1 parent c5fd6a4 commit b26ef27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
12 changes: 7 additions & 5 deletions Makefile
@@ -1,11 +1,13 @@
PERL6=perl6

SOURCES=lib/November/CGI.pm lib/Text/Markup/Wiki/Minimal.pm \
SOURCES=lib/November/URI/Grammar.pm lib/November/URI.pm \
lib/November/CGI.pm lib/Text/Markup/Wiki/Minimal.pm \
lib/Text/Markup/Wiki/MediaWiki.pm lib/Digest.pm \
lib/November/Storage.pm lib/November/Storage/File.pm lib/November/Tags.pm \
lib/November/URI.pm lib/November/URI/Grammar.pm lib/Dispatcher.pm \
lib/Dispatcher/Rule.pm lib/November/Session.pm lib/November/Utils.pm \
lib/November/Config.pm lib/Test/InputOutput.pm lib/Test/CGI.pm \
lib/November/Storage.pm lib/November/Utils.pm \
lib/November/Config.pm lib/November/Storage/File.pm lib/November/Tags.pm \
lib/Dispatcher/Rule.pm lib/Dispatcher.pm \
lib/November/Session.pm lib/November/Utils.pm \
lib/Test/InputOutput.pm lib/Test/CGI.pm \
lib/November/Cache.pm lib/November.pm

PIRS=$(SOURCES:.pm=.pir)
Expand Down
4 changes: 2 additions & 2 deletions lib/Dispatcher/Rule.pm
Expand Up @@ -9,14 +9,14 @@ has Code $.code;

method match (@chunks) {
return False if @chunks != @!pattern;
for @chunks Z @!pattern -> $chunk, Object $rule is copy {
for @chunks Z @!pattern -> $chunk, $rule is copy {

my $param;
if $rule ~~ Pair { ($param, $rule) = $rule.kv }

if ~$chunk ~~ $rule {
if $param {
self."$param" = (~$/ || ~$chunk);
self."$param"() = (~$/ || ~$chunk);
} else {
# RAKUDO: /./ ~~ Regex us false, but /./ ~~ Code is true
@!args.push($/ || $chunk) if $rule ~~ Code | Whatever; # should by Regex | Whatever
Expand Down
8 changes: 1 addition & 7 deletions lib/November/URI/Grammar.pm
Expand Up @@ -5,13 +5,7 @@ grammar November::URI::Grammar {
token authority { <host> [':' <port>]? };
token host { <-[/&?#:]>* };
token port { (\d**1..5)
<?{{ $I0 = match[0]
$I1 = 0
if $I0 > 65535 goto fail
$I1 = 1
fail:
.return ($I1)
}}>
<?{ $0 < 2 ** 16 }>
<!before \d> };
token path { <slash>? [ <chunk> '/'?]* }; # * mb wrong, because that allow '' URI
token slash { '/' };
Expand Down
2 changes: 1 addition & 1 deletion lib/Text/Markup/Wiki/MediaWiki.pm
Expand Up @@ -42,7 +42,7 @@ class Text::Markup::Wiki::MediaWiki {
}

my &strip_prefix = {
.subst(/'<' ('/'?) <[uo]> 'li>'/, { "<$0li>" }, :g)
.subst(/'<' ('/'?) <[uo]> 'li>'/, { '<' ~ $0 ~ 'li>' }, :g)
};

my &surround_with_list = {
Expand Down

0 comments on commit b26ef27

Please sign in to comment.