Skip to content

Instantly share code, notes, and snippets.

@bacek
Created June 19, 2010 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bacek/445309 to your computer and use it in GitHub Desktop.
Save bacek/445309 to your computer and use it in GitHub Desktop.
diff --git a/src/NQP/Actions.pm b/src/NQP/Actions.pm
index a37f9c1..689273e 100644
--- a/src/NQP/Actions.pm
+++ b/src/NQP/Actions.pm
@@ -616,7 +616,7 @@ method term:sym<self>($/) {
method term:sym<identifier>($/) {
my $past := $<args>.ast;
- $past.name(~$<identifier>);
+ $past.name(~$<deflongname>);
make $past;
}
diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm
index ecc6911..576bb6b 100644
--- a/src/NQP/Grammar.pm
+++ b/src/NQP/Grammar.pm
@@ -377,7 +377,7 @@ proto token term { <...> }
token term:sym<self> { <sym> » }
token term:sym<identifier> {
- <identifier> <?[(]> <args>
+ <deflongname> <?[(]> <args>
}
token term:sym<name> {
diff --git a/t/nqp/11-sub.t b/t/nqp/11-sub.t
index 868daf0..8c5a38b 100644
--- a/t/nqp/11-sub.t
+++ b/t/nqp/11-sub.t
@@ -2,7 +2,7 @@
# check subs
-say('1..13');
+say('1..14');
sub one ( ) {
say("ok 1 # sub def and call");
@@ -85,3 +85,6 @@ sub &twelve() {
sub Qstuff() { 13 };
say('ok ', Qstuff());
+
+sub term:sym<self>() { 14 }
+say('ok ', term:sym<self>());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment