harness: documentation reads through grep count (grep prefixes stripped before matching)
This commit is contained in:
1 parent
0972ed2a5e
commit
a2d72628e0
3 files changed
+22
-2
No files matched your search
@@ -38,6 +38,9 @@ import re
|
||||
from . import util
|
||||
|
||||
_PREFIX = re.compile(r"^\s*\d+\s*[:\t→│|]\s?")
|
||||
# grep/ripgrep output and the agents' grep tools: `path:12:text`, context
|
||||
# lines `path-12-text`, and `path:text` when several files are searched.
|
||||
_GREP = re.compile(r"^(?:/docs/\S+?|\S+\.md)(?::\d+[:-]|-\d+-|:)")
|
||||
|
||||
|
||||
def _tokenizer():
|
||||
@@ -51,7 +54,7 @@ def _tokenizer():
|
||||
|
||||
|
||||
def _norm(line):
|
||||
return _PREFIX.sub("", line).strip()
|
||||
return _PREFIX.sub("", _GREP.sub("", line, count=1)).strip()
|
||||
|
||||
|
||||
def tool_events_track_a(events_path):
|
||||
|
||||
Reference in new issue
Block a user