Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misleading grammar error output when referring to a missing rule with a similarly named sub-rule #6473

Open
p6rt opened this issue Aug 27, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 27, 2017

Migrated from rt.perl.org#131972 (status was 'new')

Searchable as RT131972$

@p6rt
Copy link
Author

p6rt commented Aug 27, 2017

From @lefth

Version​: Rakudo version 2017.08-14-gf097e551b built on MoarVM version
2017.08.1-32-gcd41322e
implementing Perl 6.c.

When running the attached script, the error output should be​:
No such method 'hash' for invocant of type 'Matcher'

Instead, the error given is​:
P6opaque​: no such attribute '$!pos' in type Match when trying to get a value

Test case​:

grammar Matcher {
  rule TOP { <hash> }
  proto rule atom {*}
  rule atom​:sym<hash> { . }
}
Matcher.parse('x'); # Generates the wrong error.
'x' ~~ /<Matcher​::TOP>/; # Generates the same error as above.
'x' ~~ /<Matcher​::hash>/; # Generates the right error.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant