Skip to content

Commit

Permalink
Add some tests for SubCall, with a TODO:
Browse files Browse the repository at this point in the history
While fixing up tests, I found that we don't tell the difference between
Ident used for classes and ones used for subroutine names.

They're mostly similar, but the following is different:

1. Foo::->bar()  # method call, works
2. Foo->bar()    # same, ambiguous to perl, but not to guacamole
3. Foo::bar()    # Function call, Foo class, bar function name
4. Foo::bar::()  # Error!

But because we use Ident for all of these, #1 and #4 are getting confused.

We can fix it. It's not a top priority.
  • Loading branch information
xsawyerx committed May 27, 2020
1 parent 4938250 commit 804e7a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions marpa/t/Statements/Expressions/Value/NonLiteral/SubCall.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use strict;
use warnings;
use Guacamole::Test;
use Test::More;

parses('a()');
parses('a::b()');

TODO: {
local $TODO = 'We don\'t yet separate between Idents for SubCall and classes';
parsent('a::()');
}

done_testing();

0 comments on commit 804e7a6

Please sign in to comment.