bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#37659: rx additions: anychar, unmatchable, unordered-or


From: Mattias Engdegård
Subject: bug#37659: rx additions: anychar, unmatchable, unordered-or
Date: Tue, 8 Oct 2019 11:36:44 +0200

Three minor rx additions follow:

* Add `anychar' as an alias for `anything': the latter suggests an expression 
that can match any string, while in reality it only matches a single character. 
The documentation now uses `anychar' as the preferred name. (`any-char' would 
also be possible, but is longer.)

* Add `unmatchable' for a never-match regexp. This follows the previously 
introduced variable `regexp-unmatchable'.

* Add `unordered-or' as a variant of `or' without the left-to-right match order 
guarantee. It allows unconditional regexp-opt optimisations, and is 
particularly useful for matching sets of keywords. With rx-let and rx-define, 
it also has the potential for better compositionality, allowing expressions to 
be put together from smaller parts.

Abstractly: while `or' is associative, `unordered-or' is also commutative.

The name `unordered-or' is descriptive but phonetically (and lexically) 
somewhat weak. Strong alternatives welcome.

Attachment: 0001-Add-anychar-as-alias-to-anything-in-rx.patch
Description: Binary data

Attachment: 0002-Add-unmatchable-as-alias-for-or-in-rx.patch
Description: Binary data

Attachment: 0003-Add-rx-unordered-or-construct.patch
Description: Binary data


reply via email to

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