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
invoke multi-level namespace grammars from rules #421
Comments
From @chrisdolanThis code works in Rakudo rev 32970: grammar GrammarOne { token foo { 'foo' }; } But this code does dies: grammar Grammar::A { token foo { 'foo' }; } The attached patch fixes the latter problem. The patch changes the guts.pir | 12 ++---------- |
From @chrisdolangrammar_namespace.patchIndex: languages/perl6/src/builtins/guts.pir
===================================================================
--- languages/perl6/src/builtins/guts.pir (revision 32970)
+++ languages/perl6/src/builtins/guts.pir (working copy)
@@ -352,17 +352,9 @@
.param string name
.local pmc info, grammar
- # Need to make sure it ends up attached to the right
- # namespace.
- info = new 'Hash'
- info['name'] = name
- $P0 = new 'ResizablePMCArray'
- $P0[0] = name
- info['namespace'] = $P0
+ $P0 = split "::", name
+ grammar = newclass $P0
- # Create grammar class..
- grammar = new 'Class', info
-
.return(grammar)
.end
|
From @pmichaudOn Thu Nov 20 19:59:03 2008, chris@chrisdolan.net wrote:
Patch rejected, as neither 'foobar' ~~ GrammarTwo::foobar nor 'foobar' ~~ Grammar::B::foobar are correct syntax for invoking a regex inside of a grammar. We don't Rakudo implements the first syntax from an earlier synopsis spec that So, I'm converting this ticket to indicate a "todo" of remove the Thanks! Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @chrisdolanOn Tue Nov 25 13:37:09 2008, pmichaud wrote:
I appreciate the feedback, and you're right, but I believe your comment So, let me rephrase, with apologies for the distraction: Without my patch, the first of the following succeeds but the second grammar GrammarOne { token foo { 'foo' }; } grammar Grammar::Deep { token foo { 'foo' }; } So, the feature enabled by this patch is the <Grammar::Deep::foo> |
From @jnthnOn Sat Nov 29 08:34:39 2008, chrisdolan wrote:
Yup, this patch is needed, so applied in r34045.
'foobar' ~~ GrammarShallow isn't spec'd as doing this (we have a ticket Thanks! Jonathan |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#60716 (status was 'resolved')
Searchable as RT60716$
The text was updated successfully, but these errors were encountered: