mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Tightened a test case and fixed an uncovered bug.
This commit is contained in:
parent
14939e4ab6
commit
f73fa36c10
2 changed files with 7 additions and 3 deletions
|
@ -918,8 +918,10 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
|||
*/
|
||||
@Override
|
||||
public int visit(IASTStatement node) {
|
||||
if (startsWithMacroExpansion(node))
|
||||
if (scribe.scanner.getCurrentPosition() <= node.getFileLocation().getNodeOffset() &&
|
||||
startsWithMacroExpansion(node)) {
|
||||
scribe.printCommentPreservingNewLines();
|
||||
}
|
||||
if (!startNode(node)) { return PROCESS_SKIP; }
|
||||
int indentLevel= scribe.indentationLevel;
|
||||
try {
|
||||
|
|
|
@ -2472,8 +2472,10 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
//#define MY_MACRO switch (0) case 0: default: if (bool x = false) ; else GetStream()
|
||||
//
|
||||
//void test() {
|
||||
//MY_MACRO << "Loooooooooooooooooooong string literal" << " another literal.";
|
||||
//MY_MACRO << "Looooooooooooooooooooong string literal" << " another literal.";
|
||||
//MY_MACRO
|
||||
//<< "Loooooooooooooooooooong string literal" << " another literal.";
|
||||
//MY_MACRO
|
||||
//<< "Looooooooooooooooooooong string literal" << " another literal.";
|
||||
//}
|
||||
|
||||
//struct Stream {
|
||||
|
|
Loading…
Add table
Reference in a new issue