Community
Participate
Working Groups
Created attachment 264419 [details] Possible but constrainful warkaround When a protected area finishes with a closing bracket and line feed (LF): { \<LF> int a, b, c; \<LF> a = 1; \<LF> b = 2; \<LF> c = a + b; \<LF> }<LF> The closing bracket is removed and the protected body becomes: { \<LF> int a, b, c; \<LF> a = 1; \<LF> b = 2; \<LF> c = a + b; \<CR><LF> <LF> The only way to keep the closing bracket (last character of the body) is to add a CR like : { \<LF> int a, b, c; \<LF> a = 1; \<LF> b = 2; \<LF> c = a + b; \<CR><LF> }<LF> This bug is major because it modifies the protected area and removes character(s). The typical use case in C is a macro-like function: #define DB_COMPARE_VALUES(value_1, value_2, result) \ /* Start of user code for DB_COMPARE_VALUES */ \ { \ if ((value_1) < (value_2)) \ { \ /* result is DB_LOWER if value 1 is lower than value 2 */ \ (result) = DB_LOWER; \ } \ else if ((value_1) > (value_2)) \ { \ /* result is DB_HIGHER if value 1 is higher than value 2 */ \ (result) = DB_HIGHER; \ } \ else \ { \ /* result is DB_EQUAL otherwise */ \ (result) = DB_EQUAL; \ } \ } /* End of user code for DB_COMPARE_VALUES */
This cannot be reproduced from our side. Could you provide us with a reproducible test case?
Created attachment 264446 [details] Acceleo project reproducing the issue Please find in attachment a very simple Acceleo project with one launcher that reproduce the issue. UML2 and Acceleo 3.6.1 has been used to reproduce it.
Thans for the test case. Bug was due to a regex that was a little too permissive on its match, and would have happened on any protected area which contained the chars "\n" and "}" in succession.
Great, this was exactly what I was thinking because it only happens with "}".
New Gerrit change created: https://git.eclipse.org/r/82000
Gerrit change https://git.eclipse.org/r/82000 was merged to [master]. Commit: http://git.eclipse.org/c/acceleo/org.eclipse.acceleo.git/commit/?id=73c415e3489db8f84e96d607da76e4e126477492