Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow p5 code to switch back to p6

  • Loading branch information...
commit 2f65afc62d9acef2fa0eb32d2a573ed53131e3a8 1 parent 36c6322
@TimToady TimToady authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 STD_P5.pm6
View
17 STD_P5.pm6
@@ -473,8 +473,21 @@ rule p5statement_control:use {
:my $*SCOPE = 'use';
<sym>
[
- | <version=p5versionish>
- | <module_name=p5module_name>
+ || <version=p5versionish> [
+ || <?{ substr($<version>[0].Str,0,2) eq 'v5' }>
+ || <?{ substr($<version>[0].Str,0,2) eq 'v6' }>
+ :my %*LANG;
+ {
+ %*LANG<MAIN> = ::STD::P6 ;
+ %*LANG<Regex> = ::STD::Regex ;
+ %*LANG<Q> = ::STD::Q ;
+ %*LANG<Trans> = ::STD::Trans ;
+ $¢ = %*LANG<MAIN>.bless($¢);
+ }
+ <.ws> ';'
+ [ <statementlist> || <.panic: "Bad P6 code"> ]
+ ]
+ || <module_name=p5module_name>
{
$longname = $<module_name><longname>;
}
Please sign in to comment.
Something went wrong with that request. Please try again.