forked from qt-creator/qt-creator
Added clone methods to the AST.
This commit is contained in:
@@ -2030,8 +2030,8 @@ unsigned ObjCTypeNameAST::lastToken() const
|
||||
if (type_id)
|
||||
return type_id->lastToken();
|
||||
|
||||
if (type_qualifier)
|
||||
return type_qualifier + 1;
|
||||
if (type_qualifier_token)
|
||||
return type_qualifier_token + 1;
|
||||
|
||||
return lparen_token + 1;
|
||||
}
|
||||
@@ -2214,22 +2214,22 @@ unsigned ObjCMethodDeclarationAST::lastToken() const
|
||||
|
||||
unsigned ObjCSynthesizedPropertyAST::firstToken() const
|
||||
{
|
||||
if (property_identifier)
|
||||
return property_identifier;
|
||||
if (property_identifier_token)
|
||||
return property_identifier_token;
|
||||
else if (equals_token)
|
||||
return equals_token;
|
||||
else
|
||||
return property_alias_identifier;
|
||||
return alias_identifier_token;
|
||||
}
|
||||
|
||||
unsigned ObjCSynthesizedPropertyAST::lastToken() const
|
||||
{
|
||||
if (property_alias_identifier)
|
||||
return property_alias_identifier + 1;
|
||||
if (alias_identifier_token)
|
||||
return alias_identifier_token + 1;
|
||||
else if (equals_token)
|
||||
return equals_token + 1;
|
||||
else
|
||||
return property_identifier + 1;
|
||||
return property_identifier_token + 1;
|
||||
}
|
||||
|
||||
unsigned ObjCSynthesizedPropertiesDeclarationAST::firstToken() const
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1480
src/shared/cplusplus/ASTClone.cpp
Normal file
1480
src/shared/cplusplus/ASTClone.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4753,12 +4753,12 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
|
||||
ObjCSynthesizedPropertyListAST *last = new (_pool) ObjCSynthesizedPropertyListAST;
|
||||
ast->property_identifier_list = last;
|
||||
last->value = new (_pool) ObjCSynthesizedPropertyAST;
|
||||
match(T_IDENTIFIER, &(last->value->property_identifier));
|
||||
match(T_IDENTIFIER, &(last->value->property_identifier_token));
|
||||
|
||||
if (LA() == T_EQUAL) {
|
||||
last->value->equals_token = consumeToken();
|
||||
|
||||
match(T_IDENTIFIER, &(last->value->property_alias_identifier));
|
||||
match(T_IDENTIFIER, &(last->value->alias_identifier_token));
|
||||
}
|
||||
|
||||
while (LA() == T_COMMA) {
|
||||
@@ -4768,12 +4768,12 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
|
||||
last = last->next;
|
||||
|
||||
last->value = new (_pool) ObjCSynthesizedPropertyAST;
|
||||
match(T_IDENTIFIER, &(last->value->property_identifier));
|
||||
match(T_IDENTIFIER, &(last->value->property_identifier_token));
|
||||
|
||||
if (LA() == T_EQUAL) {
|
||||
last->value->equals_token = consumeToken();
|
||||
|
||||
match(T_IDENTIFIER, &(last->value->property_alias_identifier));
|
||||
match(T_IDENTIFIER, &(last->value->alias_identifier_token));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5179,7 +5179,7 @@ bool Parser::parseObjCTypeName(ObjCTypeNameAST *&node)
|
||||
|
||||
ObjCTypeNameAST *ast = new (_pool) ObjCTypeNameAST;
|
||||
match(T_LPAREN, &(ast->lparen_token));
|
||||
parseObjCTypeQualifiers(ast->type_qualifier);
|
||||
parseObjCTypeQualifiers(ast->type_qualifier_token);
|
||||
parseTypeId(ast->type_id);
|
||||
match(T_RPAREN, &(ast->rparen_token));
|
||||
node = ast;
|
||||
|
||||
@@ -46,6 +46,7 @@ SOURCES += \
|
||||
$$PWD/ASTVisit.cpp \
|
||||
$$PWD/ASTMatch0.cpp \
|
||||
$$PWD/ASTVisitor.cpp \
|
||||
$$PWD/ASTClone.cpp \
|
||||
$$PWD/ASTPatternBuilder.cpp \
|
||||
$$PWD/ASTMatcher.cpp \
|
||||
$$PWD/TypeMatcher.cpp \
|
||||
|
||||
Reference in New Issue
Block a user