summaryrefslogtreecommitdiffstats
path: root/library/auto.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-03-19 21:57:29 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-03-19 21:57:29 (GMT)
commitbb7105fe9e61473e34a6dfa06700dbc252afeb19 (patch)
tree442e8a70c6a7eb9cab94e31ce02f4e195e3956b3 /library/auto.tcl
parent2f7a25d9e6cc43c401cbb12b0a35adca9ba526ca (diff)
downloadtcl-bb7105fe9e61473e34a6dfa06700dbc252afeb19.zip
tcl-bb7105fe9e61473e34a6dfa06700dbc252afeb19.tar.gz
tcl-bb7105fe9e61473e34a6dfa06700dbc252afeb19.tar.bz2
* library/auto.tcl: Replaced [regexp] and [regsub] with
* library/history.tcl: [string map] where possible. Thanks * library/ldAout.tcl: to David Welton. [Bugs 667456,667558] * library/safe.tcl: Bumped to http 2.4.3, opt 0.4.5, and * library/http/http.tcl: tcltest 2.2.3. * library/http/pkgIndex.tcl: * library/opt/optparse.tcl: * library/opt/pkgIndex.tcl: * library/tcltest/tcltest.tcl: * library/tcltest/pkgIndex.tcl: * tools/genStubs.tcl: * tools/tcltk-man2html.tcl: * unix/mkLinks.tcl:
Diffstat (limited to 'library/auto.tcl')
-rw-r--r--library/auto.tcl16
1 files changed, 7 insertions, 9 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index 4c736fe..217d1c4 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl dealing with auto execution
# of commands and can be auto loaded themselves.
#
-# RCS: @(#) $Id: auto.tcl,v 1.12 2002/10/28 16:34:25 dgp Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.13 2003/03/19 21:57:40 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -337,8 +337,8 @@ proc auto_mkindex_parser::mkindex {file} {
# in case there were any $ in the proc name. This will cause a problem
# if somebody actually tries to have a \0 in their proc name. Too bad
# for them.
- regsub -all {\$} $contents "\0" contents
-
+ set contents [string map [list \$ \0] $contents]
+
set index ""
set contextStack ""
set imports ""
@@ -418,8 +418,7 @@ proc auto_mkindex_parser::commandInit {name arglist body} {
if {[string equal $ns ""]} {
set fakeName "[namespace current]::_%@fake_$tail"
} else {
- set fakeName "_%@fake_$name"
- regsub -all {::} $fakeName "_" fakeName
+ set fakeName [string map {:: _} "_%@fake_$name"]
set fakeName "[namespace current]::$fakeName"
}
proc $fakeName $arglist $body
@@ -429,7 +428,7 @@ proc auto_mkindex_parser::commandInit {name arglist body} {
# we have to build procs with the fully qualified names, and
# have the procs point to the aliases.
- if {[regexp {::} $name]} {
+ if {[string match "*::*" $name]} {
set exportCmd [list _%@namespace export [namespace tail $name]]
$parser eval [list _%@namespace eval $ns $exportCmd]
@@ -484,11 +483,10 @@ proc auto_mkindex_parser::fullname {name} {
} elseif {![string match ::* $name]} {
set name "::$name"
}
-
+
# Earlier, mkindex replaced all $'s with \0. Now, we have to reverse
# that replacement.
- regsub -all "\0" $name "\$" name
- return $name
+ return [string map [list \0 \$] $name]
}
# Register all of the procedures for the auto_mkindex parser that