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

Null PMC access when matching against grammar G in module M in a rule in Rakudo #1114

Closed
p6rt opened this issue Jul 1, 2009 · 8 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 1, 2009

Migrated from rt.perl.org#67128 (status was 'rejected')

Searchable as RT67128$

@p6rt
Copy link
Author

p6rt commented Jul 1, 2009

From @masak

<masak> rakudo​: module M; grammar G {}; say "foo" ~~ /<M​::G>/
<p6eval> rakudo 5351a3​: OUTPUT«Null PMC access in set_attr_str() [...]
<masak> I know that's not the way to match against a grammar, but --
look, a Null PMC access!
* masak submits a rakuodbug

@p6rt
Copy link
Author

p6rt commented Jun 25, 2010

From @bbkr

on Kiev build​:

[16​:51] <bbkr> rakudo​: module M; grammar G {}; say "foo" ~~ /<M​::G>/
[16​:51] <p6eval> rakudo f34e78​: OUTPUT«===SORRY!===␤regex assertion not
terminated by angle bracket at line 11, near "​::G>/"␤»
[16​:52] <bbkr> std​: module M; grammar G {}; say "foo" ~~ /<M​::G>/
[16​:52] <p6eval> std 31444​: OUTPUT«ok 00​:01 112m␤»

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM

still broken

bbkr​:nom bbkr$ ./perl6 -e 'module M; grammar G {}; say "foo" ~~ /<M​::G>/'
===SORRY!===
regex assertion not terminated by angle bracket at line 1, near "​::G>/"

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

From @moritz

It works now when explicitly calling a rule in that grammar​:

$ ./perl6 -e 'module M; grammar G { token TOP { "foo" }}; say "foo" ~~
/<M​::G​::TOP>/'
=> <foo>
M​::G​::TOP => <foo>

Otherwise it still errors out​:

$ ./perl6 -e 'module M; grammar G { token TOP { "foo" }}; say "foo" ~~
/<M​::G>/'
Method '!cursor_init' not found for invocant of class 'Any'
  in any find_method at src/gen/Metamodel.pm​:143
  in method OTHERGRAMMAR at src/gen/CORE.setting​:8309
  in regex <anon> at -e​:1
  in method ACCEPTS at src/gen/CORE.setting​:8344
  in <anon> at -e​:1
  in block <anon> at -e​:1

@p6rt
Copy link
Author

p6rt commented Jul 15, 2015

From @jnthn

On Fri Mar 30 07​:43​:39 2012, moritz wrote​:

It works now when explicitly calling a rule in that grammar​:

$ ./perl6 -e 'module M; grammar G { token TOP { "foo" }}; say "foo" ~~
/<M​::G​::TOP>/'
=> <foo>
M​::G​::TOP => <foo>

Otherwise it still errors out​:

$ ./perl6 -e 'module M; grammar G { token TOP { "foo" }}; say "foo" ~~
/<M​::G>/'
Method '!cursor_init' not found for invocant of class 'Any'
in any find_method at src/gen/Metamodel.pm​:143
in method OTHERGRAMMAR at src/gen/CORE.setting​:8309
in regex <anon> at -e​:1
in method ACCEPTS at src/gen/CORE.setting​:8344
in <anon> at -e​:1
in block <anon> at -e​:1

Tried to fix this, but then /<SomeGrammar/> should also work, but that turns out to be very fragile/confusing between rules and types. Also no support in S05 for this behavior (or even /<Some​::Grammar​::rule>/) so it needs some lang design input.

@p6rt
Copy link
Author

p6rt commented Sep 24, 2015

From @TimToady

Don't need this, using the Top or other rule name is sufficient.

@p6rt p6rt closed this as completed Sep 24, 2015
@p6rt
Copy link
Author

p6rt commented Sep 24, 2015

@TimToady - Status changed from 'open' to 'rejected'

@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