diff options
3 files changed, 31 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index 668090c55f3..db4092fe5e5 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -2139,7 +2139,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(IASTLiteralExpression node) { if (node.getKind() == IASTLiteralExpression.lk_string_literal) { - // handle concatentation of string literals + // handle concatenation of string literals int token; boolean needSpace= false; final int line= scribe.line; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java index 2c4eb4e15ed..93280b8646e 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/scanner/SimpleScanner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -248,7 +248,10 @@ public class SimpleScanner { if (!hex) { if (c == '*') { - return newToken(Token.tDOTSTAR); + if (floatingPoint && digits == 0) { + // encountered .* + return newToken(Token.tDOTSTAR); + } } else if (c == '.') { if (floatingPoint && digits == 0) { // encountered .. diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java index 8baf9fde4da..630fdb90958 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java @@ -1112,6 +1112,31 @@ public class CodeFormatterTest extends BaseUITestCase { assertFormatterResult(); } + //void f() { + // Canvas1->MoveTo((50 + (24* 20 ) +xoff) *Scale,(200+yoff)*ScaleY); + // Canvas1->LineTo((67+(24*20) +xoff)*Scale,(200+yoff)*ScaleY); + // Canvas1->MoveTo((50+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)-1); + // Canvas1->LineTo((67+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)-1); + // Canvas1->MoveTo((50+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)+1); + // Canvas1->LineTo((67+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)+1); + //} + + //void f() { + // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY); + // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY); + // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) + // - 1); + // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) + // - 1); + // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) + // + 1); + // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) + // + 1); + //} + public void testScannerErrorWithIntegerFollowedByStar_Bug278118() throws Exception { + assertFormatterResult(); + } + //inline typename A foo(); //void bar(const typename A x) ; //static typename A x ; |