Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Stop treating meta-object names as strings, and actually reference th…
…e meta-objects, just as we do with Actions classes.
  • Loading branch information
jnthn committed Feb 5, 2011
1 parent 6a63e74 commit 0b5765d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/NQP/Actions.pm
Expand Up @@ -378,12 +378,13 @@ sub package($/) {

# Prefix the class initialization with initial setup. Also install it
# in the symbol table right away.
my $how := %*HOW{~$<sym>};
$*PACKAGE-SETUP.unshift(PAST::Stmts.new(
PAST::Op.new( :pasttype('bind'),
PAST::Var.new( :name('type_obj'), :scope('register'), :isdecl(1) ),
PAST::Op.new(
:pasttype('callmethod'), :name('new_type'),
PAST::Var.new( :name(%*HOW{~$<sym>}), :namespace(''), :scope('package') ),
PAST::Var.new( :name($how.HOW.name($how)), :namespace(''), :scope('package') ),
PAST::Val.new( :value($name), :named('name') )
)
),
Expand Down
10 changes: 5 additions & 5 deletions src/NQP/Grammar.pm
Expand Up @@ -10,11 +10,11 @@ method TOP() {

# Package declarator to meta-package mapping.
my %*HOW;
%*HOW<knowhow> := 'KnowHOW';
%*HOW<class> := 'NQPClassHOW';
%*HOW<grammar> := 'NQPClassHOW';
%*HOW<role> := 'NQPRoleHOW';
%*HOW<native> := 'NQPNativeHOW';
%*HOW<knowhow> := KnowHOW;
%*HOW<class> := NQPClassHOW;
%*HOW<grammar> := NQPClassHOW;
%*HOW<role> := NQPParametricRoleHOW;
%*HOW<native> := NQPNativeHOW;

# What attribute class to use with what HOW, plus a default.
my $*DEFAULT-METAATTR := 'NQPAttribute';
Expand Down

0 comments on commit 0b5765d

Please sign in to comment.