Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: FROGGS/rakudo
...
head fork: FROGGS/rakudo
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 25 additions and 1 deletion.
  1. +12 −1 src/Perl6/Actions.pm
  2. +13 −0 src/Perl6/Grammar.pm
View
13 src/Perl6/Actions.pm
@@ -356,6 +356,14 @@ class Perl6::Actions is HLL::Actions {
my $id := $/.from ~ "," ~ ~$/.to;
if !$*POD_BLOCKS_SEEN{$id} {
$*POD_BLOCKS.push($child);
+
+ my $type := $<pod_block><type>.Str;
+
+ if !$*POD_BLOCKS_NAMED{$type} {
+ $*POD_BLOCKS_NAMED{$type} := []
+ }
+ $*POD_BLOCKS_NAMED{$type}.push($child);
+
$*POD_BLOCKS_SEEN{$id} := 1;
}
}
@@ -1170,12 +1178,15 @@ class Perl6::Actions is HLL::Actions {
# I don't know what the correct solution is. Disabling the check
# inside double quotes fixes the most common case, but fails to
# catch undeclared variables in double-quoted strings.
- if $sigil ne '&' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
+ if $sigil ne '&' && $twigil ne '=' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
$*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
}
elsif $sigil eq '&' {
$past.viviself(PAST::Var.new(:name('Nil'), :scope('lexical_6model')));
}
+ elsif $twigil eq '=' {
+ $past.viviself(PAST::Var.new(:name('Any'), :scope('lexical_6model')));
+ }
# Expect variable to have been declared somewhere.
# Locate descriptor and thus type.
View
13 src/Perl6/Grammar.pm
@@ -296,6 +296,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token pod_block:sym<delimited_table> {
^^ \h* '=begin' \h+ 'table'
[ [\n '=']? \h+ <colonpair> ]* <pod_newline>+
+ { $<type> := 'table' }
[
<table_row>*
^^ \h* '=end' \h+ 'table' <pod_newline>
@@ -313,6 +314,7 @@ grammar Perl6::Grammar is HLL::Grammar {
|| '=begin' \h+ 'END' <pod_newline>
|| '=for' \h+ 'END' <pod_newline>
|| '=END' <pod_newline>
+ { $<type> := 'END' }
]
.*
}
@@ -373,6 +375,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token pod_block:sym<abbreviated_table> {
^^ \h* '=table' [ [\n '=']? \h+ <colonpair> ]* <pod_newline>
+ { $<type> := 'table' }
[ <!before \h* \n> <table_row>]*
}
@@ -424,6 +427,7 @@ grammar Perl6::Grammar is HLL::Grammar {
# A place for Pod
:my $*POD_BLOCKS := [];
+ :my $*POD_BLOCKS_NAMED := {};
:my $*POD_BLOCKS_SEEN := {};
:my $*POD_PAST;
:my $*DECLARATOR_DOCS;
@@ -491,6 +495,15 @@ grammar Perl6::Grammar is HLL::Grammar {
$*W.install_lexical_symbol(
$*UNIT, '$=pod', $*POD_PAST<compile_time_value>
);
+
+ for $*POD_BLOCKS_NAMED {
+ my $arr := $*W.add_constant(
+ 'Array', 'type_new', |($_.value)
+ );
+ $*W.install_lexical_symbol(
+ $*UNIT, '$=' ~ $_.key, $arr<compile_time_value>
+ );
+ }
# Tag UNIT with a magical lexical. Also if we're compiling CORE,
# give it such a tag too.

No commit comments for this range

Something went wrong with that request. Please try again.