mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Patch for Devin Steffler.
Fixed Bug 102568 - [Scanner] The Outline view does not show all methods of a class!
This commit is contained in:
parent
a80f774ac0
commit
843da7c608
2 changed files with 25 additions and 1 deletions
|
@ -2294,4 +2294,21 @@ public class Scanner2Test extends BaseScanner2Test
|
||||||
validateDefinition("TEST", "'y'"); //$NON-NLS-1$ //$NON-NLS-2$
|
validateDefinition("TEST", "'y'"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
validateDefinition("TRUE", "1"); //$NON-NLS-1$ //$NON-NLS-2$
|
validateDefinition("TRUE", "1"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug102568A() throws Exception {
|
||||||
|
initializeScanner("///*\r\nint x;\r\n");
|
||||||
|
validateToken( IToken.t_int );
|
||||||
|
validateIdentifier( "x" ); //$NON-NLS-1$
|
||||||
|
validateToken( IToken.tSEMI );
|
||||||
|
validateEOF();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testBug102568B() throws Exception {
|
||||||
|
initializeScanner("// bla some thing /* ... \r\nint x;\r\n");
|
||||||
|
validateToken( IToken.t_int );
|
||||||
|
validateIdentifier( "x" ); //$NON-NLS-1$
|
||||||
|
validateToken( IToken.tSEMI );
|
||||||
|
validateEOF();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3512,7 +3512,7 @@ abstract class BaseScanner implements IScanner {
|
||||||
if (pos + 1 < limit) {
|
if (pos + 1 < limit) {
|
||||||
if (buffer[pos + 1] == '/') {
|
if (buffer[pos + 1] == '/') {
|
||||||
// C++ comment, skip rest of line
|
// C++ comment, skip rest of line
|
||||||
skipToNewLine();
|
skipToNewLine(true);
|
||||||
// leave the new line there
|
// leave the new line there
|
||||||
--bufferPos[bufferStackPos];
|
--bufferPos[bufferStackPos];
|
||||||
return false;
|
return false;
|
||||||
|
@ -3856,6 +3856,10 @@ abstract class BaseScanner implements IScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void skipToNewLine() {
|
protected void skipToNewLine() {
|
||||||
|
skipToNewLine(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void skipToNewLine(boolean insideComment) {
|
||||||
char[] buffer = bufferStack[bufferStackPos];
|
char[] buffer = bufferStack[bufferStackPos];
|
||||||
int limit = bufferLimit[bufferStackPos];
|
int limit = bufferLimit[bufferStackPos];
|
||||||
int pos = ++bufferPos[bufferStackPos];
|
int pos = ++bufferPos[bufferStackPos];
|
||||||
|
@ -3868,6 +3872,9 @@ abstract class BaseScanner implements IScanner {
|
||||||
while (++bufferPos[bufferStackPos] < limit) {
|
while (++bufferPos[bufferStackPos] < limit) {
|
||||||
switch (buffer[bufferPos[bufferStackPos]]) {
|
switch (buffer[bufferPos[bufferStackPos]]) {
|
||||||
case '/':
|
case '/':
|
||||||
|
if (insideComment)
|
||||||
|
break;
|
||||||
|
|
||||||
pos = bufferPos[bufferStackPos];
|
pos = bufferPos[bufferStackPos];
|
||||||
if (pos + 1 < limit && buffer[pos + 1] == '*') {
|
if (pos + 1 < limit && buffer[pos + 1] == '*') {
|
||||||
++bufferPos[bufferStackPos];
|
++bufferPos[bufferStackPos];
|
||||||
|
|
Loading…
Add table
Reference in a new issue