Changeset 69

Show
Ignore:
Timestamp:
08/01/06 22:52:42 (2 years ago)
Author:
Gregor
Message:

Support for hex #define's

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bcd.gen/bcd/gen/bcdgen.d

    r67 r69  
    293293bool isNumeric(char[] str) 
    294294{ 
    295     bool hase; 
    296     bool hasdot; 
     295    bool hase, hasdot, ishex; 
    297296     
    298297    for (int i = 0; i < str.length; i++) { 
    299298        char c = str[i]; 
    300299        if (c >= '0' && c <= '9') continue; 
     300        if (ishex && 
     301            ((c >= 'a' && c <= 'f') || 
     302             (c >= 'A' && c <= 'F'))) continue; 
     303             
    301304         
    302305        if (c == 'e' || c == 'E') { 
     
    304307            hase = true; 
    305308        } else if (c == 'x' || c == 'X') { 
     309            ishex = true; 
    306310            if (i != 1) return false; 
    307311            if (str[0] != '0') return false;