Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash on dotless version literals given to use
  • Loading branch information
zoffixznet committed Jun 24, 2017
1 parent 2a88c20 commit fe7ea12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Perl6/Grammar.nqp
Expand Up @@ -1589,13 +1589,16 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
$<doc>=[ 'DOC' \h+ ]**0..1
<sym> <.ws>
[
| <version> [
|| <?{ $<version><vnum>[0] == 5 }> {
| <version> {} # <-- update $/ so we can grab $<version>
# we parse out the numeral, since we could have "6c"
:my $version := nqp::radix(10,$<version><vnum>[0],0,0)[0];
[
|| <?{ $version == 5 }> {
my $module := $*W.load_module($/, 'Perl5', {}, $*GLOBALish);
$*W.do_import($/, $module, 'Perl5');
$*W.import_EXPORTHOW($/, $module);
}
|| <?{ $<version><vnum>[0] == 6 }> {
|| <?{ $version == 6 }> {
my $version_parts := $<version><vnum>;
my $vwant := $<version>.ast.compile_time_value;
my $comp := nqp::getcomp('perl6');
Expand Down

0 comments on commit fe7ea12

Please sign in to comment.