bug-guile
[Top][All Lists]
Advanced

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

Re: [PATCH] reader.test fix for cygwin


From: Ludovic Courtès
Subject: Re: [PATCH] reader.test fix for cygwin
Date: Tue, 10 Jun 2008 20:41:57 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi Neil,

"Neil Jerram" <address@hidden> writes:

> These are fixed by the patch below - which I think is correct for all
> platforms, because unescaped ( and ) perform grouping in Guile
> regexps.  In these tests we want literal ( and ), so they should be
> escaped.

Right, this is because `pass-if-exception' uses `string-match', which
uses `make-regexp' with no flags, which defaults to `extended' regexps
where literal brackets must be escaped.  So your patch is OK.

However, strangely enough, not escaping brackets also works on
GNU/Linux:

  guile> (string-match ")" ")")
  #(")" (0 . 1))
  guile> (string-match "\\)" ")")
  #(")" (0 . 1))

... even though unescaped brackets are normally used for grouping:

  guile> (string-match "^(.*)$" "hello")
  #("hello" (0 . 5) (0 . 5))
  guile> (string-match "^\\(.*\\)$" "hello")
  #f

I would have expected `(make-regexp ")")' to just fail, as is the case
on Cygwin.  Interestingly, `(make-regexp "(")' *does* fail.  Is this a
bug in `regcomp(3)'?

Thanks,
Ludovic.





reply via email to

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