mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Cosmetics.
This commit is contained in:
parent
6b5824dedf
commit
bc9d25dd8c
1 changed files with 6 additions and 8 deletions
|
@ -68,13 +68,13 @@ public abstract class ASTNode implements IASTNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInactive() {
|
public void setInactive() {
|
||||||
if(frozen)
|
if (frozen)
|
||||||
throw new IllegalStateException("attempt to modify frozen AST node"); //$NON-NLS-1$
|
throw new IllegalStateException("attempt to modify frozen AST node"); //$NON-NLS-1$
|
||||||
active= false;
|
active= false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void assertNotFrozen() throws IllegalStateException {
|
protected void assertNotFrozen() throws IllegalStateException {
|
||||||
if(frozen)
|
if (frozen)
|
||||||
throw new IllegalStateException("attempt to modify frozen AST node"); //$NON-NLS-1$
|
throw new IllegalStateException("attempt to modify frozen AST node"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,8 +128,7 @@ public abstract class ASTNode implements IASTNode {
|
||||||
return locations;
|
return locations;
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
locations= EMPTY_LOCATION_ARRAY;
|
locations= EMPTY_LOCATION_ARRAY;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
final IASTTranslationUnit tu= getTranslationUnit();
|
final IASTTranslationUnit tu= getTranslationUnit();
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
ILocationResolver l= (ILocationResolver) tu.getAdapter(ILocationResolver.class);
|
ILocationResolver l= (ILocationResolver) tu.getAdapter(ILocationResolver.class);
|
||||||
|
@ -183,7 +182,7 @@ public abstract class ASTNode implements IASTNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTFileLocation getFileLocation() {
|
public IASTFileLocation getFileLocation() {
|
||||||
if( fileLocation != null )
|
if (fileLocation != null)
|
||||||
return fileLocation;
|
return fileLocation;
|
||||||
if (offset <= 0 && (length == 0 || offset < 0)) {
|
if (offset <= 0 && (length == 0 || offset < 0)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -193,8 +192,7 @@ public abstract class ASTNode implements IASTNode {
|
||||||
ILocationResolver lr= (ILocationResolver) ast.getAdapter(ILocationResolver.class);
|
ILocationResolver lr= (ILocationResolver) ast.getAdapter(ILocationResolver.class);
|
||||||
if (lr != null) {
|
if (lr != null) {
|
||||||
fileLocation= lr.getMappedFileLocation(offset, length);
|
fileLocation= lr.getMappedFileLocation(offset, length);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// support for old location map
|
// support for old location map
|
||||||
fileLocation= ast.flattenLocationsToFile(getNodeLocations());
|
fileLocation= ast.flattenLocationsToFile(getNodeLocations());
|
||||||
}
|
}
|
||||||
|
@ -318,7 +316,7 @@ public abstract class ASTNode implements IASTNode {
|
||||||
try {
|
try {
|
||||||
Token result= null;
|
Token result= null;
|
||||||
Token last= null;
|
Token last= null;
|
||||||
for(;;) {
|
for (;;) {
|
||||||
Token t= lex.nextToken();
|
Token t= lex.nextToken();
|
||||||
switch (t.getType()) {
|
switch (t.getType()) {
|
||||||
case IToken.tEND_OF_INPUT:
|
case IToken.tEND_OF_INPUT:
|
||||||
|
|
Loading…
Add table
Reference in a new issue