Changeset 3980 for proto


Ignore:
Timestamp:
Aug 8, 2014, 9:26:04 PM (5 years ago)
Author:
cameron
Message:

Fixes for catgrep

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/unicode_category_compiler.py

    r3979 r3980  
    277277           subrangeE = matched_sequence_compiler(cgo, lo2, hi2, ulen)
    278278           if options.grep:
    279               target = "output.matches"
     279              target = "all_matches"
    280280           else:
    281281              target = "struct_%s.cc" % k
     
    314314   for k in charClassMap.keys():
    315315     if options.grep:
    316          cgo.add_assignment("output.matches", '0')
     316         cgo.add_assignment("all_matches", '0')
    317317     else:
    318318         cgo.add_assignment("struct_%s.cc" % k, '0')
     
    367367        temp5 = (basis_bits.bit_6 &~ basis_bits.bit_7)
    368368        temp6 = (temp4 & temp5)
    369         LF = (temp6 &~ temp3)
     369        lex.LF = (temp6 &~ temp3)
    370370
    371371"""
     
    382382  else:
    383383      code = generateCharClassDefs(defaultIfRangeList, catmap)
     384  if options.grep:
     385      code += r"""
     386        output.matches = 0
     387        if all_matches:
     388                # Find the last match on each line and filter out all others
     389                output.matches = pablo.MatchStar(all_matches, ~lex.LF) & lex.LF
     390"""
    384391  return struct + header + "".join(code) + main
    385392
Note: See TracChangeset for help on using the changeset viewer.