Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ASTRewrite: Comment handling

Hi,

I filed a bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=426888

On 29.01.2014 14:38, Corbat Thomas wrote:
Hi Simon

At a glance, that indeed looks like a bug. It probably doesn't make sense to have a comment assigned to an (AST) node after the node enclosing the comment. Could you please file a bug, then we (Lukas Felber and I) will have a look at it.

Thanks a lot
Thomas

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Simon Taddiken
Sent: Mittwoch, 29. Januar 2014 14:21
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] ASTRewrite: Comment handling

Hi,

I'm currently working with the ASTRewrite for moving methods around and stumbled upon the following which I consider to be a bug. Given the following code snippet:

A.h
#ifndef A_H_
#define A_H_

class Base {
};
class Derived : Base {
public:
      void myMethod(int a) {
          // comment in body
      }
};
#endif /* A_H_ */


In this sample, the body comment of the method is considered to be a leading comment to the #endif node by the ASTRewrite for that TranslationUnit. This kind of makes sense because its the next node after the comment, but I feel the comment should rather be associated with the method it stands in. For now it takes some crazy extra effort to move all the comments of one method definition to a copy, because in the sample above, the comment is not associated with any node which belongs to the definition.
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top