Changeset 1199


Ignore:
Timestamp:
Jun 25, 2011, 12:38:46 PM (8 years ago)
Author:
cameron
Message:

Optimizations to avoid unnecessary whitespace scans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2_pablo.py

    r1076 r1199  
    426426                tag_Callouts.AttName_ends |= AttNameFollow
    427427                # Scan through WS to the expected '=' delimiter.
    428                 EqExpected = bitutil.ScanThru(AttNameFollow, lex.WS)
     428                # EqExpected = bitutil.ScanThru(AttNameFollow, lex.WS)
     429                # But use if test to optimize.
     430                if simd_and(AttNameFollow, lex.WS):
     431                        EqExpected = bitutil.ScanThru(AttNameFollow, lex.WS)
     432                else: EqExpected = AttNameFollow
    429433                EqToCheck |= EqExpected
    430434                AttValPos = bitutil.ScanThru(EqExpected, EqExpected | lex.WS)
     
    438442                AttValFollow = bitutil.Advance(AttValEnd)
    439443                tag_Callouts.AttVal_ends |= AttValFollow
     444                #  AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
     445                if simd_and(AttValFollow, lex.WS):
     446                        AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
     447                else: AfterWS = AttValFollow
    440448                AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
    441449                AttListEnd |= AfterWS & AttListDelim
     
    456464
    457465        # End Tag Parsing
    458         EndTagEnds = bitutil.ScanThru(bitutil.ScanThru(tag_Callouts.EndTag_marks, tag_Callouts.EndTag_marks | lex.NameScan), lex.WS)
     466
     467        EndTagEnds = bitutil.ScanThru(tag_Callouts.EndTag_marks, tag_Callouts.EndTag_marks | lex.NameScan)
     468        if simd_and(EndTagEnds, lex.WS):
     469                EndTagEnds = bitutil.ScanThru(EndTagEnds, lex.WS)
    459470        ParseError |= EndTagEnds & ~lex.RAngle
    460471        tag_Callouts.error = ParseError
     
    556567        Do_check_streams(ctCDPI_Callouts, tag_Callouts, lex, u8, scope1, ref_Callouts, xml_names, check_streams)
    557568
    558                
     569
Note: See TracChangeset for help on using the changeset viewer.