summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Literals.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-09-02 11:59:01 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-09-02 12:51:01 +0200
commitc12866a467459f51e33252d5629edb8fbcd2201a (patch)
treee6f467fb02f751bed515d4348f7aa97119467af5 /src/shared/cplusplus/Literals.cpp
parent8b2eeb9c5f7f909a7067270854619af708e25e22 (diff)
downloadqt-creator-c12866a467459f51e33252d5629edb8fbcd2201a.tar.gz
Merge CPlusPlus::NameId and CPlusPlus::Identifier.
Diffstat (limited to 'src/shared/cplusplus/Literals.cpp')
-rw-r--r--src/shared/cplusplus/Literals.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Literals.cpp b/src/shared/cplusplus/Literals.cpp
index d56f937c48..9d1bf65225 100644
--- a/src/shared/cplusplus/Literals.cpp
+++ b/src/shared/cplusplus/Literals.cpp
@@ -47,6 +47,7 @@
// THE SOFTWARE.
#include "Literals.h"
+#include "NameVisitor.h"
#include <cstring>
#include <algorithm>
#include <iostream>
@@ -69,7 +70,7 @@ Literal::Literal(const char *chars, unsigned size)
Literal::~Literal()
{ delete[] _chars; }
-bool Literal::isEqualTo(const Literal *other) const
+bool Literal::equalTo(const Literal *other) const
{
if (! other)
return false;
@@ -212,3 +213,18 @@ Identifier::Identifier(const char *chars, unsigned size)
Identifier::~Identifier()
{ }
+void Identifier::accept0(NameVisitor *visitor) const
+{ visitor->visit(this); }
+
+bool Identifier::isEqualTo(const Name *other) const
+{
+ if (this == other)
+ return true;
+
+ else if (other) {
+ if (const Identifier *nameId = other->asNameId()) {
+ return equalTo(nameId);
+ }
+ }
+ return false;
+}