Changeset 3428 for proto/RE


Ignore:
Timestamp:
Aug 13, 2013, 12:16:21 AM (6 years ago)
Author:
ksherdy
Message:

Fixed line counting.

Location:
proto/RE/demo
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • proto/RE/demo/grep_demo.py

    r3426 r3428  
    191191  # WriteStreamOutput(Output)
    192192        if(options.count):
    193                 print str(pablo.popcount(matches.all_matches))
     193                print str(pablo.PopCount(pablo.MatchStar(matches.all_matches, ~lex.LF) & lex.LF))
    194194        else:
    195195          lgth = len(data)
  • proto/RE/demo/pablo.py

    r3424 r3428  
    170170        return ~Advance(~0)
    171171
    172 def popcount(stream):
     172def PopCount(stream):
    173173        count = 0
    174174        while(stream > 0):
     
    176176                stream >>= 1
    177177        return count
     178
     179def MatchStar(marker, scanclass):
     180  return (((marker & scanclass) + scanclass) ^ scanclass) | marker
    178181
    179182def SpanUpTo(starts, ends):
Note: See TracChangeset for help on using the changeset viewer.