Skip to content

Commit

Permalink
Implement pointy blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jul 25, 2010
1 parent 93f8f17 commit e9c9a9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CORE.setting
Expand Up @@ -156,7 +156,7 @@ Q:CgOp {
} }

my class Junction is Mu { }
my class Num {
my class Num is Cool {
method Str () { Q:CgOp {
(box Str (rawcall (unbox Double (fetch (scopedlex self))) ToString))
} }
Expand All @@ -166,7 +166,7 @@ my class Num {
} }
method ACCEPTS($t) { self == $t }
}
my class Str {
my class Str is Cool {
method Str () { self }
method ACCEPTS($t) { self eq $t }
method chars() { Q:CgOp {
Expand Down Expand Up @@ -200,7 +200,7 @@ my class UInt { }
my class Bit { }
my class Instant { }
my class Duration { }
my class Enum { }
my class Enum is Cool { }
my class Bool is Enum {
method Str() { if self { "Bool::True" } else { "Bool::False" } }
method Bool() { self }
Expand Down
6 changes: 6 additions & 0 deletions Niecza/Actions.pm
Expand Up @@ -565,6 +565,11 @@ sub term__S_QuestionQuestionQuestion { my ($cl, $M) = @_;
$M->{_ast} = Op::Yada->new(kind => '???');
}

sub term__S_lambda { my ($cl, $M) = @_;
$M->{pblock}{_ast}->type('pointy');
$M->{_ast} = $cl->block_to_closure($M->{pblock}{_ast});
}

sub variable { my ($cl, $M) = @_;
my $sigil = $M->{sigil} ? $M->{sigil}->Str : substr($M->Str, 0, 1);
my $twigil = $M->{twigil}[0] ? $M->{twigil}[0]{sym} : '';
Expand Down Expand Up @@ -754,6 +759,7 @@ sub blockoid { my ($cl, $M) = @_;
$M->{_ast} = $M->{statementlist}{_ast};
}
}
sub lambda {}

sub sigil {}
sub sigil__S_Amp {}
Expand Down

0 comments on commit e9c9a9f

Please sign in to comment.