CPlusPlus lib: Add support for BINDABLE in Q_PROPERTY

Change-Id: I8ca00aff63261eea997267d41b12c2397d676748
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Leander Schulten
2020-12-24 01:42:10 +01:00
parent 47dfc16eee
commit c109b60cdf
3 changed files with 21 additions and 1 deletions

View File

@@ -2287,6 +2287,7 @@ bool Parser::parseAccessDeclaration(DeclarationAST *&node)
[SCRIPTABLE bool]
[STORED bool]
[USER bool]
[BINDABLE bindableFunction]
[CONSTANT]
[FINAL])
@@ -2342,6 +2343,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
case Token_READ:
case Token_WRITE:
case Token_MEMBER:
case Token_BINDABLE:
case Token_RESET:
case Token_NOTIFY:
case Token_REVISION:

View File

@@ -159,6 +159,23 @@ static inline int classify8(const char *s) {
}
}
}
if (s[0] == 'B') {
if (s[1] == 'I') {
if (s[2] == 'N') {
if (s[3] == 'D') {
if (s[4] == 'A') {
if (s[5] == 'B') {
if (s[6] == 'L') {
if (s[7] == 'E') {
return Token_BINDABLE;
}
}
}
}
}
}
}
}
return Token_not_Qt_context_keyword;
}

View File

@@ -37,7 +37,8 @@ enum {
Token_DESIGNABLE,
Token_SCRIPTABLE,
Token_REVISION,
Token_MEMBER
Token_MEMBER,
Token_BINDABLE
};
CPLUSPLUS_EXPORT int classifyQtContextKeyword(const char *s, int n);