Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
56f755ef
Commit
56f755ef
authored
Oct 20, 2009
by
Erik Verbruggen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed ObjC context keyword comparison to use identifiers.
parent
c5cf70c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
10 deletions
+61
-10
src/shared/cplusplus/CheckDeclaration.cpp
src/shared/cplusplus/CheckDeclaration.cpp
+9
-9
src/shared/cplusplus/Control.cpp
src/shared/cplusplus/Control.cpp
+42
-1
src/shared/cplusplus/Control.h
src/shared/cplusplus/Control.h
+10
-0
No files found.
src/shared/cplusplus/CheckDeclaration.cpp
View file @
56f755ef
...
...
@@ -700,26 +700,26 @@ bool CheckDeclaration::visit(ObjCPropertyDeclarationAST *ast)
if
(
!
attrAst
)
continue
;
const
char
*
attrName
=
spell
(
attrAst
->
attribute_identifier_token
);
if
(
!
strcmp
(
"getter"
,
attrName
))
{
Identifier
*
attrId
=
identifier
(
attrAst
->
attribute_identifier_token
);
if
(
attrId
==
control
()
->
objcGetterId
(
))
{
if
(
checkPropertyAttribute
(
attrAst
,
propAttrs
,
Getter
))
{
// TODO: find method declaration for getter
}
}
else
if
(
!
strcmp
(
"setter"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcSetterId
(
))
{
if
(
checkPropertyAttribute
(
attrAst
,
propAttrs
,
Setter
))
{
// TODO: find method declaration for setter
}
}
else
if
(
!
strcmp
(
"readwrite"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcReadwriteId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
ReadWrite
);
}
else
if
(
!
strcmp
(
"readonly"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcReadonlyId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
ReadOnly
);
}
else
if
(
!
strcmp
(
"assign"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcAssignId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
Assign
);
}
else
if
(
!
strcmp
(
"retain"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcRetainId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
Retain
);
}
else
if
(
!
strcmp
(
"copy"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcCopyId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
Copy
);
}
else
if
(
!
strcmp
(
"nonatomic"
,
attrName
))
{
}
else
if
(
attrId
==
control
()
->
objcNonatomicId
(
))
{
checkPropertyAttribute
(
attrAst
,
propAttrs
,
NonAtomic
);
}
}
...
...
src/shared/cplusplus/Control.cpp
View file @
56f755ef
...
...
@@ -89,7 +89,16 @@ public:
:
control
(
control
),
translationUnit
(
0
),
diagnosticClient
(
0
)
{
}
{
objcGetterId
=
control
->
findOrInsertIdentifier
(
"getter"
);
objcSetterId
=
control
->
findOrInsertIdentifier
(
"setter"
);
objcReadwriteId
=
control
->
findOrInsertIdentifier
(
"readwrite"
);
objcReadonlyId
=
control
->
findOrInsertIdentifier
(
"readonly"
);
objcAssignId
=
control
->
findOrInsertIdentifier
(
"assign"
);
objcRetainId
=
control
->
findOrInsertIdentifier
(
"retain"
);
objcCopyId
=
control
->
findOrInsertIdentifier
(
"copy"
);
objcNonatomicId
=
control
->
findOrInsertIdentifier
(
"nonatomic"
);
}
~
Data
()
{
...
...
@@ -577,6 +586,16 @@ public:
std
::
vector
<
ObjCForwardClassDeclaration
*>
objcForwardClassDeclarations
;
std
::
vector
<
ObjCForwardProtocolDeclaration
*>
objcForwardProtocolDeclarations
;
std
::
vector
<
ObjCMethod
*>
objcMethods
;
// ObjC context keywords:
Identifier
*
objcGetterId
;
Identifier
*
objcSetterId
;
Identifier
*
objcReadwriteId
;
Identifier
*
objcReadonlyId
;
Identifier
*
objcAssignId
;
Identifier
*
objcRetainId
;
Identifier
*
objcCopyId
;
Identifier
*
objcNonatomicId
;
};
Control
::
Control
()
...
...
@@ -766,4 +785,26 @@ ObjCForwardProtocolDeclaration *Control::newObjCForwardProtocolDeclaration(unsig
ObjCMethod
*
Control
::
newObjCMethod
(
unsigned
sourceLocation
,
Name
*
name
)
{
return
d
->
newObjCMethod
(
sourceLocation
,
name
);
}
Identifier
*
Control
::
objcGetterId
()
const
{
return
d
->
objcGetterId
;
}
Identifier
*
Control
::
objcSetterId
()
const
{
return
d
->
objcSetterId
;
}
Identifier
*
Control
::
objcReadwriteId
()
const
{
return
d
->
objcReadwriteId
;
}
Identifier
*
Control
::
objcReadonlyId
()
const
{
return
d
->
objcReadonlyId
;
}
Identifier
*
Control
::
objcAssignId
()
const
{
return
d
->
objcAssignId
;
}
Identifier
*
Control
::
objcRetainId
()
const
{
return
d
->
objcRetainId
;
}
Identifier
*
Control
::
objcCopyId
()
const
{
return
d
->
objcCopyId
;
}
Identifier
*
Control
::
objcNonatomicId
()
const
{
return
d
->
objcNonatomicId
;
}
src/shared/cplusplus/Control.h
View file @
56f755ef
...
...
@@ -169,6 +169,16 @@ public:
/// Creates a new Objective-C method symbol.
ObjCMethod
*
newObjCMethod
(
unsigned
sourceLocation
,
Name
*
name
=
0
);
// Objective-C specific context keywords.
Identifier
*
objcGetterId
()
const
;
Identifier
*
objcSetterId
()
const
;
Identifier
*
objcReadwriteId
()
const
;
Identifier
*
objcReadonlyId
()
const
;
Identifier
*
objcAssignId
()
const
;
Identifier
*
objcRetainId
()
const
;
Identifier
*
objcCopyId
()
const
;
Identifier
*
objcNonatomicId
()
const
;
Identifier
*
findIdentifier
(
const
char
*
chars
,
unsigned
size
)
const
;
Identifier
*
findOrInsertIdentifier
(
const
char
*
chars
,
unsigned
size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment