Re: [PATCH] userdiff: remove empty subexpression from elixir regex

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

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux