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:
> > 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.
OK tests went well. I am installing it as follows to branch and
mainline. Sorry for the inconvenience.
2003-02-15 Mark Wielaard <mark@klomp.org>
* lib/libjava.exp (test_libjava_from_javac): Use regsub not string map.
* libjava.mauve/mauve.exp (mauve_compute_uses):Likewise
(test_mauve):Likewise.
Cheers,
Mark
Index: lib/libjava.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/lib/libjava.exp,v
retrieving revision 1.49
diff -u -r1.49 libjava.exp
--- lib/libjava.exp 14 Feb 2003 22:17:00 -0000 1.49
+++ lib/libjava.exp 15 Feb 2003 16:15:32 -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
Index: libjava.mauve/mauve.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.mauve/mauve.exp,v
retrieving revision 1.19
diff -u -r1.19 mauve.exp
--- libjava.mauve/mauve.exp 14 Feb 2003 20:36:00 -0000 1.19
+++ libjava.mauve/mauve.exp 15 Feb 2003 16:15:32 -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 {