From 0cdd82a21b1300e083964b648e2e599c3f61e768 Mon Sep 17 00:00:00 2001 From: Itsuki Toyota Date: Sun, 14 Jan 2018 20:00:26 +0900 Subject: [PATCH] Make "need" enable to throw an exception when it detects version token Fixes RT#132214: https://rt.perl.org/Public/Bug/Display.html?id=132214 Disallows "need" to accept version token and to interpret content of the token (e.g., "v6") as a module name. This fix avoids the different behavior between "use" and "need-import" approach. For example, if "need" is allowed to interpret "v6" as a module name, "use" invokes pragma but "need-import" approach imports the module. --- src/Perl6/Grammar.nqp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp index 41315db9cc7..5ed69d42c8d 100644 --- a/src/Perl6/Grammar.nqp +++ b/src/Perl6/Grammar.nqp @@ -1574,9 +1574,9 @@ grammar Perl6::Grammar is HLL::Grammar does STD { rule statement_control:sym { [ - | + | <.sorry('In case of using pragma, use "use" instead (e.g., "use v6;", "use v6.c;").')> | - ] +% ',' + ]+ % ',' { for $ { my $lnd := $*W.dissect_longname($_);