Skip to content

Commit

Permalink
bare say now complains about no valid arg
Browse files Browse the repository at this point in the history
(since it might be an invalid arg rather than a missing arg).
The help message for bare say et al. is demoted to a worry.
  • Loading branch information
TimToady committed Feb 24, 2015
1 parent 4659f32 commit 629f5a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Perl6/Grammar.nqp
Expand Up @@ -268,7 +268,7 @@ role STD {
);
}
method worryobs($old, $new, $when = 'in Perl 6') {
$*W.throw(self.MATCH(), ['X', 'Obsolete'],
self.typed_worry('X::Obsolete',
old => $old,
replacement => $new,
when => $when,
Expand Down Expand Up @@ -3243,11 +3243,12 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
$/.CURSOR.worry("Use of non-subscript <...> where postfix is expected; please use whitespace")
if $trap && nqp::substr($/.CURSOR.orig, $/.CURSOR.pos, 1) eq '<';
if $trap == 1 { # probably misused P5ism
$<longname>.CURSOR.sorryobs("bare '$name'", ".$name if you meant \$_, or use an explicit invocant or argument");
$<longname>.CURSOR.worryobs("bare '$name'", ".$name if you meant \$_, or use an explicit invocant or argument");
}
elsif $trap == 2 { # probably misused P6ism
$<longname>.CURSOR.sorry("The '$name' listop may not be called without arguments (please use () or whitespace to clarify)");
$<longname>.CURSOR.worry("The '$name' listop may not be called without arguments (please use () or whitespace to clarify)");
}
$<longname>.CURSOR.panic("No valid term seen where one is required");
}
}
}
Expand Down

0 comments on commit 629f5a4

Please sign in to comment.