Skip to content

Commit

Permalink
quoters now lexically overridable by terms/subs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Feb 28, 2015
1 parent 9c69eb1 commit 6d85d5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 3 additions & 8 deletions S02-names-vars/names.t
Expand Up @@ -105,16 +105,11 @@ is_deeply ::.^methods, PseudoStash.^methods, ':: is a valid PseudoStash';
}
}

# RT #116182
{
sub s () { given 9 { return 0 when $_ %% 3; 1 } };
throws_like { EVAL q[say s;] }, X::Comp::Group,
'"s;" is not parsed as subroutine call',
message => { m/"Regex not terminated"/ };
my \s = 42;
is s, 42, 'local terms override quoters';
sub m { return 42 };
throws_like { EVAL q[m;] }, X::Comp::Group,
'"m;" is not parsed as subroutine call',
message => { m/"Regex not terminated"/ };
is m, 42, 'local subs override quoters';
}

# RT #77006
Expand Down
7 changes: 4 additions & 3 deletions S05-substitution/subst.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 146;
plan 147;

# L<S05/Substitution/>

Expand Down Expand Up @@ -348,10 +348,11 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
{
sub s { 'sub s' }
$_ = "foo";
ok s,foo,bar, , 'bare s is always substititution';
ok s:s,foo,bar, , 's with colon is always substitution';
is s(), 'sub s', 'can call sub s as "s()"';
is s, 'sub s', 'can call sub s as "s"';
$_ = "foo";
ok s (foo) = 'bar', 'bare s is substitution before whitespace then parens';
ok ss (foo) = 'bar', 'bare ss is substitution before whitespace then parens';
}

# Test for :samecase
Expand Down

0 comments on commit 6d85d5a

Please sign in to comment.