This commit is contained in:
Hackerpilot 2014-02-03 01:04:05 -08:00
commit f461c42755
2 changed files with 4 additions and 4 deletions

View File

@ -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");

View File

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