mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Scanner2 fixes for SelectionSearch & Content Assist JUnit failures.
This commit is contained in:
parent
6baa96771d
commit
a7fcc4aa84
2 changed files with 10 additions and 1 deletions
|
@ -602,6 +602,8 @@ public class CompletionParseTest extends CompletionParseBaseTest {
|
|||
new IASTNode.LookupKind[]{ IASTNode.LookupKind.THIS },
|
||||
node.getCompletionContext(), null );
|
||||
|
||||
assertTrue( node.getCompletionScope() instanceof IASTMethod );
|
||||
assertEquals( ((IASTMethod)node.getCompletionScope()).getName(), "d" ); //$NON-NLS-1$
|
||||
assertEquals( result.getResultsSize(), 4 );
|
||||
|
||||
Iterator iter = result.getNodes();
|
||||
|
|
|
@ -265,7 +265,7 @@ public class Scanner2 implements IScanner, IScannerData {
|
|||
* @see org.eclipse.cdt.core.parser.IScanner#isOnTopContext()
|
||||
*/
|
||||
public boolean isOnTopContext() {
|
||||
return bufferStackPos == 0;
|
||||
return bufferStackPos <= 0;
|
||||
}
|
||||
|
||||
private IToken lastToken;
|
||||
|
@ -2239,6 +2239,11 @@ public class Scanner2 implements IScanner, IScannerData {
|
|||
= new ObjectStyleMacro("__restrict".toCharArray(), "restrict".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
private static final ObjectStyleMacro __volatile__
|
||||
= new ObjectStyleMacro("__volatile__".toCharArray(), "volatile".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
private static final ObjectStyleMacro __const__
|
||||
= new ObjectStyleMacro("__const__".toCharArray(), "const".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
private static final ObjectStyleMacro __const
|
||||
= new ObjectStyleMacro("__const".toCharArray(), "const".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final FunctionStyleMacro __attribute__
|
||||
= new FunctionStyleMacro(
|
||||
"__attribute__".toCharArray(), //$NON-NLS-1$
|
||||
|
@ -2261,6 +2266,8 @@ public class Scanner2 implements IScanner, IScannerData {
|
|||
|
||||
// gcc extensions
|
||||
definitions.put(__inline__.name, __inline__);
|
||||
definitions.put( __const__.name, __const__ );
|
||||
definitions.put( __const.name, __const );
|
||||
definitions.put(__extension__.name, __extension__);
|
||||
definitions.put(__attribute__.name, __attribute__);
|
||||
definitions.put(__restrict__.name, __restrict__);
|
||||
|
|
Loading…
Add table
Reference in a new issue