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

Re: [PATCH] Add matchings for csharp

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jun 22, 2009, 08:12 UTC
Message-ID
<4A3F3CE2.1070704@gnu.org>
In-Reply-To
<4A3F238B.1020107@viscovery.net>
Show 14 quoted lines
>> @@ -79,6 +79,16 @@ PATTERNS("cpp",
>>  	 "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
>>  	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"
>>  	 "|[^[:space:]]|[\x80-\xff]+"),
>> +PATTERNS("csharp",
>> +	 "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
>> +	 "^([ \t]*(static|public|internal|private|protected|new|unsafe|readonly|volatile)[ \t]+(class|enum|interface|struct).*)$\n"
>> +	 "^([ \t]*(namespace)[ \t]+.*)$"
> 
> I think the placement of parentheses could be improved in these two
> expressions (but I don't know for sure because I don't know the code well
> enough). Looking at the other examples in userdiff.c, I infer that the
> *first* opening parentheses defines which part is copied to the hunk
> header.
Yes.
> Since you placed everything into parentheses (unnecessarily, I
> think),

No, not unnecessarily because otherwise only "public" for example would be copied. I agree though that leading whitespace should not be included in the parentheses.

Paolo
Previous: Johannes Sixt
Message 3 of 3 in “Add matchings for csharp”
  1. Add matchings for csharpAdam Petaccia, Jun 21, 2009
  2. Johannes SixtJun 22, 2009
  3. Paolo BonziniJun 22, 2009

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.