All of lore.kernel.org
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: git@vger.kernel.org
Subject: Numbers with specific base (was: [PATCH] userdiff: remove empty subexpression from elixir regex)
Date: Fri, 13 Dec 2019 21:59:13 +0100	[thread overview]
Message-ID: <87tv64ymam.fsf@Rainer.invalid> (raw)
In-Reply-To: 20191213173902.71541-1-emaste@FreeBSD.org


Nothing to do with the patch from Ed, but the regex following his
correction matches a lot of things that decidedly are not "Numbers with
specific bases" as it claims to do in the comment.

Ed Maste writes:
>  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]+"

Here, things like "+0bad" would match as a base 2 number, which doesn't
seem right.  If it's intended to match that broadly, I'd have expected a
comment to that effect.  Maybe something like

"|[-+]?0b[01]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+"

or (if the resulting group is not a problem someplace else)

"|[-+]?0(b[01]+|o[0-7]+|x[0-9a-fA-F]+)"

to more specifically match only what the comment says?



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada


  parent reply	other threads:[~2019-12-13 20:59 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
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 ` Achim Gratz [this message]
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

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

  git send-email \
    --in-reply-to=87tv64ymam.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=git@vger.kernel.org \
    /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.