[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] Bracket issue

From: Nick Warne
Subject: Re: [Nano-devel] Bracket issue
Date: Tue, 20 Sep 2005 20:38:50 +0100
User-agent: KMail/1.8.1

On Tuesday 20 September 2005 03:17, David Lawrence Ramsey wrote:

>  >I don't know how to fix this issue.  Attached is a piece of code,
>  >adapted/abridged by me to show the issue - attempting to find the
>  >matching bracket on the second line, nano reports 'no matching
>  >bracket'.  It obviously gets confused with the two { on lines 7 and 8.
> Unfortunately, it's not trivial to fix.  The bracket searching function
> doesn't distinguish between brackets inside and outside strings, mainly
> because strings can be defined differently depending on what kind of
> file is being edited.


> If you mean whether indenting {}'s on both sides is a good idea, I've
> only seen the former, and I believe that the former is good coding
> practice.

No, what I meant was could you safely presume the function { } have whitespace 
either side of it... i.e.

  void* (foo) { #1
        ignore this '{'
        or this /}
        but not this ' } '  // will still give a false positive here...
  } #2

I would expect a function brace et al to be separated by white either side of 
it.  It is bad to do this:

void* (foo){

or this

}else{       should be --->  } else {

if you get my drift.  It cannot be worse than just checking all braces?


"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]