Permalink
Browse files

Unify "Can't" and "Can not" and "Cannot" in error messages to "Cannot"

  • Loading branch information...
1 parent 25e5bd0 commit 76425aba89d4fbd742abbf0d1278380ec21f9ce5 @moritz moritz committed Mar 20, 2011
View
@@ -1022,7 +1022,7 @@ method package_def($/, $key?) {
# not supported (gets really tricky in the parametric case - needs more
# thought and consideration).
if +@PACKAGE && pir::isa__IPS(@PACKAGE[0], 'Role') {
- $/.CURSOR.panic("Can not nest a package inside a role");
+ $/.CURSOR.panic("Cannot nest a package inside a role");
}
@PACKAGE.unshift($package);
}
@@ -1113,10 +1113,10 @@ sub declare_variable($/, $past, $sigil, $twigil, $desigilname, $trait_list) {
my $attrname := ~$sigil ~ '!' ~ $desigilname;
our @PACKAGE;
unless +@PACKAGE {
- $/.CURSOR.panic("Can not declare an attribute outside of a package");
+ $/.CURSOR.panic("Cannot declare an attribute outside of a package");
}
if @PACKAGE[0].has_attribute($attrname) {
- $/.CURSOR.panic("Can not re-declare attribute " ~ $attrname);
+ $/.CURSOR.panic("Cannot re-declare attribute " ~ $attrname);
}
my %attr_info;
%attr_info<name> := $attrname;
@@ -1154,7 +1154,7 @@ sub declare_variable($/, $past, $sigil, $twigil, $desigilname, $trait_list) {
# Give it a 'rw' property unless it's explicitly readonly.
my $readtype := trait_readtype($trait_list);
if $readtype eq 'CONFLICT' {
- $/.CURSOR.panic('Can not apply more than one of: is copy, is rw, is readonly');
+ $/.CURSOR.panic('Cannot apply more than one of: is copy, is rw, is readonly');
}
if $readtype eq 'copy' {
$/.CURSOR.panic("'is copy' trait not valid on variable declaration");
@@ -1261,11 +1261,11 @@ method routine_def($/) {
# Check for common error conditions.
if $symbol {
if $*MULTINESS eq 'only' {
- $/.CURSOR.panic('Can not declare only routine ' ~ $name ~
+ $/.CURSOR.panic('Cannot declare only routine ' ~ $name ~
' when another routine with this name was already declared');
}
if !$symbol<proto> && !$*MULTINESS {
- $/.CURSOR.panic('Can not re-declare sub ' ~ $name ~ ' without declaring it multi');
+ $/.CURSOR.panic('Cannot re-declare sub ' ~ $name ~ ' without declaring it multi');
}
}
else {
@@ -1352,7 +1352,7 @@ method routine_def($/) {
}
}
elsif $*MULTINESS {
- $/.CURSOR.panic('Can not put ' ~ $*MULTINESS ~ ' on anonymous routine');
+ $/.CURSOR.panic('Cannot put ' ~ $*MULTINESS ~ ' on anonymous routine');
}
else {
# Just wrap in a Sub.
@@ -1410,7 +1410,7 @@ method method_def($/) {
# Get hold of the correct table to install it in, and install.
our @PACKAGE;
- unless +@PACKAGE { $/.CURSOR.panic("Can not declare method outside of a package"); }
+ unless +@PACKAGE { $/.CURSOR.panic("Cannot declare method outside of a package"); }
my %table;
if $<specials> eq '^' {
%table := @PACKAGE[0].meta_methods();
@@ -1421,7 +1421,7 @@ method method_def($/) {
install_method($/, $code, $name, %table);
}
elsif $*MULTINESS {
- $/.CURSOR.panic('Can not put ' ~ $*MULTINESS ~ ' on anonymous routine');
+ $/.CURSOR.panic('Cannot put ' ~ $*MULTINESS ~ ' on anonymous routine');
}
else {
$past := block_closure($past, $*METHODTYPE, 0);
@@ -1438,13 +1438,13 @@ sub install_method($/, $code, $name, %table) {
# If it's an only and there's already a symbol, problem.
if $*MULTINESS eq 'only' && %table{$name} {
- $/.CURSOR.panic('Can not declare only method ' ~ $name ~
+ $/.CURSOR.panic('Cannot declare only method ' ~ $name ~
' when another method with this name was already declared');
}
elsif $*MULTINESS || %table{$name}<multis> {
# If no multi declarator and no proto, error.
if !$*MULTINESS && !%table{$name}<proto> {
- $/.CURSOR.panic('Can not re-declare method ' ~ $name ~ ' without declaring it multi');
+ $/.CURSOR.panic('Cannot re-declare method ' ~ $name ~ ' without declaring it multi');
}
# If it's a proto, stash it away in the symbol entry.
@@ -1541,7 +1541,7 @@ method regex_def($/, $key?) {
}
our @PACKAGE;
unless +@PACKAGE {
- $/.CURSOR.panic("Can not declare named " ~ ~$<sym> ~ " outside of a package");
+ $/.CURSOR.panic("Cannot declare named " ~ ~$<sym> ~ " outside of a package");
}
my %table;
%table := @PACKAGE[0].methods();
@@ -1607,7 +1607,7 @@ method regex_def($/, $key?) {
my $code := block_closure(blockref($past), 'Regex', 0);
our @PACKAGE;
unless +@PACKAGE {
- $/.CURSOR.panic("Can not declare named " ~ ~$<sym> ~ " outside of a package");
+ $/.CURSOR.panic("Cannot declare named " ~ ~$<sym> ~ " outside of a package");
}
my %table;
%table := @PACKAGE[0].methods();
@@ -1703,7 +1703,7 @@ method type_declarator:sym<subset>($/) {
@BLOCK[0].symbol($name, :scope('lexical') );
}
else {
- $/.CURSOR.panic("Can not declare a subset with scope declarator " ~ $*SCOPE);
+ $/.CURSOR.panic("Cannot declare a subset with scope declarator " ~ $*SCOPE);
}
make PAST::Var.new( :name($name) );
}
@@ -1774,10 +1774,10 @@ method parameter($/) {
# Sanity checks.
if $<default_value> {
if $quant eq '*' {
- $/.CURSOR.panic("Can't put default on slurpy parameter");
+ $/.CURSOR.panic("Cannot put default on slurpy parameter");
}
if $quant eq '!' {
- $/.CURSOR.panic("Can't put default on required parameter");
+ $/.CURSOR.panic("Cannot put default on required parameter");
}
}
@@ -1797,7 +1797,7 @@ method parameter($/) {
# Handle built-in ones.
my $read_type := trait_readtype($<trait>);
if $read_type eq 'CONFLICT' {
- $/.CURSOR.panic('Can not apply more than one of: is copy, is rw, is readonly');
+ $/.CURSOR.panic('Cannot apply more than one of: is copy, is rw, is readonly');
}
$*PARAMETER.is_rw( $read_type eq 'rw' );
$*PARAMETER.is_copy( $read_type eq 'copy' );
@@ -1813,7 +1813,7 @@ method parameter($/) {
method param_var($/) {
if $<signature> {
if pir::defined__IP($*PARAMETER.sub_llsig) {
- $/.CURSOR.panic('Can not have more than one sub-signature for a parameter');
+ $/.CURSOR.panic('Cannot have more than one sub-signature for a parameter');
}
$*PARAMETER.sub_llsig( $<signature>.ast );
if pir::substr(~$/, 0, 1) eq '[' {
@@ -1874,14 +1874,14 @@ method type_constraint($/) {
$*PARAMETER.cons_types.push($<value>.ast);
}
else {
- $/.CURSOR.panic('Can not do non-typename cases of type_constraint yet');
+ $/.CURSOR.panic('Cannot do non-typename cases of type_constraint yet');
}
}
method post_constraint($/) {
if $<signature> {
if pir::defined__IP($*PARAMETER.sub_llsig) {
- $/.CURSOR.panic('Can not have more than one sub-signature for a parameter');
+ $/.CURSOR.panic('Cannot have more than one sub-signature for a parameter');
}
$*PARAMETER.sub_llsig( $<signature>.ast );
}
@@ -2014,7 +2014,7 @@ method dotty:sym<.>($/) { make $<dottyop>.ast; }
method dotty:sym<.*>($/) {
my $past := $<dottyop>.ast;
unless $past.isa(PAST::Op) && $past.pasttype() eq 'callmethod' {
- $/.CURSOR.panic("Can not use " ~ $<sym>.Str ~ " on a non-identifier method call");
+ $/.CURSOR.panic("Cannot use " ~ $<sym>.Str ~ " on a non-identifier method call");
}
$past.unshift($past.name);
$past.name('!dispatch_' ~ $<sym>.Str);
@@ -2128,7 +2128,7 @@ method term:sym<name>($/) {
:name(~$name), :namespace($ns), :scope('package'),
:viviself(PAST::Op.new(
:pasttype('call'), :name('!FAIL'),
- "Can not find sub " ~ ~$<longname>
+ "Cannot find sub " ~ ~$<longname>
))
);
}
@@ -3020,7 +3020,7 @@ method quote_EXPR($/) {
my $past := $<quote_delimited>.ast;
if $/.CURSOR.quotemod_check('w') {
if !$past.isa(PAST::Val) {
- $/.CURSOR.panic("Can't form :w list from non-constant strings (yet)");
+ $/.CURSOR.panic("Cannot form :w list from non-constant strings (yet)");
}
else {
my @words := HLL::Grammar::split_words($/, $past.value);
@@ -23,7 +23,7 @@ method finish($block) {
$block.namespace(Perl6::Grammar::parse_name(~$!name));
}
else {
- pir::die("Can't handle scope declarator " ~ $!scope ~ " on modules yet");
+ pir::die("Cannot handle scope declarator " ~ $!scope ~ " on modules yet");
}
return $block;
}
@@ -128,7 +128,7 @@ method finish($block) {
}
else {
# Augment, so look up existing class.
- unless $name { pir::die('Can not augment an anonymous package') }
+ unless $name { pir::die('Cannot augment an anonymous package') }
my @name := Perl6::Grammar::parse_name($name);
$decl.push(PAST::Op.new(
:pasttype('bind'),
View
@@ -82,10 +82,10 @@ method add_our_name($name, $up_levels = 0) {
method add_name($name, $up_levels = 0) {
if $*SCOPE eq 'augment' || $*SCOPE eq 'supersede' {
unless self.is_name($name) {
- pir::die("Can't $*SCOPE $*PKGDECL that doesn't exist");
+ pir::die("Cannot $*SCOPE $*PKGDECL that doesn't exist");
}
unless $*MONKEY_TYPING {
- pir::die("Can't $*SCOPE $*PKGDECL $name without 'use MONKEY_TYPING'");
+ pir::die("Cannot $*SCOPE $*PKGDECL $name without 'use MONKEY_TYPING'");
}
}
else {
@@ -796,7 +796,7 @@ token variable {
|| [
| <sigil> <twigil>? <desigilname>
| <special_variable>
- | <sigil> $<index>=[\d+] [ <?{ $*IN_DECL}> <.panic: "Can't declare a numeric variable">]?
+ | <sigil> $<index>=[\d+] [ <?{ $*IN_DECL}> <.panic: "Cannot declare a numeric variable">]?
| <sigil> <?[<[]> <postcircumfix>
| $<sigil>=['$'] $<desigilname>=[<[/_!]>]
| <sigil> <?{ $*IN_DECL }>
@@ -1083,18 +1083,18 @@ token parameter {
if $kind eq '!' {
if $*zone eq 'posopt' {
- $/.CURSOR.panic("Can't put required parameter after optional parameters");
+ $/.CURSOR.panic("Cannot put required parameter after optional parameters");
}
elsif $*zone eq 'var' {
- $/.CURSOR.panic("Can't put required parameter after variadic parameters");
+ $/.CURSOR.panic("Cannot put required parameter after variadic parameters");
}
}
elsif $kind eq '?' {
if $*zone eq 'posreq' {
$*zone := 'posopt';
}
elsif $*zone eq 'var' {
- $/.CURSOR.panic("Can't put optional positional parameter after variadic parameters");
+ $/.CURSOR.panic("Cannot put optional positional parameter after variadic parameters");
}
}
elsif $kind eq '*' {
@@ -1909,7 +1909,7 @@ token infix_prefix_meta_operator:sym<!> {
[
|| <?{ $<infixish>.Str eq '=' }> <O('%chaining')>
|| <?{ $<infixish><OPER><O><iffy> }> <O=.copyO('infixish')>
- || <.panic("Can't negate " ~ $<infixish>.Str ~ " because it is not iffy enough")>
+ || <.panic("Cannot negate " ~ $<infixish>.Str ~ " because it is not iffy enough")>
]
}
token infix_prefix_meta_operator:sym<R> { <sym> <infixish> <O=.copyO('infixish')> }
@@ -2123,7 +2123,7 @@ method gen_op($category, $opname, $canname, $subname) {
return 0;
}
else {
- self.panic("Can not add tokens of category '$category' with a sub");
+ self.panic("Cannot add tokens of category '$category' with a sub");
}
# Nope, so we need to modify the grammar. Build code to parse it.
@@ -127,7 +127,7 @@ method stub_lexical_imports($name, $block_ast) {
unless pir::isnull__IP(%imports) {
for %imports {
if $block_ast.symbol($_.key) {
- pir::die("Can't import symbol " ~ $_.key
+ pir::die("Cannot import symbol " ~ $_.key
~ " because it already exists in this lexical scope\n");
} else {
if pir::isa($_.value, 'Perl6MultiSub') {
@@ -36,7 +36,7 @@ augment class Any {
our multi method map(&block) { self.list.map(&block); }
our multi method map(%block) {
- die "Can't call map() with a Hash argument, Callable required\n"
+ die "Cannot call map() with a Hash argument, Callable required\n"
~ "You probably wrote a Hash composer accidentally - try to\n"
~ "disambiguate it with a ; directly after the opening brace";
View
@@ -8,7 +8,7 @@ augment class Any {
}
method Numeric() {
- die "Can't take numeric value for object of type $.WHAT.perl()" if $.defined;
+ die "Cannot take numeric value for object of type $.WHAT.perl()" if $.defined;
# fail "Use of uninitialized value in numeric context";
warn "Use of uninitialized value in numeric context";
0;
@@ -409,7 +409,7 @@ augment class Cool {
our multi method ord() {
if self eq "" {
- fail('Can not take ord of empty string');
+ fail('Cannot take ord of empty string');
}
pir::box__PI(pir::ord__IS(self));
@@ -282,7 +282,7 @@ Helper for handling calls of the form .Foo::bar.
$P0 = $P0[name]
.tailcall $P0(invocant, pos_args :flat, named_args :flat :named)
not_allowed:
- $S0 = "Can not call method '"
+ $S0 = "Cannot call method '"
$S0 = concat $S0, name
$S0 = concat $S0, "' on unrelated type '"
$S1 = target.'perl'()
@@ -855,7 +855,7 @@ correct protocol.
$P3 = $P1.'WHAT'()
$I0 = '&infix:<===>'($P2, $P3)
if $I0 goto composee_it_loop
- die 'Can not compose multiple composees that want different appliers'
+ die 'Cannot compose multiple composees that want different appliers'
first_composee:
$P1 = $P0.'HOW'()
chosen_applier = $P1.'applier_for'($P0, meta)
@@ -171,7 +171,7 @@ Add a method to the given meta.
$P1.'incorporate_candidates'(meth)
.return ()
error:
- '&die'('Can not add two methods to a role if they are not multis')
+ '&die'('Cannot add two methods to a role if they are not multis')
.end
=item methods
@@ -335,7 +335,7 @@ Completes the creation of the metaclass and return the P6role.
$P3 = $P1.'WHAT'()
$I0 = '&infix:<===>'($P2, $P3)
if $I0 goto composee_it_loop
- die 'Can not compose multiple composees that want different appliers'
+ die 'Cannot compose multiple composees that want different appliers'
first_composee:
$P1 = $P0.'HOW'()
chosen_applier = $P1.'applier_for'($P0, self)

0 comments on commit 76425ab

Please sign in to comment.