Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3400

Show
Ignore:
Timestamp:
03/27/08 04:44:32 (8 months ago)
Author:
jascha
Message:

fixed: negated char-classes matched the virtual EOS = 0 character (this closes #1006)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/text/Regex.d

    r3384 r3400  
    19981998        debug(tnfa) Stdout.formatln(" {}", pattern[oldCursor..cursor]); 
    19991999 
    2000         if ( negated ) 
    2001             trans.predicate.negate; 
     2000        if ( negated ) { 
     2001            auto tmp = cc_t(cc_t.any_char); 
     2002            tmp.subtract(trans.predicate.input); 
     2003            trans.predicate.input = tmp; 
     2004        } 
    20022005        else 
    20032006            trans.predicate.optimize; 
     
    24022405                        continue; 
    24032406                    for ( char_t c = p.l_; c <= min(p.r_, LOOKUP_LENGTH-1); ++c ) 
    2404                         lookup[c] = cast(ubyte) i; 
     2407                        lookup[c] = cast(ubyte)i; 
    24052408                } 
    24062409            }