Update numbers.d
Fix #91. 2.064.2 does not have opCast(bool) defined in Captures, so check the result of empty().
This commit is contained in:
parent
451be80c5a
commit
a39b492e21
|
@ -26,8 +26,8 @@ class NumberStyleCheck : BaseAnalyzer
|
||||||
{
|
{
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
if (isNumberLiteral(t.type) && !t.text.startsWith("0x")
|
if (isNumberLiteral(t.type) && !t.text.startsWith("0x")
|
||||||
&& ((t.text.startsWith("0b") && t.text.matchFirst(badBinaryRegex))
|
&& ((t.text.startsWith("0b") && !t.text.matchFirst(badBinaryRegex).empty)
|
||||||
|| t.text.matchFirst(badDecimalRegex)))
|
|| !t.text.matchFirst(badDecimalRegex).empty))
|
||||||
{
|
{
|
||||||
addErrorMessage(t.line, t.column,
|
addErrorMessage(t.line, t.column,
|
||||||
"Use underscores to improve number constant readability");
|
"Use underscores to improve number constant readability");
|
||||||
|
|
Loading…
Reference in New Issue