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 "use vstring" for v < 5 or v > 6 an error. #3622
Labels
Comments
From x.fix@o2.plsrc/Perl6/Grammar.nqp | 32 +++++++++++++++++++++++--------- Inline Patchdiff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp
index 2000376..69bef42 100644
--- a/src/Perl6/Grammar.nqp
+++ b/src/Perl6/Grammar.nqp
@@ -1576,15 +1576,29 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
$<doc>=[ 'DOC' \h+ ]**0..1
<sym> <.ws>
[
- | <version> [ <?{ ~$<version><vnum>[0] eq '5' }> {
- my $module := $*W.load_module($/, 'Perl5', {}, $*GLOBALish);
- do_import($/, $module, 'Perl5');
- $/.CURSOR.import_EXPORTHOW($/, $module);
- } ]?
- [ <?{ ~$<version><vnum>[0] eq '6' }> {
- $*MAIN := 'MAIN';
- $*STRICT := 1 if $*begin_compunit;
- } ]?
+ | <version> [
+ || <?{ $<version><vnum>[0] == 5 }> {
+ my $module := $*W.load_module($/, 'Perl5', {}, $*GLOBALish);
+ do_import($/, $module, 'Perl5');
+ $/.CURSOR.import_EXPORTHOW($/, $module);
+ }
+ || <?{ $<version><vnum>[0] == 6 }> {
+ my $version_parts := $<version><vnum>;
+ my $tokens := +$version_parts;
+ my $position := 1;
+ while $position < $tokens {
+ if $version_parts[$position] != 0 {
+ $/.CURSOR.typed_panic: 'X::Language::Unsupported', version => ~$<version>;
+ }
+ $position++;
+ }
+ $*MAIN := 'MAIN';
+ $*STRICT := 1 if $*begin_compunit;
+ }
+ || {
+ $/.CURSOR.typed_panic: 'X::Language::Unsupported', version => ~$<version>;
+ }
+ ]
| <module_name>
{
$longname := $<module_name><longname>;
diff --git a/src/core/Exception.pm b/src/core/Exception.pm
index 1bc3739..4b26419 100644
--- a/src/core/Exception.pm
+++ b/src/core/Exception.pm
@@ -1614,4 +1614,11 @@ my class X::EXPORTHOW::Conflict does X::Comp {
}
}
+my class X::Language::Unsupported is Exception {
+ has $.version;
+ method message() {
+ "No compiler available for Perl $.version"
+ }
+}
+
# vim: ft=perl6 expandtab sw=4
--
2.2.1 |
From @ninerPatch updated and committed as rakudo/rakudo@9c1afaf3ab Thanks for the help! |
The RT System itself - Status changed from 'new' to 'open' |
@niner - Status changed from 'open' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#123496 (status was 'resolved')
Searchable as RT123496$
The text was updated successfully, but these errors were encountered: