From b2b7fc3e17e2a721b271ed491e8d3f1f4c371b34 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sat, 1 Mar 2014 01:55:59 -0800 Subject: [PATCH] Fix issue with backwards range check dying on numbers with underscores --- analysis/range.d | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/analysis/range.d b/analysis/range.d index 286afe2..de6f857 100644 --- a/analysis/range.d +++ b/analysis/range.d @@ -65,18 +65,19 @@ class BackwardsRangeCheck : BaseAnalyzer override void visit(PrimaryExpression primary) { import std.conv; + import std.string; if (state == State.ignore || !isNumberLiteral(primary.primary.type)) return; if (state == State.left) { line = primary.primary.line; - column = primary.primary.column; - left = to!long(primary.primary.text); + this.column = primary.primary.column; + left = to!long(primary.primary.text.removechars("_")); hasLeft = true; } else { - right = to!long(primary.primary.text); + right = to!long(primary.primary.text.removechars("_")); hasRight = true; } }