public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH RFA] gdbhooks: regex syntax error
@ 2024-02-06 22:07 Jason Merrill
  2024-02-12 23:21 ` PING " Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Merrill @ 2024-02-06 22:07 UTC (permalink / raw)
  To: gcc-patches

Briefly tested that break-on-pass completion works.  Oddly, it also works
without the patch, but the fix still seems worthwhile.  OK for trunk?

-- 8< --

Recent python complains about this pattern with
  SyntaxWarning: invalid escape sequence '\s'
because \s in a regular string just means 's'; for it to mean whitespace,
you need \\ or for the pattern to be a raw string.

gcc/ChangeLog:

	* gdbhooks.py: Fix regex syntax.
---
 gcc/gdbhooks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index 3fa62652c61..92e38880a70 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -642,7 +642,7 @@ class PassNames:
         self.names = []
         with open(os.path.join(srcdir, 'passes.def')) as f:
             for line in f:
-                m = re.match('\s*NEXT_PASS \(([^,]+).*\);', line)
+                m = re.match(r'\s*NEXT_PASS \(([^,]+).*\);', line)
                 if m:
                     self.names.append(m.group(1))
 

base-commit: c5d34912ad576be1ef19be92f7eabde54b9089eb
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PING Re: [PATCH RFA] gdbhooks: regex syntax error
  2024-02-06 22:07 [PATCH RFA] gdbhooks: regex syntax error Jason Merrill
@ 2024-02-12 23:21 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2024-02-12 23:21 UTC (permalink / raw)
  To: gcc-patches

Ping

On 2/6/24 17:07, Jason Merrill wrote:
> Briefly tested that break-on-pass completion works.  Oddly, it also works
> without the patch, but the fix still seems worthwhile.  OK for trunk?
> 
> -- 8< --
> 
> Recent python complains about this pattern with
>    SyntaxWarning: invalid escape sequence '\s'
> because \s in a regular string just means 's'; for it to mean whitespace,
> you need \\ or for the pattern to be a raw string.
> 
> gcc/ChangeLog:
> 
> 	* gdbhooks.py: Fix regex syntax.
> ---
>   gcc/gdbhooks.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
> index 3fa62652c61..92e38880a70 100644
> --- a/gcc/gdbhooks.py
> +++ b/gcc/gdbhooks.py
> @@ -642,7 +642,7 @@ class PassNames:
>           self.names = []
>           with open(os.path.join(srcdir, 'passes.def')) as f:
>               for line in f:
> -                m = re.match('\s*NEXT_PASS \(([^,]+).*\);', line)
> +                m = re.match(r'\s*NEXT_PASS \(([^,]+).*\);', line)
>                   if m:
>                       self.names.append(m.group(1))
>   
> 
> base-commit: c5d34912ad576be1ef19be92f7eabde54b9089eb


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-12 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 22:07 [PATCH RFA] gdbhooks: regex syntax error Jason Merrill
2024-02-12 23:21 ` PING " Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).