-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the TODO test in ack-w.t #14
Comments
More specifically, this one:
In my experience, this invocation doesn't on the command line either, from either ack 1 or 2. The command line in question is this:
The -w flag throws on a boundary check (\b) on each side of the search term, but only if the corresponding side ends in an alphanumeric. What we really need is a regular expression that matches a non-space character on one side, and a space character on the other, similar to \b. |
The test does fail on the command-line, for me, too. Why is Can't we just make |
The documentation says
So it does sound that the code should unconditionally add \b on each side. |
No matter what we do, the docs have to change. The two sentences you've pointed out are contradictory, as wrapping things with |
The reason it says that is because this issue of "how should -w work" has been around since the dawn of time. I'm not saying we shouldn't change the \b-wrapping behavior, but we've been down the road of "This is what -w should do! No, this is what it should do!" before. |
I don't have strong views on the particular semantics of -w and I think the documented behaviour is as good as any. We just need to make sure the code and the test suite match the documentation! |
ack has three interpretations of Two documentation sentences specify different cases:
The code (perl) is a third interpretation on the word theme, implementing sentence 2 conditionally and (worse, IMO) partially (we might get zero, one or two The question remains: What is the most desired interpretation (and how do we document it so that users understand it)? For me, the answer to that is to unconditionally apply
In short, I want |
I agree 100% with gedge, and would add that peeking at the pattern (to see if it begins with a word character, or whatever) is generally a broken approach because it will never understand regexp syntax sufficiently. |
A possible fix for this is in issue #445 . |
This will get fixed in ack3. |
This behavior is redone in ack3. |
No description provided.
The text was updated successfully, but these errors were encountered: