From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Vladimir Kazanov <vekazanov@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 69714@debbugs.gnu.org
Subject: bug#69714: [PATCH] Improve ert-font-lock assertion parser
Date: Mon, 1 Apr 2024 10:04:44 +0200 [thread overview]
Message-ID: <DDDF2F68-4603-4291-85A3-FAA89A9FC497@gmail.com> (raw)
In-Reply-To: <CAAs=0-3rXpF1Q6dMO_WAqZhS_-Pw1VnGxdsiVmd1oiiLbWcCPQ@mail.gmail.com>
31 mars 2024 kl. 19.56 skrev Vladimir Kazanov <vekazanov@gmail.com>:
> (rx "("
> (* whitespace)
> - (one-or-more
> - (seq (regexp ert-font-lock--face-symbol-re)
> - (* whitespace)))
> + (opt (regexp ert-font-lock--face-symbol-re))
> + (zero-or-more
> + (seq (+ whitespace)
> + (regexp ert-font-lock--face-symbol-re)))
> + (* whitespace)
> ")")
Since you want to match zero or more symbols, this can be improved further:
(rx "("
(* whitespace)
(* (regexp ert-font-lock--face-symbol-re)
(+ whitespace)))
")")
(Note that most rx operators have an implicit `seq` inside.)
You may want to use ´rx-define` instead of `defconst` as well -- it avoids some use of the `regexp` construct and removes some load-time string building.
next prev parent reply other threads:[~2024-04-01 8:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-10 20:31 bug#69714: 30.0.50; ert-font-lock doesn't handle list of faces Troy Brown
2024-03-11 8:36 ` Vladimir Kazanov
2024-03-12 20:46 ` Vladimir Kazanov
2024-03-13 16:14 ` Troy Brown
2024-03-13 17:04 ` Vladimir Kazanov
2024-03-13 17:48 ` Troy Brown
2024-03-13 18:20 ` Vladimir Kazanov
2024-03-15 11:47 ` bug#69714: [PATCH] Improve ert-font-lock assertion parser (Bug#69714) Vladimir Kazanov
2024-03-28 9:41 ` Eli Zaretskii
2024-03-30 12:52 ` bug#69714: [PATCH] Improve ert-font-lock assertion parser Mattias Engdegård
2024-03-31 17:56 ` Vladimir Kazanov
2024-04-01 8:04 ` Mattias Engdegård [this message]
2024-04-01 8:17 ` Mattias Engdegård
2024-04-01 8:34 ` Vladimir Kazanov
2024-04-01 9:08 ` Mattias Engdegård
2024-04-01 9:12 ` Vladimir Kazanov
2024-04-01 9:15 ` Mattias Engdegård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DDDF2F68-4603-4291-85A3-FAA89A9FC497@gmail.com \
--to=mattias.engdegard@gmail.com \
--cc=69714@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=vekazanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).