Re: mcedit bug



Hi Matthias,


I like your idea.

> if (type->isFunction()) {
>   return new FunctionInfo(type);
> } /*else if (type->isClass()) {
>   return new ClassInfo(type);
> } */else {
>   return new ErrorInfo(type);
> }

However, I always use #if /#endif constructions, which prevents the
nested comment problem, which also works for these cases:

if (type->isFunction()) {
  return new FunctionInfo(type);
} else if (type->isClass()) {
  /* this is a comment */
  return new ClassInfo(type);
} else {
  return new ErrorInfo(type);
}

becomes:

if (type->isFunction()) {
  return new FunctionInfo(type);
}
#if 0
 else if (type->isClass()) {
  /* this is a comment */
  return new ClassInfo(type);
#endif
} else {
  return new ErrorInfo(type);
}

An other advantage is, that you can reenable the line by simply changing
the 0 in a 1:
#if 0
becomes
#if 1

Of course, the #if/#endifs should always start at a new line, which may
be difficult to implement.
What do you think about that idea?



Regards,
Steef



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