Changeset 570


Ignore:
Timestamp:
Aug 11, 2010, 10:28:37 AM (9 years ago)
Author:
lindanl
Message:

error check for empty PI names

Location:
proto/parabix2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2.py

    r558 r570  
    167167        CtCDPI_starts = 0
    168168        PI_name_ends = 0
     169        PI_namestarts = 0
    169170        # Scanning streams
    170171        CtCDPI_scan = ~(lex.CtCD_start | lex.PI_start) & EOF_mask
     
    190191                #PI_Cursor = bitutil.ScanThru(PI_Cursor, PI_end_scan)
    191192                PI_Cursor = bitutil.Advance(PI_Cursor)
     193                PI_namestarts |= PI_Cursor
    192194                PI_name_end = bitutil.ScanThru(PI_Cursor, lex.NameScan)
    193195                PI_name_ends |= PI_name_end
     
    210212        callouts.error = Ct_ends & ~lex.RAngle | Ct_starts & ~ lex.Hyphen
    211213        callouts.error |= bitutil.Advance(PI_name_ends & ~ lex.WS) & ~ lex.PI_end
     214        callouts.error |= PI_namestarts & PI_name_ends
    212215        # If any of the Comment, CDATA or PI markups are unterminated, it is an error.
    213216        callouts.error |= callouts.CtCDPI_mask &~ EOF_mask
  • proto/parabix2/parabix2_compilable.py

    r567 r570  
    212212        CD_ends = 0
    213213        CtCDPI_starts = 0
     214        PI_namestarts = 0
    214215        PI_name_ends = 0
    215216
     
    237238                #PI_Cursor = bitutil.ScanThru(PI_Cursor, PI_end_scan)
    238239                PI_Cursor = bitutil.Advance(PI_Cursor)
     240                PI_namestarts |= PI_Cursor
    239241                PI_name_end = bitutil.ScanThru(PI_Cursor, lex.NameScan)
    240242                PI_name_ends |= PI_name_end
     
    254256        CT_callouts.error = Ct_ends & ~lex.RAngle | Ct_starts & ~ lex.Hyphen
    255257        CT_callouts.error |= bitutil.Advance(PI_name_ends & ~ lex.WS) & ~ lex.PI_end
     258        CT_callouts.error |= PI_namestarts & PI_name_ends
    256259        # If any of the Comment, CDATA or PI markups are unterminated, it is an error.
    257260        CT_callouts.error |= CT_callouts.CtCDPI_mask &~ EOF_mask
Note: See TracChangeset for help on using the changeset viewer.