Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cleanup .method, implement dup@, start Mu
  • Loading branch information
sorear committed Jul 7, 2010
1 parent ee41c0d commit 7292187
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Niecza/Actions.pm
Expand Up @@ -348,7 +348,7 @@ sub insn__S_fetch { my ($cl, $M) = @_;
$M->{_ast} = [[ 'fetch' ]];
}

sub insn__S_dup_fetchlv { my ($cl, $M) = @_;
sub insn__S_dup_fetch { my ($cl, $M) = @_;
$M->{_ast} = [[ 'dup_fetch' ]];
}

Expand All @@ -357,7 +357,7 @@ sub insn__S_pos { my ($cl, $M) = @_;
}

sub insn__S_call_method { my ($cl, $M) = @_;
$M->{_ast} = [[ call_method => !$M->{voidmark}, $M->{identifier}->Str,
$M->{_ast} = [[ call_method => !$M->{voidmark}[0], $M->{identifier}->Str,
$M->{decint}{_ast} ]];
}

Expand Down
2 changes: 1 addition & 1 deletion Niecza/Grammar.pm6
Expand Up @@ -61,7 +61,7 @@ grammar NIL is STD {
token insn:pos { '=[' <?> ~ ']' <decint> }
token insn:clone_lex { 'CLONE:' [ \h* <varid> \h* ] ** ',' \h* \n }
token insn:copy_lex { 'COPY:' [ \h* <varid> \h* ] ** ',' \h* \n }
token insn:call_method { '.method:' {} <identifier> '/' <decint> <voidmark>? }
token insn:call_method { '.method/' {} <decint> ':' <identifier> <voidmark>? }
token insn:call_sub { '.call/' {} <decint> <voidmark>? }
token insn:tail_call_sub { '.tailcall/' {} <decint> }
token insn:unwrap { <sym> ':' {} <clrid> }
Expand Down
10 changes: 10 additions & 0 deletions setting
Expand Up @@ -120,6 +120,16 @@ PRE-INIT {
}
}

# cannot be a normal class - it has no parents (and must not be cloned)
my class Mu { ... }
PRE-INIT { Q:NIL {
L@^ClassHOW dup@ ="Mu" .method/1:new L!^'Mu!HOW'
L@^'Mu!HOW' dup@ callframe new/1:CLRImportObject
.plaincall/1:Kernel.NewROVar
.method/1:create-protoobject L!^Mu
null:Variable
} }

sub infix:<~> { Q:NIL {
=[0] @ unwrap:String =[1] @ unwrap:String .plaincall/2:String.Concat
new/1:CLRImportObject .plaincall/1:Kernel.NewROVar
Expand Down

0 comments on commit 7292187

Please sign in to comment.