[m-rev.] New regex module in extras/lex

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 28 14:58:49 AEDT 2002


On 28-Nov-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > These bug fixes (and the license fix) should be committed to the release
> > branch.  As for the other changes, well, since this package is in the
> > extras distribution, I guess it is a low risk change.  So I would not
> > object to them being included in the release branch if they are ready
> > in time.  But they are certainly not release-critical, so I will not
> > be holding up the release branch for them.
> 
> I'd like this to go in the release.  It's been fairly heavily tested the
> last few days.

Hmm... if it has been reviewed thoroughly, and all the review comments
are addressed, and it has been committed to the main branch, and it
doesn't cause any additional failures there, then maybe we can also
commit it on the release branch.

I don't have time to review this thoroughly right now.
However, I did notice one serious problem (see below).
I think fixing this will require non-trivial changes.

> +++ README.regex	26 Nov 2002 01:08:56 -0000
> @@ -0,0 +1,70 @@
> +THE REGEX MODULE
> +
> +The regex/1 function converts standard string-type regular expression
> +definitions into values of type regex.
> +
> +EXAMPLE OF REGEXES
> +
> +regex(".")		matches any char except `\n'
> +regex("abc")		matches `abc'
> +regex("abc*")		matches zero or more contiguous occurrences of `abc'

That's different to the meaning used by "grep" or "perl".
In those programs, `abc*' is `ab' followed by zero or more
contiguous occurrences of `c'.  That is, "*" binds tighter
than juxtaposition.  (There are probably similar issues for
other operators.  I didn't check in detail.)

So, when you said "standard" string-type regular expression definitions,
which standard were you referring to?

If this is a difference between POSIX regexps and grep/perl regexps,
then the documentation should explain that clearly.

If this is just an unintended difference, then it should be fixed.
Also, there should be some additional tests to test that these
regexps behave the same as those in one of the other popular tools
that uses regexps, e.g. grep, sed, or perl.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list