git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Ed Maste <emaste@FreeBSD.org>
Cc: git@vger.kernel.org, lukasz@niemier.pl
Subject: Re: [PATCH] userdiff: remove empty subexpression from elixir regex
Date: Fri, 13 Dec 2019 12:45:42 -0500	[thread overview]
Message-ID: <20191213174542.GB117158@coredump.intra.peff.net> (raw)
In-Reply-To: <20191213173902.71541-1-emaste@FreeBSD.org>

On Fri, Dec 13, 2019 at 05:39:02PM +0000, Ed Maste wrote:

> diff --git a/userdiff.c b/userdiff.c
> index 324916f20f..165d7e8653 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -35,7 +35,7 @@ PATTERNS("dts",
>  PATTERNS("elixir",
>  	 "^[ \t]*((def(macro|module|impl|protocol|p)?|test)[ \t].*)$",
>  	 /* Atoms, names, and module attributes */
> -	 "|[@:]?[a-zA-Z0-9@_?!]+"
> +	 "[@:]?[a-zA-Z0-9@_?!]+"
>  	 /* Numbers with specific base */
>  	 "|[-+]?0[xob][0-9a-fA-F]+"
>  	 /* Numbers */

It took me a minute to see why this was different than the similar
"Numbers" line below. The issue is the comma at the end of the previous
line; this is starting a new string, whereas the "Numbers" line is
pasting to the existing string.

And that is the right thing, since these strings are the funcname and
word_regex patterns, respectively.

So I think this is the correct fix. Many of the other regexes in this
list use "/* -- */" to seperate the two for readability. Maybe worth
doing here, too?

-Peff

  reply	other threads:[~2019-12-13 17:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 17:39 [PATCH] userdiff: remove empty subexpression from elixir regex Ed Maste
2019-12-13 17:45 ` Jeff King [this message]
2019-12-13 14:11   ` Ed Maste
2019-12-13 17:55 ` [PATCH v2] " Ed Maste
2019-12-13 18:18   ` Jeff King
2019-12-13 19:24   ` Johannes Sixt
2019-12-13 15:58     ` Ed Maste
2019-12-13 20:23       ` Junio C Hamano
2019-12-13 20:59 ` Numbers with specific base (was: [PATCH] userdiff: remove empty subexpression from elixir regex) Achim Gratz
2019-12-13 22:00   ` Numbers with specific base Junio C Hamano

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: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213174542.GB117158@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=emaste@FreeBSD.org \
    --cc=git@vger.kernel.org \
    --cc=lukasz@niemier.pl \
    /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://80x24.org/mirrors/git.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).