# New Ticket Created by Geoffrey Broadwell
# Please include the string: [perl #65138]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=65138 >
Rakudo doesn't parse Foo::_foo() properly, while Foo::foo() works fine.
Before patch:
$ ./perl6 -e 'module Foo { sub _foo { say "foo" } }; Foo::_foo()'
Statement not terminated properly at line 1, near "_foo()"
current instr.: 'parrot;PGE;Util;die' pc 129
(runtime/parrot/library/PGE/Util.pir:85)
called from Sub 'parrot;Perl6;Grammar;eat_terminator' pc 86107
(src/gen_grammar.pir:2292)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 84764
(src/gen_grammar.pir:1770)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 82197
(src/gen_grammar.pir:750)
called from Sub 'parrot;Perl6;Grammar;TOP' pc 76936 (src/gen_setting.pir:16404)
called from Sub 'parrot;PCT;HLLCompiler;parse' pc 665
(src/PCT/HLLCompiler.pir:402)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 428
(src/PCT/HLLCompiler.pir:303)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 920
(src/PCT/HLLCompiler.pir:521)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1510
(src/PCT/HLLCompiler.pir:800)
called from Sub 'parrot;Perl6;Compiler;main' pc 23787 (perl6.pir:164)
After patch:
$ ./perl6 -e 'module Foo { sub _foo { say "foo" } }; Foo::_foo()'
foo
The patch is trivial:
diff --git a/src/parser/grammar.pg b/src/parser/grammar.pg
index 50b95e7..9c0b5b2 100644
--- a/src/parser/grammar.pg
+++ b/src/parser/grammar.pg
@@ -815,7 +815,7 @@ token name {
token morename {
'::'
[
- <?before '(' | <alpha> >
+ <?before '(' | <ident> >
[
| <identifier>
| '(' <EXPR> ')'
I was unable to add a test for this, as for some reason I can't checkout
the spectest suite right now ....
-'f