Re: [PATCH] avoid exponential regex match for java and objc function names
- From
Paolo Bonzini <paolo.bonzini@gmail.com>
- Date
- Jun 18, 2009, 06:45 UTC
- Message-ID
- <4A39E291.8030207@gmail.com>
- In-Reply-To
- <7vab46rev0.fsf@alter.siamese.dyndns.org>
> Should I remove the "/* -- */" or is it for better readability I should > keep?
It helps detecting the separation between the function regex and the word regex:
>> - "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$",
>> + "^[ \t]*(([A-Za-z_][A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$",
>> + /* -- */I stole the idea from the Objective-C part:
Show 6 quoted lines
>> /* C functions */
>> - "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$\n"
>> + "^[ \t]*(([A-Za-z_][A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$\n"
>> /* Objective-C class/protocol definitions */
>> "^(@(implementation|interface|protocol)[ \t].*)$",
>> /* -- */Paolo