Skip to content

Commit

Permalink
Merge branch 'ng1' of git@github.com:rakudo/rakudo into ng1
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Feb 3, 2010
2 parents 533672f + cc3e5ef commit 380ff4a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -945,6 +945,34 @@ method method_def($/) {
make $past;
}

method regex_declarator($/, $key?) {
if $key ne 'open' {
# Create regex code object.
# XXX TODO: token/regex/rule differences, signatures, traits.
my $past := Regex::P6Regex::Actions::buildsub($<p6regex>.ast);
$past := create_code_object($past, 'Regex', 0, '');

# Install in lexpad or namespace. XXX Need & on start of name?
my $name := ~$<deflongname>;
if $*SCOPE ne 'our' {
@BLOCK[0][0].push(PAST::Var.new( :name($name), :isdecl(1),
:viviself($past), :scope('lexical') ) );
@BLOCK[0].symbol($name, :scope('lexical') );
}

# Otherwise, package scoped; add something to loadinit to install them.
else {
@PACKAGE[0].block.loadinit.push(PAST::Op.new(
:pasttype('bind'),
PAST::Var.new( :name($name), :scope('package') ),
$past
));
@BLOCK[0].symbol($name, :scope('package') );
}

make PAST::Var.new( :name($name) );
}
}

method signature($/) {
my $signature := Perl6::Compiler::Signature.new();
Expand Down
2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -104,7 +104,7 @@ S02-names/identifier.t
S02-whitespace_and_comments/begin_end_pod.t
# S02-whitespace_and_comments/comments.t
S02-whitespace_and_comments/minimal-whitespace.t
## S02-whitespace_and_comments/one-pass-parsing.t
S02-whitespace_and_comments/one-pass-parsing.t
# S02-whitespace_and_comments/pod-in-multi-line-exprs.t
S02-whitespace_and_comments/sub-block-parsing.t
# S02-whitespace_and_comments/unicode-whitespace.t
Expand Down

0 comments on commit 380ff4a

Please sign in to comment.