Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Implement dotty version of colonpair named methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Jun 20, 2010
1 parent 5142577 commit 78a6c1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NQP/Grammar.pm
Expand Up @@ -360,7 +360,7 @@ rule regex_declarator {

token dotty {
'.'
[ <longname=identifier>
[ <longname=deflongname>
| <?['"]> <quote>
[ <?[(]> || <.panic: "Quoted method name requires parenthesized arguments"> ]
]
Expand Down
7 changes: 6 additions & 1 deletion t/nqp/26-methodops.t
Expand Up @@ -2,7 +2,7 @@

# method ops (just method calls for now)

plan(4);
plan(5);

class Foo {
method blarg() {
Expand All @@ -14,6 +14,10 @@ class Foo {
method blast() {
'ok 4 # string method calls work'
}

method foo:bar<baz>() {
'ok 5 # colonpair named method call work'
}
}

class Bar {
Expand All @@ -33,3 +37,4 @@ say(blarg());
say($foo.blargless);
my $t := 'st';
say($foo."bla$t"());
say($foo.foo:bar<baz>());

0 comments on commit 78a6c1d

Please sign in to comment.