git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] userdiff: allow * between cpp funcname words

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 7, 2011, 08:04 UTC
Message-ID
<201112070904.28212.trast@student.ethz.ch>
In-Reply-To
<7vfwgxflkv.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 13 quoted lines
> Thomas Rast <trast@student.ethz.ch> writes:
> 
> > Actually (sadly) I'll have to revise it.  It doesn't match much of C++
> > either, and I haven't yet come up with a reasonable regex that
> > matches, say,
> >
> >   foo::Bar<int>::t& Baz::operator<<(
> >
> > which I would call ludicrous, but it's valid C++.
> 
> Heh, I'd rather not see us go that route, which would either end up
> implementing a C++ parser or reverting the heuristics back to "non-blank
> at the beginning of the line" that was already reasonably useful.

Well, there are many things that we deliberately do not match right now and for which that's a good thing:

  label:
  public:
  void declaration_only(...);
  int global_variable;

At some point I was wondering whether it would be better to just declare a non-match for '.*;' and '^[A-Za-z_][A-Za-z_0-9]+:', and otherwise match all '^[A-Za-z].*\(' but I may be missing something.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Junio C HamanoNext: Johannes Sixt
Message 8 of 9 in “userdiff: allow * between cpp funcname words”
  1. userdiff: allow * between cpp funcname wordsThomas Rast, Dec 6, 2011
  2. Jeff KingDec 6, 2011
  3. Thomas RastDec 6, 2011
  4. Jeff KingDec 6, 2011
  5. Johannes SixtDec 6, 2011
  6. René ScharfeDec 6, 2011
  7. Junio C HamanoDec 6, 2011
  8. Thomas RastDec 7, 2011
  9. Johannes SixtDec 7, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.