OSDN Git Service

C++ parser: Don't fail on REVISION in Q_PROPERTY.
authorChristian Kamm <christian.d.kamm@nokia.com>
Tue, 25 Oct 2011 11:42:07 +0000 (13:42 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Tue, 25 Oct 2011 12:30:03 +0000 (14:30 +0200)
Change-Id: Ia7407969dc56308fe3eb843e97b93e65eb235186
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/libs/3rdparty/cplusplus/Bind.cpp
src/libs/3rdparty/cplusplus/Parser.cpp
src/libs/3rdparty/cplusplus/QtContextKeywords.cpp
src/libs/3rdparty/cplusplus/QtContextKeywords.h

index 3242027..7301686 100644 (file)
@@ -1909,6 +1909,8 @@ bool Bind::visit(QtPropertyDeclarationAST *ast)
             flags |= QtPropertyDeclaration::ResetFunction;
         } else if (name == "NOTIFY") {
             flags |= QtPropertyDeclaration::NotifyFunction;
+        } else if (name == "REVISION") {
+            // ### handle REVISION property
         } else if (name == "DESIGNABLE") {
             qtPropertyAttribute(translationUnit(), it->value->expression, &flags,
                                 QtPropertyDeclaration::DesignableFlag, QtPropertyDeclaration::DesignableFunction);
index 747491d..d0e9dc7 100644 (file)
@@ -1999,6 +1999,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
                 case Token_WRITE:
                 case Token_RESET:
                 case Token_NOTIFY:
+                case Token_REVISION:
                 case Token_DESIGNABLE:
                 case Token_SCRIPTABLE:
                 case Token_STORED:
index f4f7a7d..cc4fdff 100644 (file)
@@ -110,6 +110,23 @@ static inline int classify8(const char *s) {
       }
     }
   }
+  if (s[0] == 'R') {
+    if (s[1] == 'E') {
+      if (s[2] == 'V') {
+        if (s[3] == 'I') {
+          if (s[4] == 'S') {
+            if (s[5] == 'I') {
+              if (s[6] == 'O') {
+                if (s[7] == 'N') {
+                  return Token_REVISION;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
   return Token_not_Qt_context_keyword;
 }
 
index f3ea763..b84ccf6 100644 (file)
@@ -17,7 +17,8 @@ enum {
     Token_STORED,
     Token_CONSTANT,
     Token_DESIGNABLE,
-    Token_SCRIPTABLE
+    Token_SCRIPTABLE,
+    Token_REVISION
 };
 
 CPLUSPLUS_EXPORT int classifyQtContextKeyword(const char *s, int n);