Skip to content

Commit

Permalink
More STD fiddles - 'foo' and "foo" work
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Oct 25, 2010
1 parent f288668 commit 5b07e77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/SAFE.setting
Expand Up @@ -222,8 +222,8 @@ sub warn($str) { Q:CgOp {
)
} }
sub say($obj) { ($obj ~~ Cool) ?? $obj.say !! $obj.Str.say }
sub note($text) { Q:CgOp { (rnull (note (unbox str (@ {$text})))) } }
sub say(*@obj) { @obj.join('').say }
sub note(*@text) { Q:CgOp { (rnull (note (unbox str (@ {@text.join('').Str})))) } }
sub exit($status = 0) { Q:CgOp {
(rnull [exit (cast int (unbox num (@ {$status})))])
Expand Down
12 changes: 6 additions & 6 deletions v6/STD.pm6
Expand Up @@ -575,15 +575,15 @@ method peek_delimiters {

my $rightbrack = %open2close{$char};
if not defined $rightbrack {
return $char, $char;
return ($char, $char);
}
while substr(self.orig,$pos,1) eq $char {
$pos++;
}
my $len = $pos - $startpos;
my $start = $char x $len;
my $stop = $rightbrack x $len;
return $start, $stop;
return ($start, $stop);
}

role startstop[$start,$stop] {
Expand Down Expand Up @@ -651,7 +651,7 @@ token nibbler {
[
|| <starter> <nibbler> <stopper>
{
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to(:$to), :method<Str>, :captures()) if $from != $to;
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to($to), :method<Str>, :captures()) if $from != $to;

my $n = $<nibbler>[(+$<nibbler>)-1]<nibbles>;
my @n = @$n;
Expand All @@ -664,7 +664,7 @@ token nibbler {
$to = $from =.pos;
}
|| <escape> {
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to(:$to), :method<Str>, :captures()) if $from != $to;
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to($to), :method<Str>, :captures()) if $from != $to;
push @nibbles, $<escape>[(+$<escape>)-1];
$text = '';
$to = $from =.pos;
Expand All @@ -681,7 +681,7 @@ token nibbler {
]
]*
{
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to(:$to), :method<Str>, :captures()) if $from != $to or !@nibbles;
push @nibbles, Match.synthetic(:cursor(self), :from($from), :to($to), :method<Str>, :captures()) if $from != $to or !@nibbles;
$*LAST_NIBBLE = $¢;
$*LAST_NIBBLE_MULTILINE =if $multiline;
}
Expand Down Expand Up @@ -4131,7 +4131,7 @@ grammar Q is STD {
token escape:sym<$> {
:my $*QSIGIL ::= '$';
<?before '$'>
[ :lang(%*LANG<MAIN>) <EXPR(item %methodcall)> ] || <.panic: "Non-variable \$ must be backslashed">
[ :lang(%*LANG<MAIN>) <EXPR(item %methodcall)> || <.panic: "Non-variable \$ must be backslashed"> ]
}
}

Expand Down
3 changes: 2 additions & 1 deletion v6/tryfile
Expand Up @@ -18,13 +18,14 @@ augment class STD::P6 {
:my $*QSIGIL ::= 0;
<!before <[\)\]\}]> >
<!stopper>
<!before $>

# this could either be a statement that follows a declaration
# or a statement that is within the block of a code declaration
:lang( %*LANG<MAIN> )
<!!{ $*LASTSTATE = $¢.pos; True }>

<!before $ >
# <!before $ >

[
| <label> <statement>
Expand Down

0 comments on commit 5b07e77

Please sign in to comment.