Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Get adding of regex declarations done through the compile time meta-o…
…bject. Well, mostly...there's a horrible issue with the way prefixes are stored to deal with first...
  • Loading branch information
jnthn committed Apr 27, 2011
1 parent 6ca730b commit 5b9b016
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions src/NQP/Actions.pm
Expand Up @@ -1007,16 +1007,7 @@ class NQP::Actions is HLL::Actions {
)
);
for @($past) {
$*PACKAGE-SETUP.push(PAST::Op.new(
:pasttype('callmethod'), :name('add_method'),
PAST::Op.new(
:pirop('get_how PP'),
PAST::Var.new( :name('type_obj'), :scope('register') )
),
PAST::Var.new( :name('type_obj'), :scope('register') ),
PAST::Val.new( :value($_.name()) ),
PAST::Val.new( :value($_) )
));
$*SC.pkg_add_method($*PACKAGE, 'add_method', $_.name(), $_, 0);
}
}
elsif $key eq 'open' {
Expand All @@ -1040,16 +1031,11 @@ class NQP::Actions is HLL::Actions {
$regex
);
if pir::defined($*PACKAGE-SETUP) {
$*PACKAGE-SETUP.push(PAST::Op.new(
:pasttype('callmethod'), :name('add_method'),
PAST::Op.new(
:pirop('get_how PP'),
PAST::Var.new( :name('type_obj'), :scope('register') )
),
PAST::Var.new( :name('type_obj'), :scope('register') ),
PAST::Val.new( :value($name) ),
PAST::Val.new( :value($regex) )
));
$*SC.pkg_add_method($*PACKAGE, 'add_method', $name, $regex, 0);
# XXX This is really nasty - PAST::Compiler generates a prefix
# producing method. However, the meta-object would already be
# composed by then. Need to resolve this to finish compile-time
# meta-objects stuff...
$*PACKAGE-SETUP.push(PAST::Op.new(
:pasttype('callmethod'), :name('add_method'),
PAST::Op.new(
Expand Down

0 comments on commit 5b9b016

Please sign in to comment.