Re: Numbers with specific base

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

 



Achim Gratz <Stromeko@xxxxxxxx> writes:

> 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.

No need for such a comment, as it is implicit that we assume the
user writes reasonable text that our patterns try to match.



[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