changeset 538:d0d40bcca9c6

Added assert() to Lexer.finalizeFloat().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 18 Dec 2007 22:22:30 +0100
parents db7913148b29
children 3418027c3914
files trunk/src/dil/Lexer.d
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Lexer.d	Tue Dec 18 21:23:52 2007 +0100
+++ b/trunk/src/dil/Lexer.d	Tue Dec 18 22:22:30 2007 +0100
@@ -2227,12 +2227,14 @@
     default:
       t.type = TOK.Float64;
       t.double_ = strtod(buffer.ptr, null);
-      break;
     }
     if (*p == 'i')
     {
       ++p;
       t.type += 3; // Switch to imaginary counterpart.
+      assert(t.type == TOK.Imaginary32 ||
+             t.type == TOK.Imaginary64 ||
+             t.type == TOK.Imaginary80);
     }
     if (errno() == ERANGE)
       error(t.start, MID.OverflowFloatNumber);