>>>>> "UG" == Uri Guttman <[EMAIL PROTECTED]> writes:

>>>>> "BR" == Bernardo Rechea <[EMAIL PROTECTED]> writes:

  BR> 1.  Ack's context is heavily line-oriented. Would it be too
  BR> difficult to make the fixes generic enough to parameterize the
  BR> type of context unit that is shown (i.e., not only lines, but also
  BR> words or characters, etc.).

  BR> 2.  Another issue with exclusive line-orientation is that ack
  BR> can't search across line boundaries (I'm not 100% sure, so if I'm
  BR> wrong, please correct me).

i have been mulling over those ideas and i think i have something which
may sort of work. instead of the array of lines for the shift register,
we use a string buffer as a text shift register. (this is only for when
the word/char context options are selected). new lines get appended to
the buffer, and matches are done against the buffer text. the match will
include the appropriate amount of context to grab (optional as it could
be near begin or eof). you would also need to only match when you have
enough context in the buffer (like the before/after logic we are using
for the line version). once a match is found it is printed immediately
since we know we have all the desired context in the match already and
we grabbed the whole match. and we can trim off text from the beginning
of the buffer when we have enough text in it. plenty to be worked out
but i think the concept is valid.

but let's see how the lines versions goes before we tackle these
options.

thanx,

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to