PATCH: redefine $decimal, $hex, $text vars

Ben Elliston <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
I think this patch is an improvement becaue it (a) is much more
readable and (b) matches non-ASCII characters when non-English locales
are used.

OK?
Ben


2018-12-12  Ben Elliston  <[email protected]>

        * runtest.exp (hex): Simplify using Tcl regexp character
        classes.
        (decimal): Likewise.
        * lib/target.exp (text): Likewise. Replace a range of
        punctuation characters with the [:punct:] character class
        which is more permissive.

diff --git a/lib/target.exp b/lib/target.exp
index 2620e30..dc0f5c4 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -20,7 +20,7 @@
 # extensively modified by Bob Manson <[email protected]>.
 
 # A hairy pattern to recognize text.
-set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]"
+set text {[ [:alnum:][:punct:]]}
 
 # This is a collection of support procs for the target data
 # structures. We use a named array, since Tcl has no real data
diff --git a/runtest.exp b/runtest.exp
index 09ffcf0..8bf852f 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -105,8 +105,8 @@ unset -nocomplain env(CCACHE_NODISABLE)
 #
 # some convenience abbreviations
 #
-set hex "0x\[0-9A-Fa-f\]+"
-set decimal "\[0-9\]+"
+set hex {[[:xdigit:]]}
+set decimal {[[:digit:]]}
 
 #
 # set the base dir (current working directory)

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEFS8+rdM1/2KWERKFZ9rcPj90NkkFAlwQ+LAACgkQZ9rcPj90
Nkmrog//bRQXsf+uoYsoCrvB/H9APhhjgFNNFK2hRRXLLzf3HJ677yOxNB45Kkx2
bmWHaNa/Py1v0DyBm24YQK2Bwo3mIY/01DJv6+ROM/rbGihlsjEssY/TDbL0wYSS
tl5IU/VsqkFXS6XA7ydtjfPg5EB+h345PaC+bnTnY7oiwooDzaVaeVgqZmA/GJ67
3u3PstnAH670qriYK2ewfj7EMaPiKMw/U0AZc2u8H6/Lc1hexV6uwSIkuU8RY52p
0GtZ+Y/iQWP/EF91jOBaMSnxLX6DEBPI9xBs9AaYZQPDlNOowh6+gxsEid5qYOuU
S1GyKxyzpxH6/9+VVRm868nVDvxtYdBCO4aQlIhoheoGUd5P/gheWYwZJNKFLNju
qCsyQjTWVTY8qjbQkdEZA5mhCE+ZBYwx2opBE9Qma0HMVY25WyIMBbCU6GJVdxHy
bE7aaEkQHfYNyhSg8fj4t8xpkIEPQPZQMnDnTH7tgWWr7isms5HjNtzmf929hlMD
dnX+sv8Yx/wTlmbIUIboNZRI5WlVbaCweHEVWuVAjpCeHG2YOSC4ZJiVEAC6vi8V
eYW5meK/7EAFUxbIasQF2LpUGtRYDyi975/3Dj/TzZR8tgOlOnIzM0WG2vr8QzOK
MtC+D7V6KesNtu4SpnMjPhim/Gh4nglg4YtRFe475S8m3XclKI4=
=0hya
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.