From: Dirk Gouders <dirk@gouders.net>
To: Andy Koppe <andy.koppe@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v2] utf8: add display_mode_esc_sequence_len_counted()
Date: Wed, 18 Nov 2026 19:38:53 +0100 [thread overview]
Message-ID: <ghik1uassi.fsf@gouders.net> (raw)
In-Reply-To: <CAHWeT-Yh8yTnG7rLjvO+XBtU=bZHJ3WWoQQsPfvJO013P2GSPA@mail.gmail.com>
On Wed, Nov 18 2026, Andy Koppe wrote:
>> Dirk Gouders <wrote:
>> And as far as I know, we would need an FSM to identify valid sequences
>> if we are going to allow colons.
> No. The parameter field can be any mix of digits, colons and
> semicolons. Semicolons separate parameters, colons separate
> subparameters, and individual (sub)parameters can be empty, which is
> equivalent to zero. If the field consists of nothing but colons,
> that's one parameter with multiple empty subparameters.
My statement was a bit misleading, because
display_mode_esc_sequence_len() already is an FSM
accepting the language "\033\[[0-9;]+m". My concern was that I doubt
that simply adding ":" to the alphabet and as valid input to the state
"parameter" (without introducing one or more new states) would still
let it accept only valid SGR sequences.
It seems I can learn something: is "\033[:;m" a valid SGR sequence?
But, such a discussion is difficult without defining what language you
want to accept. I guess the two links were meant as a definition and I
have to confess I didn't yet read them.
Regards,
Dirk
next prev parent reply other threads:[~2026-11-18 18:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 16:50 [PATCH] utf8: make display_mode_esc_sequence_len() take a length Junio C Hamano
2026-11-17 20:06 ` [PATCH v2] utf8: add display_mode_esc_sequence_len_counted() Junio C Hamano
2026-11-17 21:26 ` Dirk Gouders
2026-11-17 21:43 ` Junio C Hamano
2026-11-17 22:03 ` Dirk Gouders
2026-11-18 1:33 ` Junio C Hamano
2026-11-18 7:37 ` Dirk Gouders
2026-11-17 23:08 ` Andy Koppe
2026-11-17 23:25 ` Junio C Hamano
2026-11-18 6:59 ` Andy Koppe
2026-11-18 7:43 ` Dirk Gouders
2026-11-18 9:48 ` Andy Koppe
2026-11-18 18:38 ` Dirk Gouders [this message]
2026-11-18 19:12 ` Andy Koppe
2026-11-18 19:29 ` Dirk Gouders
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ghik1uassi.fsf@gouders.net \
--to=dirk@gouders.net \
--cc=andy.koppe@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.