[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60196: 29.0.60; re-builder should read all forms for the rx syntax
From: |
Mattias Engdegård |
Subject: |
bug#60196: 29.0.60; re-builder should read all forms for the rx syntax |
Date: |
Fri, 30 Dec 2022 13:28:14 +0100 |
The handling of rx input in re-builder is indeed unsatisfactory. We could adopt
your proposed solution:
> Ideally, re-builder should allow users to simply write
>
> "<i>" (group (*? anychar)) "</i>"
which would be a definite improvement. We could also accept a Lisp expression
that is evaluated, so that you'd write
(rx "<i>" (group (*? anychar)) "</i>")
On the surface this looks more verbose, but since re-builder itself would
provide the `(rx )` boilerplate, there wouldn't actually be any more typing.
The main advantage would be that regexps could be built up from smaller pieces:
(rx-let ((spaces (* " "))
(identifier (: alpha (* alnum))))
(rx identifier spaces "->" spaces identifier))
Either would be a definite improvement to the current rather strange re-builder
behaviour with respect to rx input. Any preference?