Changeset 608 for trunk/scilexer

Show
Ignore:
Timestamp:
08/15/09 21:37:38 (3 years ago)
Author:
SnakE
Message:

Hex floats MUST have exponent

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/scilexer/LexD.cxx

    r434 r608  
    295295        { 
    296296            colourizer.colourExcl(SCE_D_NUMBER); 
    297             StatePtr suffix; 
    298             if (part == NumberPart::integer) 
    299                 suffix = StatePtr(new IntegerSuffix); 
     297            // HACK: Hex floats *must* have exponent 
     298            if (part == NumberPart::fractional && strchr(exponent, 'p')) 
     299            { 
     300                colourizer.colourIncl(SCE_D_NUMBER_ERROR); 
     301                return NewDefaultState(); 
     302            } 
    300303            else 
    301                 suffix = StatePtr(new FloatSuffix); 
    302             return suffix->onChar(ch, colourizer); 
     304            { 
     305                StatePtr suffix; 
     306                if (part == NumberPart::integer) 
     307                    suffix = StatePtr(new IntegerSuffix); 
     308                else 
     309                    suffix = StatePtr(new FloatSuffix); 
     310                return suffix->onChar(ch, colourizer); 
     311            } 
    303312        } 
    304313