diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-09 22:56:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-09 22:56:44 (GMT) |
commit | 85c5123bcf8ed0ee1f150b34de8ba61e67ddd701 (patch) | |
tree | 80be478488aca306969c7d5f491cfceaf0e7674b | |
parent | 2f4b14eb621e899aa118933870b6af34d9f3b022 (diff) | |
download | tcl-85c5123bcf8ed0ee1f150b34de8ba61e67ddd701.zip tcl-85c5123bcf8ed0ee1f150b34de8ba61e67ddd701.tar.gz tcl-85c5123bcf8ed0ee1f150b34de8ba61e67ddd701.tar.bz2 |
(backport): Corrections to TclOO errorcodes from scripted parts
-rw-r--r-- | generic/tclNamesp.c | 4 | ||||
-rw-r--r-- | generic/tclOOScript.h | 30 | ||||
-rw-r--r-- | tools/tclOOScript.tcl | 30 |
3 files changed, 32 insertions, 32 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 0648b25..5d129df 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2379,7 +2379,7 @@ TclGetNamespaceForQualName( Tcl_Panic("Could not create namespace '%s'", nsName); } } else { - /* + /* * Namespace not found and was not created. * Remember last found namespace for TCL_FIND_IF_NOT_SIMPLE. */ @@ -2417,7 +2417,7 @@ TclGetNamespaceForQualName( if ((nsPtr == NULL) && (altNsPtr == NULL)) { if (flags & TCL_FIND_IF_NOT_SIMPLE) { - /* + /* * return last found NS, regardless simple name or not, * e. g. ::A::B::C::D -> ::A::B and C::D, if namespace C * cannot be found in ::A::B diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h index eb6a96e..a763092 100644 --- a/generic/tclOOScript.h +++ b/generic/tclOOScript.h @@ -64,7 +64,7 @@ static const char *tclOOSetupScript = "\t\t\t\t\tlassign $link src\n" "\t\t\t\t\tset dst $src\n" "\t\t\t\t} else {\n" -"\t\t\t\t\treturn -code error -errorcode {TCLOO CMDLINK FORMAT} \\\n" +"\t\t\t\t\treturn -code error -errorcode {TCL OO CMDLINK_FORMAT} \\\n" "\t\t\t\t\t\t\"bad link description; must only have one or two elements\"\n" "\t\t\t\t}\n" "\t\t\t\tif {![string match ::* $src]} {\n" @@ -142,10 +142,10 @@ static const char *tclOOSetupScript = "\t}\n" "\tdefine Slot {\n" "\t\tmethod Get -unexport {} {\n" -"\t\t\treturn -code error -errorcode {TCLOO ABSTRACT_SLOT} \"unimplemented\"\n" +"\t\t\treturn -code error -errorcode {TCL OO ABSTRACT_SLOT} \"unimplemented\"\n" "\t\t}\n" "\t\tmethod Set -unexport list {\n" -"\t\t\treturn -code error -errorcode {TCLOO ABSTRACT_SLOT} \"unimplemented\"\n" +"\t\t\treturn -code error -errorcode {TCL OO ABSTRACT_SLOT} \"unimplemented\"\n" "\t\t}\n" "\t\tmethod Resolve -unexport list {\n" "\t\t\treturn $list\n" @@ -242,11 +242,11 @@ static const char *tclOOSetupScript = "\t\t\t\tset object [next {*}$args]\n" "\t\t\t\t::oo::objdefine $object {\n" "\t\t\t\t\tmethod destroy {} {\n" -"\t\t\t\t\t\t::return -code error -errorcode {TCLOO SINGLETON} \\\n" +"\t\t\t\t\t\t::return -code error -errorcode {TCL OO SINGLETON} \\\n" "\t\t\t\t\t\t\t\"may not destroy a singleton object\"\n" "\t\t\t\t\t}\n" "\t\t\t\t\tmethod <cloned> -unexport {originObject} {\n" -"\t\t\t\t\t\t::return -code error -errorcode {TCLOO SINGLETON} \\\n" +"\t\t\t\t\t\t::return -code error -errorcode {TCL OO SINGLETON} \\\n" "\t\t\t\t\t\t\t\"may not clone a singleton object\"\n" "\t\t\t\t\t}\n" "\t\t\t\t}\n" @@ -265,22 +265,22 @@ static const char *tclOOSetupScript = "\t\t\t\tset prop [lindex $args $i]\n" "\t\t\t\tif {[string match \"-*\" $prop]} {\n" "\t\t\t\t\treturn -code error -level 2 \\\n" -"\t\t\t\t\t\t-errorcode {TCLOO PROPERTY_FORMAT} \\\n" +"\t\t\t\t\t\t-errorcode {TCL OO PROPERTY_FORMAT} \\\n" "\t\t\t\t\t\t\"bad property name \\\"$prop\\\": must not begin with -\"\n" "\t\t\t\t}\n" "\t\t\t\tif {$prop ne [list $prop]} {\n" "\t\t\t\t\treturn -code error -level 2 \\\n" -"\t\t\t\t\t\t-errorcode {TCLOO PROPERTY_FORMAT} \\\n" +"\t\t\t\t\t\t-errorcode {TCL OO PROPERTY_FORMAT} \\\n" "\t\t\t\t\t\t\"bad property name \\\"$prop\\\": must be a simple word\"\n" "\t\t\t\t}\n" "\t\t\t\tif {[string first \"::\" $prop] != -1} {\n" "\t\t\t\t\treturn -code error -level 2 \\\n" -"\t\t\t\t\t\t-errorcode {TCLOO PROPERTY_FORMAT} \\\n" +"\t\t\t\t\t\t-errorcode {TCL OO PROPERTY_FORMAT} \\\n" "\t\t\t\t\t\t\"bad property name \\\"$prop\\\": must not contain namespace separators\"\n" "\t\t\t\t}\n" "\t\t\t\tif {[string match {*[()]*} $prop]} {\n" "\t\t\t\t\treturn -code error -level 2 \\\n" -"\t\t\t\t\t\t-errorcode {TCLOO PROPERTY_FORMAT} \\\n" +"\t\t\t\t\t\t-errorcode {TCL OO PROPERTY_FORMAT} \\\n" "\t\t\t\t\t\t\"bad property name \\\"$prop\\\": must not contain parentheses\"\n" "\t\t\t\t}\n" "\t\t\t\tset realprop [string cat \"-\" $prop]\n" @@ -376,10 +376,10 @@ static const char *tclOOSetupScript = "\t\t\t\t\tdict incr opt -level 2\n" "\t\t\t\t\treturn -options $opt $msg\n" "\t\t\t\t} on break {} {\n" -"\t\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\t\"property getter for $prop did a break\"\n" "\t\t\t\t} on continue {} {\n" -"\t\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\t\"property getter for $prop did a continue\"\n" "\t\t\t\t}\n" "\t\t\t}\n" @@ -407,10 +407,10 @@ static const char *tclOOSetupScript = "\t\t\t\tdict incr opt -level 2\n" "\t\t\t\treturn -options $opt $msg\n" "\t\t\t} on break {} {\n" -"\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\"property getter for $prop did a break\"\n" "\t\t\t} on continue {} {\n" -"\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\"property getter for $prop did a continue\"\n" "\t\t\t}\n" "\t\t\treturn $value\n" @@ -438,10 +438,10 @@ static const char *tclOOSetupScript = "\t\t\t\t\tdict incr opt -level 2\n" "\t\t\t\t\treturn -options $opt $msg\n" "\t\t\t\t} on break {} {\n" -"\t\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\t\"property setter for $prop did a break\"\n" "\t\t\t\t} on continue {} {\n" -"\t\t\t\t\treturn -code error -level 2 -errorcode {TCLOO SHENANIGANS} \\\n" +"\t\t\t\t\treturn -code error -level 2 -errorcode {TCL OO SHENANIGANS} \\\n" "\t\t\t\t\t\t\"property setter for $prop did a continue\"\n" "\t\t\t\t}\n" "\t\t\t}\n" diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl index 4591a1b..0b75882 100644 --- a/tools/tclOOScript.tcl +++ b/tools/tclOOScript.tcl @@ -88,7 +88,7 @@ lassign $link src set dst $src } else { - return -code error -errorcode {TCLOO CMDLINK FORMAT} \ + return -code error -errorcode {TCL OO CMDLINK_FORMAT} \ "bad link description; must only have one or two elements" } if {![string match ::* $src]} { @@ -258,7 +258,7 @@ # ------------------------------------------------------------------ method Get -unexport {} { - return -code error -errorcode {TCLOO ABSTRACT_SLOT} "unimplemented" + return -code error -errorcode {TCL OO ABSTRACT_SLOT} "unimplemented" } # ------------------------------------------------------------------ @@ -271,7 +271,7 @@ # ------------------------------------------------------------------ method Set -unexport list { - return -code error -errorcode {TCLOO ABSTRACT_SLOT} "unimplemented" + return -code error -errorcode {TCL OO ABSTRACT_SLOT} "unimplemented" } # ------------------------------------------------------------------ @@ -431,11 +431,11 @@ set object [next {*}$args] ::oo::objdefine $object { method destroy {} { - ::return -code error -errorcode {TCLOO SINGLETON} \ + ::return -code error -errorcode {TCL OO SINGLETON} \ "may not destroy a singleton object" } method <cloned> -unexport {originObject} { - ::return -code error -errorcode {TCLOO SINGLETON} \ + ::return -code error -errorcode {TCL OO SINGLETON} \ "may not clone a singleton object" } } @@ -492,22 +492,22 @@ set prop [lindex $args $i] if {[string match "-*" $prop]} { return -code error -level 2 \ - -errorcode {TCLOO PROPERTY_FORMAT} \ + -errorcode {TCL OO PROPERTY_FORMAT} \ "bad property name \"$prop\": must not begin with -" } if {$prop ne [list $prop]} { return -code error -level 2 \ - -errorcode {TCLOO PROPERTY_FORMAT} \ + -errorcode {TCL OO PROPERTY_FORMAT} \ "bad property name \"$prop\": must be a simple word" } if {[string first "::" $prop] != -1} { return -code error -level 2 \ - -errorcode {TCLOO PROPERTY_FORMAT} \ + -errorcode {TCL OO PROPERTY_FORMAT} \ "bad property name \"$prop\": must not contain namespace separators" } if {[string match {*[()]*} $prop]} { return -code error -level 2 \ - -errorcode {TCLOO PROPERTY_FORMAT} \ + -errorcode {TCL OO PROPERTY_FORMAT} \ "bad property name \"$prop\": must not contain parentheses" } set realprop [string cat "-" $prop] @@ -630,10 +630,10 @@ dict incr opt -level 2 return -options $opt $msg } on break {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property getter for $prop did a break" } on continue {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property getter for $prop did a continue" } } @@ -671,10 +671,10 @@ dict incr opt -level 2 return -options $opt $msg } on break {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property getter for $prop did a break" } on continue {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property getter for $prop did a continue" } return $value @@ -711,10 +711,10 @@ dict incr opt -level 2 return -options $opt $msg } on break {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property setter for $prop did a break" } on continue {} { - return -code error -level 2 -errorcode {TCLOO SHENANIGANS} \ + return -code error -level 2 -errorcode {TCL OO SHENANIGANS} \ "property setter for $prop did a continue" } } |