Fixed float lexing and static analysis issues

This commit is contained in:
Hackerpilot 2014-01-20 20:34:30 -08:00
parent 8a444fbd89
commit 2cf405896a
7 changed files with 9 additions and 10 deletions

View File

@ -1486,7 +1486,7 @@ class XMLPrinter : ASTVisitor
output.writeln("</xorExpression>"); output.writeln("</xorExpression>");
} }
alias ASTVisitor.visit visit; alias visit = ASTVisitor.visit;
private static string xmlEscape(string s) private static string xmlEscape(string s)
{ {

View File

@ -12,7 +12,7 @@ dmd\
analysis/*.d\ analysis/*.d\
-ofdscanner\ -ofdscanner\
-m64\ -m64\
-O -release -inline -noboundscheck -O -release -noboundscheck
#gdc\ #gdc\
# main.d\ # main.d\

View File

@ -134,7 +134,7 @@ class CTagsPrinter : ASTVisitor
dec.accept(this); dec.accept(this);
} }
alias ASTVisitor.visit visit; alias visit = ASTVisitor.visit;
string fileName; string fileName;
string[] tagLines; string[] tagLines;

View File

@ -31,7 +31,7 @@ class ImportPrinter : ASTVisitor
} }
} }
alias ASTVisitor.visit visit; alias visit = ASTVisitor.visit;
bool ignore = true; bool ignore = true;
} }

3
main.d
View File

@ -51,9 +51,10 @@ int main(string[] args)
"tokenDump", &tokenDump, "styleCheck", &styleCheck, "tokenDump", &tokenDump, "styleCheck", &styleCheck,
"muffinButton", &muffin); "muffinButton", &muffin);
} }
catch (Exception e) catch (ConvException e)
{ {
stderr.writeln(e.msg); stderr.writeln(e.msg);
return 1;
} }
if (muffin) if (muffin)

View File

@ -160,7 +160,7 @@ class Outliner : ASTVisitor
int indentLevel; int indentLevel;
alias ASTVisitor.visit visit; alias visit = ASTVisitor.visit;
File output; File output;
} }

View File

@ -715,13 +715,11 @@ public struct DLexer
lexExponent(type); lexExponent(type);
break decimalLoop; break decimalLoop;
case '.': case '.':
if (foundDot) if (foundDot || !range.canPeek(1) || range.peek(1)[1] == '.')
break decimalLoop;
auto lookahead = range.peek(2);
if (lookahead.length == 2 && lookahead[1] == '.')
break decimalLoop; break decimalLoop;
else else
{ {
auto lookahead = range.peek(1);
// The following bit of silliness tries to tell the // The following bit of silliness tries to tell the
// difference between "int dot identifier" and // difference between "int dot identifier" and
// "double identifier". // "double identifier".