Commit 2a59d2ae authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Split Objective-C keyword parsing to handle the '@' separately.

Because apparently, while designing the Objective-C language, somebody
thought it was a world-class idea to allow any white-space between the
'@' character and the subsequent keyword. With this fix, we now
correctly parse:
    @  dynamic
and:
    @
      selector
and:
    @"foo"
     "bar"
    @"mooze"
(This last one is 1 single string split over multiple lines.)
Wonderful, isn't it?

What we (and Clang) do not support, but what GCC supports is something
like:
   @"foo"@@  "bar"  @"mooze"  @@
which is equivalent to @"foobarmooze".
parent abdd404f
......@@ -71,7 +71,7 @@ bool SimpleToken::isComment() const
bool SimpleToken::isObjCAtKeyword() const
{
return _kind >= T_FIRST_OBJC_AT_KEYWORD && _kind <= T_LAST_OBJC_AT_KEYWORD;
return _kind >= T_FIRST_OBJC_KEYWORD && _kind <= T_LAST_OBJC_KEYWORD;
}
const char *SimpleToken::name() const
......
......@@ -127,8 +127,7 @@ void CppHighlighter::highlightBlock(const QString &text)
else if (tk.is(T_NUMERIC_LITERAL))
setFormat(tk.position(), tk.length(), m_formats[CppNumberFormat]);
else if (tk.is(T_STRING_LITERAL) || tk.is(T_CHAR_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL) ||
tk.is(T_AT_STRING_LITERAL))
else if (tk.is(T_STRING_LITERAL) || tk.is(T_CHAR_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL))
highightLine(text, tk.position(), tk.length(), m_formats[CppStringFormat]);
else if (tk.is(T_WIDE_STRING_LITERAL) || tk.is(T_WIDE_CHAR_LITERAL))
......
......@@ -1197,18 +1197,35 @@ bool CppCodeCompletion::completeScope(const QList<LookupItem> &results,
return ! m_completions.isEmpty();
}
void CppCodeCompletion::addKeywords()
void CppCodeCompletion::addKeyword(const QString &text)
{
int keywordLimit = T_FIRST_OBJC_AT_KEYWORD;
if (objcKeywordsWanted())
keywordLimit = T_LAST_OBJC_AT_KEYWORD + 1;
TextEditor::CompletionItem item(this);
item.text = text;
item.icon = m_icons.keywordIcon();
m_completions.append(item);
}
void CppCodeCompletion::addKeywords()
{
// keyword completion items.
for (int i = T_FIRST_KEYWORD; i < keywordLimit; ++i) {
TextEditor::CompletionItem item(this);
item.text = QLatin1String(Token::name(i));
item.icon = m_icons.keywordIcon();
m_completions.append(item);
for (int i = T_FIRST_KEYWORD; i < T_FIRST_OBJC_KEYWORD; ++i) {
addKeyword(QLatin1String(Token::name(i)));
}
if (objcKeywordsWanted()) {
// unique Objective-C keywords:
for (int i = T_FIRST_OBJC_KEYWORD; i <= T_LAST_OBJC_KEYWORD; ++i) {
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(i)));
}
// overlapping keywords:
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_CATCH)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_CLASS)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PRIVATE)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PROTECTED)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_PUBLIC)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_THROW)));
addKeyword(QLatin1Char('@') + QLatin1String(Token::name(T_TRY)));
}
}
......
......@@ -89,6 +89,7 @@ public:
void setPartialCompletionEnabled(bool partialCompletionEnabled);
private:
void addKeyword(const QString &text);
void addKeywords();
void addMacros(const QString &fileName, const CPlusPlus::Snapshot &snapshot);
void addMacros_helper(const CPlusPlus::Snapshot &snapshot,
......
......@@ -1561,14 +1561,16 @@ unsigned SizeofExpressionAST::lastToken() const
unsigned StringLiteralAST::firstToken() const
{
return literal_token;
return at_token;
}
unsigned StringLiteralAST::lastToken() const
{
if (next)
return next->lastToken();
return literal_token + 1;
if (literal_token)
return literal_token + 1;
return at_token + 1;
}
......@@ -1910,7 +1912,7 @@ unsigned ObjCClassForwardDeclarationAST::firstToken() const
if (attribute_list)
return attribute_list->firstToken();
return class_token;
return at_token;
}
unsigned ObjCClassForwardDeclarationAST::lastToken() const
......@@ -1921,7 +1923,10 @@ unsigned ObjCClassForwardDeclarationAST::lastToken() const
else if (identifier_list)
return identifier_list->lastToken();
return class_token + 1;
else if (class_token)
return class_token + 1;
else
return at_token + 1;
}
unsigned ObjCProtocolForwardDeclarationAST::firstToken() const
......@@ -1929,7 +1934,7 @@ unsigned ObjCProtocolForwardDeclarationAST::firstToken() const
if (attribute_list)
return attribute_list->firstToken();
return protocol_token;
return at_token;
}
unsigned ObjCProtocolForwardDeclarationAST::lastToken() const
......@@ -1940,7 +1945,10 @@ unsigned ObjCProtocolForwardDeclarationAST::lastToken() const
else if (identifier_list)
return identifier_list->lastToken();
return protocol_token + 1;
else if (protocol_token)
return protocol_token + 1;
else
return at_token + 1;
}
unsigned ObjCClassDeclarationAST::firstToken() const
......@@ -1948,15 +1956,14 @@ unsigned ObjCClassDeclarationAST::firstToken() const
if (attribute_list)
return attribute_list->firstToken();
if (interface_token)
return interface_token;
else
return implementation_token;
return at_token;
}
unsigned ObjCClassDeclarationAST::lastToken() const
{
if (end_token) return end_token + 1;
if (ending_at_token)
return ending_at_token + 1;
if (member_declaration_list) return member_declaration_list->lastToken();
if (inst_vars_decl) return inst_vars_decl->lastToken();
if (protocol_refs)
......@@ -1974,21 +1981,25 @@ unsigned ObjCClassDeclarationAST::lastToken() const
if (interface_token)
return interface_token + 1;
else
else if (implementation_token)
return implementation_token + 1;
else
return at_token + 1;
}
unsigned ObjCProtocolDeclarationAST::firstToken() const
{
if (attribute_list)
return attribute_list->firstToken();
return protocol_token;
return at_token;
}
unsigned ObjCProtocolDeclarationAST::lastToken() const
{
if (end_token)
return end_token + 1;
else if (ending_at_token)
return ending_at_token + 1;
else if (member_declaration_list)
return member_declaration_list->lastToken();
......@@ -2001,8 +2012,10 @@ unsigned ObjCProtocolDeclarationAST::lastToken() const
else if (attribute_list)
return attribute_list->lastToken();
return protocol_token + 1;
else if (protocol_token)
return protocol_token + 1;
else
return at_token + 1;
}
unsigned ObjCProtocolRefsAST::firstToken() const
......@@ -2063,7 +2076,7 @@ unsigned ObjCMessageArgumentAST::lastToken() const
unsigned ObjCProtocolExpressionAST::firstToken() const
{
return protocol_token;
return at_token;
}
unsigned ObjCProtocolExpressionAST::lastToken() const
......@@ -2077,7 +2090,10 @@ unsigned ObjCProtocolExpressionAST::lastToken() const
if (lparen_token)
return lparen_token + 1;
return protocol_token + 1;
if (protocol_token)
return protocol_token + 1;
return at_token + 1;
}
unsigned ObjCTypeNameAST::firstToken() const
......@@ -2101,7 +2117,7 @@ unsigned ObjCTypeNameAST::lastToken() const
unsigned ObjCEncodeExpressionAST::firstToken() const
{
return encode_token;
return at_token;
}
unsigned ObjCEncodeExpressionAST::lastToken() const
......@@ -2109,7 +2125,10 @@ unsigned ObjCEncodeExpressionAST::lastToken() const
if (type_name)
return type_name->lastToken();
return encode_token + 1;
if (encode_token)
return encode_token + 1;
return at_token + 1;
}
unsigned ObjCSelectorWithoutArgumentsAST::firstToken() const
......@@ -2147,7 +2166,7 @@ unsigned ObjCSelectorWithArgumentsAST::lastToken() const
unsigned ObjCSelectorExpressionAST::firstToken() const
{
return selector_token;
return at_token;
}
unsigned ObjCSelectorExpressionAST::lastToken() const
......@@ -2158,7 +2177,9 @@ unsigned ObjCSelectorExpressionAST::lastToken() const
return selector->lastToken();
if (lparen_token)
return rparen_token + 1;
return selector_token + 1;
if (selector_token)
return selector_token + 1;
return at_token + 1;
}
unsigned ObjCInstanceVariablesDeclarationAST::firstToken() const
......@@ -2179,12 +2200,15 @@ unsigned ObjCInstanceVariablesDeclarationAST::lastToken() const
unsigned ObjCVisibilityDeclarationAST::firstToken() const
{
return visibility_token;
return at_token;
}
unsigned ObjCVisibilityDeclarationAST::lastToken() const
{
return visibility_token + 1;
if (visibility_token)
return visibility_token + 1;
else
return at_token + 1;
}
unsigned ObjCPropertyAttributeAST::firstToken() const
......@@ -2207,7 +2231,7 @@ unsigned ObjCPropertyDeclarationAST::firstToken() const
if (attribute_list)
return attribute_list->firstToken();
return property_token;
return at_token;
}
unsigned ObjCPropertyDeclarationAST::lastToken() const
......@@ -2220,8 +2244,10 @@ unsigned ObjCPropertyDeclarationAST::lastToken() const
return property_attribute_list->lastToken();
else if (lparen_token)
return lparen_token + 1;
return property_token + 1;
else if (property_token)
return property_token + 1;
else
return at_token + 1;
}
unsigned ObjCMessageArgumentDeclarationAST::firstToken() const
......@@ -2354,7 +2380,7 @@ unsigned ObjCFastEnumerationAST::lastToken() const
unsigned ObjCSynchronizedStatementAST::firstToken() const
{
return synchronized_token;
return at_token;
}
unsigned ObjCSynchronizedStatementAST::lastToken() const
......@@ -2363,5 +2389,6 @@ unsigned ObjCSynchronizedStatementAST::lastToken() const
if (rparen_token) return rparen_token + 1;
if (synchronized_object) return synchronized_object->lastToken();
if (lparen_token) return lparen_token + 1;
return synchronized_token + 1;
if (synchronized_token) return synchronized_token + 1;
return at_token + 1;
}
......@@ -2275,6 +2275,7 @@ protected:
class CPLUSPLUS_EXPORT StringLiteralAST: public ExpressionAST
{
public:
unsigned at_token;
unsigned literal_token;
StringLiteralAST *next;
......@@ -2588,6 +2589,7 @@ class CPLUSPLUS_EXPORT ObjCClassForwardDeclarationAST: public DeclarationAST
{
public:
SpecifierListAST *attribute_list;
unsigned at_token;
unsigned class_token;
NameListAST *identifier_list;
unsigned semicolon_token;
......@@ -2612,6 +2614,7 @@ class CPLUSPLUS_EXPORT ObjCClassDeclarationAST: public DeclarationAST
{
public:
SpecifierListAST *attribute_list;
unsigned at_token;
unsigned interface_token;
unsigned implementation_token;
NameAST *class_name;
......@@ -2623,6 +2626,7 @@ public:
ObjCProtocolRefsAST *protocol_refs;
ObjCInstanceVariablesDeclarationAST *inst_vars_decl;
DeclarationListAST *member_declaration_list;
unsigned ending_at_token;
unsigned end_token;
public: // annotations
......@@ -2645,6 +2649,7 @@ class CPLUSPLUS_EXPORT ObjCProtocolForwardDeclarationAST: public DeclarationAST
{
public:
SpecifierListAST *attribute_list;
unsigned at_token;
unsigned protocol_token;
NameListAST *identifier_list;
unsigned semicolon_token;
......@@ -2669,10 +2674,12 @@ class CPLUSPLUS_EXPORT ObjCProtocolDeclarationAST: public DeclarationAST
{
public:
SpecifierListAST *attribute_list;
unsigned at_token;
unsigned protocol_token;
NameAST *name;
ObjCProtocolRefsAST *protocol_refs;
DeclarationListAST *member_declaration_list;
unsigned ending_at_token;
unsigned end_token;
public: // annotations
......@@ -2754,6 +2761,7 @@ protected:
class CPLUSPLUS_EXPORT ObjCProtocolExpressionAST: public ExpressionAST
{
public:
unsigned at_token;
unsigned protocol_token;
unsigned lparen_token;
unsigned identifier_token;
......@@ -2796,6 +2804,7 @@ protected:
class CPLUSPLUS_EXPORT ObjCEncodeExpressionAST: public ExpressionAST
{
public:
unsigned at_token;
unsigned encode_token;
ObjCTypeNameAST *type_name;
......@@ -2870,6 +2879,7 @@ protected:
class CPLUSPLUS_EXPORT ObjCSelectorExpressionAST: public ExpressionAST
{
public:
unsigned at_token;
unsigned selector_token;
unsigned lparen_token;
ObjCSelectorAST *selector;
......@@ -2911,6 +2921,7 @@ protected:
class CPLUSPLUS_EXPORT ObjCVisibilityDeclarationAST: public DeclarationAST
{
public:
unsigned at_token;
unsigned visibility_token;
public:
......@@ -2950,6 +2961,7 @@ class CPLUSPLUS_EXPORT ObjCPropertyDeclarationAST: public DeclarationAST
{
public:
SpecifierListAST *attribute_list;
unsigned at_token;
unsigned property_token;
unsigned lparen_token;
ObjCPropertyAttributeListAST *property_attribute_list;
......@@ -3137,6 +3149,7 @@ protected:
class CPLUSPLUS_EXPORT ObjCSynchronizedStatementAST: public StatementAST
{
public:
unsigned at_token;
unsigned synchronized_token;
unsigned lparen_token;
ExpressionAST *synchronized_object;
......
......@@ -1064,6 +1064,7 @@ NestedExpressionAST *NestedExpressionAST::clone(MemoryPool *pool) const
StringLiteralAST *StringLiteralAST::clone(MemoryPool *pool) const
{
StringLiteralAST *ast = new (pool) StringLiteralAST;
ast->at_token = at_token;
ast->literal_token = literal_token;
if (next)
ast->next = next->clone(pool);
......@@ -1232,6 +1233,7 @@ ObjCClassForwardDeclarationAST *ObjCClassForwardDeclarationAST::clone(MemoryPool
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->at_token = at_token;
ast->class_token = class_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
......@@ -1246,6 +1248,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->at_token = at_token;
ast->interface_token = interface_token;
ast->implementation_token = implementation_token;
if (class_name)
......@@ -1264,6 +1267,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->ending_at_token = ending_at_token;
ast->end_token = end_token;
return ast;
}
......@@ -1274,6 +1278,7 @@ ObjCProtocolForwardDeclarationAST *ObjCProtocolForwardDeclarationAST::clone(Memo
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->at_token = at_token;
ast->protocol_token = protocol_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
......@@ -1288,6 +1293,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->at_token = at_token;
ast->protocol_token = protocol_token;
if (name)
ast->name = name->clone(pool);
......@@ -1296,6 +1302,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->ending_at_token = ending_at_token;
ast->end_token = end_token;
return ast;
}
......@@ -1337,6 +1344,7 @@ ObjCMessageExpressionAST *ObjCMessageExpressionAST::clone(MemoryPool *pool) cons
ObjCProtocolExpressionAST *ObjCProtocolExpressionAST::clone(MemoryPool *pool) const
{
ObjCProtocolExpressionAST *ast = new (pool) ObjCProtocolExpressionAST;
ast->at_token = at_token;
ast->protocol_token = protocol_token;
ast->lparen_token = lparen_token;
ast->identifier_token = identifier_token;
......@@ -1358,6 +1366,7 @@ ObjCTypeNameAST *ObjCTypeNameAST::clone(MemoryPool *pool) const
ObjCEncodeExpressionAST *ObjCEncodeExpressionAST::clone(MemoryPool *pool) const
{
ObjCEncodeExpressionAST *ast = new (pool) ObjCEncodeExpressionAST;
ast->at_token = at_token;
ast->encode_token = encode_token;
if (type_name)
ast->type_name = type_name->clone(pool);
......@@ -1391,6 +1400,7 @@ ObjCSelectorWithArgumentsAST *ObjCSelectorWithArgumentsAST::clone(MemoryPool *po
ObjCSelectorExpressionAST *ObjCSelectorExpressionAST::clone(MemoryPool *pool) const
{
ObjCSelectorExpressionAST *ast = new (pool) ObjCSelectorExpressionAST;
ast->at_token = at_token;
ast->selector_token = selector_token;
ast->lparen_token = lparen_token;
if (selector)
......@@ -1413,6 +1423,7 @@ ObjCInstanceVariablesDeclarationAST *ObjCInstanceVariablesDeclarationAST::clone(
ObjCVisibilityDeclarationAST *ObjCVisibilityDeclarationAST::clone(MemoryPool *pool) const
{
ObjCVisibilityDeclarationAST *ast = new (pool) ObjCVisibilityDeclarationAST;
ast->at_token = at_token;
ast->visibility_token = visibility_token;
return ast;
}
......@@ -1433,6 +1444,7 @@ ObjCPropertyDeclarationAST *ObjCPropertyDeclarationAST::clone(MemoryPool *pool)
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->at_token = at_token;
ast->property_token = property_token;
ast->lparen_token = lparen_token;
for (ObjCPropertyAttributeListAST *iter = property_attribute_list, **ast_iter = &ast->property_attribute_list;
......@@ -1541,6 +1553,7 @@ ObjCFastEnumerationAST *ObjCFastEnumerationAST::clone(MemoryPool *pool) const
ObjCSynchronizedStatementAST *ObjCSynchronizedStatementAST::clone(MemoryPool *pool) const
{
ObjCSynchronizedStatementAST *ast = new (pool) ObjCSynchronizedStatementAST;
ast->at_token = at_token;
ast->synchronized_token = synchronized_token;
ast->lparen_token = lparen_token;
if (synchronized_object)
......
......@@ -1771,6 +1771,8 @@ bool ASTMatcher::match(StringLiteralAST *node, StringLiteralAST *pattern)
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->literal_token = node->literal_token;
if (! pattern->next)
......@@ -2063,6 +2065,8 @@ bool ASTMatcher::match(ObjCClassForwardDeclarationAST *node, ObjCClassForwardDec
else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
return false;
pattern->at_token = node->at_token;
pattern->class_token = node->class_token;
if (! pattern->identifier_list)
......@@ -2085,6 +2089,8 @@ bool ASTMatcher::match(ObjCClassDeclarationAST *node, ObjCClassDeclarationAST *p
else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
return false;
pattern->at_token = node->at_token;
pattern->interface_token = node->interface_token;
pattern->implementation_token = node->implementation_token;
......@@ -2125,6 +2131,8 @@ bool ASTMatcher::match(ObjCClassDeclarationAST *node, ObjCClassDeclarationAST *p
else if (! AST::match(node->member_declaration_list, pattern->member_declaration_list, this))
return false;
pattern->ending_at_token = node->ending_at_token;
pattern->end_token = node->end_token;
return true;
......@@ -2140,6 +2148,8 @@ bool ASTMatcher::match(ObjCProtocolForwardDeclarationAST *node, ObjCProtocolForw
else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
return false;
pattern->at_token = node->at_token;
pattern->protocol_token = node->protocol_token;
if (! pattern->identifier_list)
......@@ -2162,6 +2172,8 @@ bool ASTMatcher::match(ObjCProtocolDeclarationAST *node, ObjCProtocolDeclaration
else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
return false;
pattern->at_token = node->at_token;
pattern->protocol_token = node->protocol_token;
if (! pattern->name)
......@@ -2179,6 +2191,8 @@ bool ASTMatcher::match(ObjCProtocolDeclarationAST *node, ObjCProtocolDeclaration
else if (! AST::match(node->member_declaration_list, pattern->member_declaration_list, this))
return false;
pattern->ending_at_token = node->ending_at_token;
pattern->end_token = node->end_token;
return true;
......@@ -2246,6 +2260,8 @@ bool ASTMatcher::match(ObjCProtocolExpressionAST *node, ObjCProtocolExpressionAS
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->protocol_token = node->protocol_token;
pattern->lparen_token = node->lparen_token;
......@@ -2281,6 +2297,8 @@ bool ASTMatcher::match(ObjCEncodeExpressionAST *node, ObjCEncodeExpressionAST *p
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->encode_token = node->encode_token;
if (! pattern->type_name)
......@@ -2331,6 +2349,8 @@ bool ASTMatcher::match(ObjCSelectorExpressionAST *node, ObjCSelectorExpressionAS
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->selector_token = node->selector_token;
pattern->lparen_token = node->lparen_token;
......@@ -2367,6 +2387,8 @@ bool ASTMatcher::match(ObjCVisibilityDeclarationAST *node, ObjCVisibilityDeclara
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->visibility_token = node->visibility_token;
return true;
......@@ -2399,6 +2421,8 @@ bool ASTMatcher::match(ObjCPropertyDeclarationAST *node, ObjCPropertyDeclaration
else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
return false;
pattern->at_token = node->at_token;
pattern->property_token = node->property_token;
pattern->lparen_token = node->lparen_token;
......@@ -2587,6 +2611,8 @@ bool ASTMatcher::match(ObjCSynchronizedStatementAST *node, ObjCSynchronizedState
(void) node;
(void) pattern;
pattern->at_token = node->at_token;
pattern->synchronized_token = node->synchronized_token;
pattern->lparen_token = node->lparen_token;
......