On Thu, Sep 4, 2014 at 8:11 AM, Ben Pfaff <b...@cs.stanford.edu> wrote:
> On Thu, Sep 04, 2014 at 06:28:19AM -0600, Eric Blake wrote:
>> Noticed this while writing a syntax check rule to look for bogus
>> doubled semicolons.  If there's interest, I could add this rule
>> to maint.mk:
>>
>> # Except for shell files and for loops, double semicolon is probably a 
>> mistake
>> sc_prohibit_double_semicolon:
>>       @prohibit=';;'                                          \
>>       in_vc_files='\.[ch]$$'                                  \
>>       exclude='for \(.*\)'                                    \
>>       halt="Double semicolon detected"                        \
>>         $(_sc_search_regexp)
>
> That looks useful to me.

I like it, too.  But please relax it to also match
whitespace-separated semicolons.
Also, I'd anchor it at end of line, to avoid most false positives for the
legitimate use of two adjacent semicolons in a for-expression.

Reply via email to