dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ben Elliston
Subject: PATCH: redefine $decimal, $hex, $text vars
Date: Wed, 12 Dec 2018 23:01:52 +1100
User-agent: NeoMutt/20170609 (1.8.3)

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  <address@hidden>

        * 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 <address@hidden>.
 
 # 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)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]