diff --git a/analysis/numbers.d b/analysis/numbers.d index 2a75017..32637b7 100644 --- a/analysis/numbers.d +++ b/analysis/numbers.d @@ -11,7 +11,7 @@ import stdx.d.lexer; import analysis.base; /** - * Checks for use of the deprecated "delete" keyword + * Checks for long and hard-to-read number literals */ class NumberStyleCheck : BaseAnalyzer { @@ -26,8 +26,8 @@ class NumberStyleCheck : BaseAnalyzer { import std.algorithm; if (isNumberLiteral(t.type) && !t.text.startsWith("0x") - && ((t.text.startsWith("0b") && t.text.matchFirst(badBinaryRegex)) - || t.text.matchFirst(badDecimalRegex))) + && ((t.text.startsWith("0b") && !t.text.matchFirst(badBinaryRegex).empty) + || !t.text.matchFirst(badDecimalRegex).empty)) { addErrorMessage(t.line, t.column, "Use underscores to improve number constant readability"); diff --git a/build.bat b/build.bat index cdde7bd..4e24b5d 100644 --- a/build.bat +++ b/build.bat @@ -1 +1 @@ -dmd main.d stats.d imports.d highlighter.d ctags.d astprinter.d formatter.d outliner.d stdx/*.d stdx/d/*.d analysis/*.d -ofdscanner -m64 -g -O -release -noboundscheck -inline +dmd main.d stats.d imports.d highlighter.d ctags.d astprinter.d formatter.d outliner.d stdx/lexer.d stdx/d/ast.d stdx/d/entities.d stdx/d/lexer.d stdx/d/parser.d analysis/base.d analysis/del.d analysis/enumarrayliteral.d analysis/fish.d analysis/numbers.d analysis/objectconst.d analysis/package.d analysis/pokemon.d analysis/run.d analysis/style.d -ofdscanner -g -O -release -noboundscheck -inline