From ba17c7ac64dc7dff78828002c7a7e9806aadc4c0 Mon Sep 17 00:00:00 2001 From: Lukas Felber Date: Fri, 25 May 2012 09:49:52 +0200 Subject: Bug 380615 - Assign comments belonging to preprocessor directives to them in NodeCommentMap instead of ignoring them. minor renames and reformatting. added additional comment to "CommentRecognition preprocessor directives comment recognition". Change-Id: Idabbe95ff7dd4e11b173474b708e622252264adb Reviewed-on: https://git.eclipse.org/r/6119 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- .../rewrite/CommentHandlingTestSource.rts | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'core/org.eclipse.cdt.core.tests/resources/rewrite/CommentHandlingTestSource.rts') diff --git a/core/org.eclipse.cdt.core.tests/resources/rewrite/CommentHandlingTestSource.rts b/core/org.eclipse.cdt.core.tests/resources/rewrite/CommentHandlingTestSource.rts index 422b99ae02b..c89f4945db9 100644 --- a/core/org.eclipse.cdt.core.tests/resources/rewrite/CommentHandlingTestSource.rts +++ b/core/org.eclipse.cdt.core.tests/resources/rewrite/CommentHandlingTestSource.rts @@ -2978,6 +2978,7 @@ class test //= =>leading +#ifndef TEST_H_ = //TEST =>trailing =>freestanding @@ -2999,6 +3000,9 @@ class test //= =>leading +#ifndef TEST_H_ = /* + * Licence information... + */ =>trailing =>freestanding @@ -3021,6 +3025,9 @@ class test //= =>leading +#ifndef TEST_H_ = /* + * Licence information... + */ class test { }; = //test @@ -3054,7 +3061,11 @@ private: //= =>leading +#ifndef HIDEMETHOD_H_ = /* + * HideMethod.h + */ =>trailing +#endif = /* HIDEMETHOD_H_ */ =>freestanding //!CommentRecognition Bug 233438 @@ -3077,6 +3088,7 @@ private: //= =>leading =>trailing +#endif = /* HIDEMETHOD_H_ */ =>freestanding //@test.cpp @@ -3122,6 +3134,7 @@ private: //= =>leading =>trailing +#endif = /* HIDEMETHOD_H_ */ =>freestanding //@test.cpp @@ -3145,4 +3158,44 @@ int HideMethod::methode2(){ =>trailing i++; = //comment =>freestanding +//!CommentRecognition preprocessor directives comment recognition +//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest +//@main.cpp +//c1 +int i;//c2 +//inc1 +//inc2 + +#include "foo.h" /*inc3*/ /*inc4*/ +//main +int main() { + return 0; + //block1 +} +//ifdef1 +#ifdef X //ifdef2 +//= +=>leading +int i; = //c1 +#include "foo.h" = //inc1 , //inc2 +int main() { + return 0; + //block1 +} = //main +#ifdef X = //ifdef1 +=>trailing +int i; = //c2 +#include "foo.h" = /*inc3*/ , /*inc4*/ +#ifdef X = //ifdef2 +=>freestanding +{ + return 0; + //block1 +} = //block1 +//@foo.h +void foo(); +//= +=>leading +=>trailing +=>freestanding \ No newline at end of file -- cgit v1.2.3