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
make PGE support {PIR} closures instead of just {{PIR}} #379
Comments
From @chrisdolanAs of parrot rev 32120, PGE only supports the old S05 closure syntax The current S05 says this is legal: This was discussed on perl6.users at: The attached patch allows one to use either single or double curlies In the future, I think we should consider deprecating the extraneous |
From @chrisdolanpge-single-bracket-closure.patchIndex: compilers/pge/PGE/Perl6Regex.pir
===================================================================
--- compilers/pge/PGE/Perl6Regex.pir (revision 32192)
+++ compilers/pge/PGE/Perl6Regex.pir (working copy)
@@ -218,7 +218,7 @@
optable.newtok('term:<commit>', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Cut')
$P0 = get_global 'parse_closure'
- optable.newtok("term:{{", 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
+ optable.newtok("term:{", 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
$P0 = get_global 'parse_action'
optable.newtok("term:{*}", 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
@@ -1077,7 +1077,11 @@
.local string target
.local int pos, len
(mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Closure')
- len = 2
+ len = 1
+ $S0 = substr target, pos, 2
+ if $S0 != "*}" goto init
+ (mob) = parse_action(mob)
+ .return (mob)
init:
$S0 = substr target, pos, 1
if $S0 != "{" goto body
|
From @pmichaudOn Mon, Oct 27, 2008 at 10:24:56PM -0700, Chris Dolan wrote:
Disambiguating the {*} isn't necessary, as the optable already Other comments on the other threads. Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @pmichaudOn Mon, Oct 27, 2008 at 10:24:56PM -0700, Chris Dolan wrote:
In reality, what has to happen here is that encountering a opening /foo { if True { say '{yes}'; } } bar/ Upon encountering the first curly brace we cannot simply scan ahead This is why PGE currently requires at least two braces for open and Beyond that, Parrot and PIR don't currently provide an easy way to Pm |
From @pmichaudRejecting patch for now... will wait for PGE refactors to work on Thanks for submitting a patch! Pm |
@pmichaud - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#60186 (status was 'rejected')
Searchable as RT60186$
The text was updated successfully, but these errors were encountered: