mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 292626 - Formatter doesn't work with wide string literals
This commit is contained in:
parent
65dfb883a8
commit
54caf750d4
2 changed files with 18 additions and 2 deletions
|
@ -2150,10 +2150,11 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
|||
final int line= scribe.line;
|
||||
boolean indented= false;
|
||||
try {
|
||||
int[] stringLiterals = { Token.tSTRING, Token.tLSTRING };
|
||||
while (true) {
|
||||
scribe.printNextToken(Token.tSTRING, needSpace);
|
||||
scribe.printNextToken(stringLiterals, needSpace);
|
||||
token= peekNextToken();
|
||||
if (token != Token.tSTRING) {
|
||||
if (token != Token.tSTRING && token != Token.tLSTRING) {
|
||||
break;
|
||||
}
|
||||
scribe.printCommentPreservingNewLines();
|
||||
|
|
|
@ -1332,4 +1332,19 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
public void testCompositeTypeSpecAsMacro_Bug298592() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
|
||||
//void f() {
|
||||
//w_char* p = L"wide string literal";
|
||||
//int x = 0;
|
||||
//if (x == 0) x = 5;}
|
||||
|
||||
//void f() {
|
||||
// w_char* p = L"wide string literal";
|
||||
// int x = 0;
|
||||
// if (x == 0)
|
||||
// x = 5;
|
||||
//}
|
||||
public void testWideStringLiteral_Bug292626() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue