Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix build
  • Loading branch information
sorear committed May 27, 2011
1 parent 6c42d59 commit 6bf4ff8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/Kernel.cs
Expand Up @@ -834,7 +834,6 @@ public class SubInfo {
bool islist = ((flags & SIG_F_BINDLIST) != 0);
bool rw = ((flags & SIG_F_READWRITE) != 0) && !islist;

// XXX $_ stupidity
if (rw && !src.rw)
return Kernel.Die(th, "Binding " + PName(rbase) + ", cannot bind read-only value to is rw parameter");
// fast path
Expand Down
38 changes: 38 additions & 0 deletions src/niecza
Expand Up @@ -29,6 +29,44 @@ use STD;
use Sig;

augment class NieczaActions {
sub qpvalue($ast) {
if $ast.^isa(::Op::SimpleParcel) {
join " ", map &qpvalue, @( $ast.items )
} elsif $ast.^isa(::Op::StringLiteral) {
$ast.text;
} elsif $ast.^isa(::Op::Paren) {
qpvalue($ast.inside);
} else {
"XXX"
}
}

method colonpair($/) {
my $n;
if !$<v>.^isa(Match) {
$n = ":" ~ ($<v> ?? '' !! '!') ~ $<k>;
} else {
$n = ":" ~ $<k> ~ "<" ~ qpvalue($<v>.ast) ~ ">";
}
my $tv = $<v>.^isa(Match) ?? $<v>.ast !!
::Op::Lexical.new(name => $<v> ?? 'True' !! 'False');

if $tv ~~ Str {
if substr($<v>,1,1) eq '<' {
$tv = ::Op::CallMethod.new(name => 'at-key',
receiver => ::Op::ContextVar.new(name => '$*/'),
args => [::Op::StringLiteral.new(text => ~$<k>)]);
} else {
$tv = self.do_variable_reference($/,
{ sigil => ~$<v><sigil>,
twigil => ($<v><twigil> ?? ~$<v><twigil>[0] !! ''),
name => $<k> });
}
}

make { ext => $n, term => ::Op::SimplePair.new(key => $<k>, value => $tv) };
}

sub mkstringycat($/, *@strings) {
my @a;
for @strings -> $s {
Expand Down

0 comments on commit 6bf4ff8

Please sign in to comment.