This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Mauve, inner classes and dejagnu magic
Hi,
On Sat, 2003-02-15 at 00:44, Tom Tromey wrote:
> Ulrich> "string map {$ ^} $executable"
>
> `string map' is a relatively new addition to Tcl.
> What version of Tcl are you using?
> (runtest --version will tell you.)
Sorry didn't know that. runtest --version:
Expect version is 5.37.2
Tcl version is 8.3
Framework version is 1.4.2.x
> I don't know what versions we're supposed to support.
The gcc tests page only says DejaGnu 1.4.2 (or later), Tcl, and Expect.
But DejaGnu doesn't list its own dependencies.
> Anyway, rewriting this to use a regexp or something is pretty easy.
> Mark, could you do that? If not, tell me and I'll do it.
How does the following look? I am running a complete check with the
above setup now.
--- lib/libjava.exp 14 Feb 2003 22:17:00 -0000 1.49
+++ lib/libjava.exp 15 Feb 2003 10:47:53 -0000
@@ -788,7 +788,7 @@
foreach c_file $class_files {
set executable [file rootname [file tail $c_file]].o
# Don't write files which contain $ chars.
- set executable [string map {$ ^} $executable]
+ regsub -all "\\$" $executable "\^" executable
set x [libjava_prune_warnings \
[libjava_tcompile '$c_file' "$executable" $type $args]]
lappend removeList $executable
--- libjava.mauve/mauve.exp 14 Feb 2003 20:36:00 -0000 1.19
+++ libjava.mauve/mauve.exp 15 Feb 2003 09:53:33 -0000
@@ -49,7 +49,8 @@
# Now add all inner classes
foreach inner [glob -nocomplain [file rootname $file]$*.class] {
# Prevent excessive escaping by replacing $ with a ^ in the .o name
- set inner [string map {$ ^} [file rootname $inner]].o
+ set inner [file rootname $inner].o
+ regsub -all "\\$" $inner "\^" inner
lappend uses($item) $inner
}
}
@@ -186,7 +187,8 @@
if {! [file exists $obj]} then {
verbose "compiling $obj for test of $class"
# The .class file does contain a $, but we can quote it between "'"s.
- set srcfile [string map {^ $} [file rootname $obj]].class
+ set srcfile [file rootname $obj].class
+ regsub -all "\\^" $srcfile "\$" srcfile
set x [libjava_prune_warnings \
[libjava_tcompile '[pwd]/$srcfile' $obj object $compile_args]]
if {$x != ""} then {
Cheers,
Mark