mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
org.eclipse.cdt.core: Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58500. Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58178 <BR>
org.eclipse.cdt.core.tests: Added CompletionTest::testBug58178().
This commit is contained in:
parent
ca7982b5b8
commit
c73b30f8ce
5 changed files with 25 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-04-14 John Camelon
|
||||
Added CompletionTest::testBug58178().
|
||||
|
||||
2004-04-14 Andrew Niefer
|
||||
updated FullParseCallback with acceptFriendDeclaration
|
||||
added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.testBug45235()
|
||||
|
|
|
@ -69,7 +69,7 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
|||
callback,
|
||||
ParserMode.COMPLETION_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
ParserUtil.getParserLogService());
|
||||
null);
|
||||
|
||||
return parser.parse( offset );
|
||||
|
||||
|
@ -829,4 +829,17 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
|||
assertFalse( i.hasNext() );
|
||||
}
|
||||
|
||||
public void testBug58178() throws Exception
|
||||
{
|
||||
Writer writer = new StringWriter();
|
||||
writer.write( "#define GL_T 0x2001\n");
|
||||
writer.write( "#define GL_TRUE 0x1\n");
|
||||
writer.write( "typedef unsigned char GLboolean;\n");
|
||||
writer.write( "static GLboolean should_rotate = GL_T");
|
||||
String code = writer.toString();
|
||||
final String where = "= GL_T";
|
||||
IASTCompletionNode node = parse( code, code.indexOf( where ) + where.length() );
|
||||
assertEquals( node.getCompletionPrefix(), "GL_T");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2004-04-14 John Camelon
|
||||
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58500
|
||||
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58178
|
||||
|
||||
2004-04-14 Andrew Niefer
|
||||
friends in the AST (bugs 45235 & 53759 )
|
||||
- added acceptFriendDeclaration to ISourceElementRequestor
|
||||
|
|
|
@ -961,6 +961,8 @@ public class ExpressionParser implements IExpressionParser {
|
|||
buffer.append( "Parser: Unexpected exception in "); //$NON-NLS-1$
|
||||
buffer.append( methodName );
|
||||
buffer.append( ":"); //$NON-NLS-1$
|
||||
buffer.append( e.getClass().getName() );
|
||||
buffer.append( "::"); //$NON-NLS-1$
|
||||
buffer.append( e.getMessage() );
|
||||
buffer.append( ". w/"); //$NON-NLS-1$
|
||||
buffer.append( scanner.toString() );
|
||||
|
@ -1300,7 +1302,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
// If this isn't a type name, then we shouldn't be here
|
||||
try
|
||||
{
|
||||
typeId = typeId(scope, false, CompletionKind.TYPE_REFERENCE);
|
||||
typeId = typeId(scope, false, ((kind == CompletionKind.SINGLE_NAME_REFERENCE )? kind : CompletionKind.TYPE_REFERENCE));
|
||||
consume(IToken.tRPAREN);
|
||||
if( templateIdScopes != null ){ templateIdScopes.pop(); popped = true;}
|
||||
IASTExpression castExpression = castExpression(scope,kind);
|
||||
|
|
|
@ -1544,7 +1544,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
IMacroDescriptor mapping = getDefinition(ident);
|
||||
|
||||
if (mapping != null)
|
||||
if (mapping != null && !isLimitReached())
|
||||
if( scannerData.getContextStack().shouldExpandDefinition( ident ) ) {
|
||||
expandDefinition(ident, mapping, baseOffset);
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue