From 2cf405896acfa587e3fbff622bf3fb1a08071fe8 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 20 Jan 2014 20:34:30 -0800 Subject: [PATCH] Fixed float lexing and static analysis issues --- astprinter.d | 2 +- build.sh | 2 +- ctags.d | 2 +- imports.d | 2 +- main.d | 3 ++- outliner.d | 2 +- stdx/d/lexer.d | 6 ++---- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/astprinter.d b/astprinter.d index 128f5a4..88cad63 100644 --- a/astprinter.d +++ b/astprinter.d @@ -1486,7 +1486,7 @@ class XMLPrinter : ASTVisitor output.writeln(""); } - alias ASTVisitor.visit visit; + alias visit = ASTVisitor.visit; private static string xmlEscape(string s) { diff --git a/build.sh b/build.sh index 297dd12..69001e9 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ dmd\ analysis/*.d\ -ofdscanner\ -m64\ - -O -release -inline -noboundscheck + -O -release -noboundscheck #gdc\ # main.d\ diff --git a/ctags.d b/ctags.d index 37677da..a8597ac 100644 --- a/ctags.d +++ b/ctags.d @@ -134,7 +134,7 @@ class CTagsPrinter : ASTVisitor dec.accept(this); } - alias ASTVisitor.visit visit; + alias visit = ASTVisitor.visit; string fileName; string[] tagLines; diff --git a/imports.d b/imports.d index 772a297..fed4460 100644 --- a/imports.d +++ b/imports.d @@ -31,7 +31,7 @@ class ImportPrinter : ASTVisitor } } - alias ASTVisitor.visit visit; + alias visit = ASTVisitor.visit; bool ignore = true; } diff --git a/main.d b/main.d index b48f67f..1d11354 100644 --- a/main.d +++ b/main.d @@ -51,9 +51,10 @@ int main(string[] args) "tokenDump", &tokenDump, "styleCheck", &styleCheck, "muffinButton", &muffin); } - catch (Exception e) + catch (ConvException e) { stderr.writeln(e.msg); + return 1; } if (muffin) diff --git a/outliner.d b/outliner.d index bfec52e..dab24ec 100644 --- a/outliner.d +++ b/outliner.d @@ -160,7 +160,7 @@ class Outliner : ASTVisitor int indentLevel; - alias ASTVisitor.visit visit; + alias visit = ASTVisitor.visit; File output; } diff --git a/stdx/d/lexer.d b/stdx/d/lexer.d index fb21436..82a4dcf 100644 --- a/stdx/d/lexer.d +++ b/stdx/d/lexer.d @@ -715,13 +715,11 @@ public struct DLexer lexExponent(type); break decimalLoop; case '.': - if (foundDot) - break decimalLoop; - auto lookahead = range.peek(2); - if (lookahead.length == 2 && lookahead[1] == '.') + if (foundDot || !range.canPeek(1) || range.peek(1)[1] == '.') break decimalLoop; else { + auto lookahead = range.peek(1); // The following bit of silliness tries to tell the // difference between "int dot identifier" and // "double identifier".