summaryrefslogtreecommitdiffstats
path: root/tools/tclOOScript.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2020-01-01 16:46:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2020-01-01 16:46:55 (GMT)
commit8249e877dffdca52ba20e0ffebdc9c7bd37c30ae (patch)
tree55925828ba3151b4deed527642db917d38755074 /tools/tclOOScript.tcl
parentb308bd97e6cdee90b11f3409a485253c414bbac0 (diff)
downloadtcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.zip
tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.gz
tcl-8249e877dffdca52ba20e0ffebdc9c7bd37c30ae.tar.bz2
More error cases
Diffstat (limited to 'tools/tclOOScript.tcl')
-rw-r--r--tools/tclOOScript.tcl14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl
index e10eda2..e918787 100644
--- a/tools/tclOOScript.tcl
+++ b/tools/tclOOScript.tcl
@@ -483,12 +483,22 @@
if {[string match "-*" $prop]} {
return -code error -level 2 \
-errorcode {TCLOO PROPERTY_FORMAT} \
- "bad property name \"$prop\"; must not begin with -"
+ "bad property name \"$prop\": must not begin with -"
}
if {$prop ne [list $prop]} {
return -code error -level 2 \
-errorcode {TCLOO PROPERTY_FORMAT} \
- "bad property name \"$prop\"; must be a simple word"
+ "bad property name \"$prop\": must be a simple word"
+ }
+ if {[string first "::" $prop] != -1} {
+ return -code error -level 2 \
+ -errorcode {TCLOO PROPERTY_FORMAT} \
+ "bad property name \"$prop\": must not contain namespace separators"
+ }
+ if {[string match {*[()]*} $prop]} {
+ return -code error -level 2 \
+ -errorcode {TCLOO PROPERTY_FORMAT} \
+ "bad property name \"$prop\": must not contain parentheses"
}
set realprop [string cat "-" $prop]
set getter [format {::set [my varname %s]} $prop]