diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-07-22 11:27:43 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-07-22 11:27:43 (GMT) |
commit | d8908922f339892fee4275a433e2bf6da87ae055 (patch) | |
tree | 5a6c360e74f434b0b017a489bce5d08082866c28 /tools/qdoc3/cppcodeparser.cpp | |
parent | bad44806fd543b91777b69d9afb0e1dd4910b15a (diff) | |
download | Qt-d8908922f339892fee4275a433e2bf6da87ae055.zip Qt-d8908922f339892fee4275a433e2bf6da87ae055.tar.gz Qt-d8908922f339892fee4275a433e2bf6da87ae055.tar.bz2 |
qdoc: Fixed reporting of read-only status for QML properties.
Task-number: QTBUG-11512
Diffstat (limited to 'tools/qdoc3/cppcodeparser.cpp')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index d5108fd..a120e45 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1120,6 +1120,17 @@ bool CppCodeParser::match(int target) } /*! + Skip to \a target. If \a target is found before the end + of input, return true. Otherwise return false. + */ +bool CppCodeParser::skipTo(int target) +{ + while ((tok != Tok_Eoi) && (tok != target)) + readToken(); + return (tok == target ? true : false); +} + +/*! If the current token is one of the keyword thingees that are used in Qt, skip over it to the next token and return true. Otherwise just return false without reading the @@ -1362,7 +1373,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (!matchDataType(&returnType)) { if (tokenizer->parsingFnOrMacro() - && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY))) + && (match(Tok_Q_DECLARE_FLAGS) || + match(Tok_Q_PROPERTY) || + match(Tok_Q_PRIVATE_PROPERTY))) returnType = CodeChunk(previousLexeme()); else { return false; @@ -1796,11 +1809,19 @@ bool CppCodeParser::matchTypedefDecl(InnerNode *parent) bool CppCodeParser::matchProperty(InnerNode *parent) { - if (!match(Tok_Q_PROPERTY) && - !match(Tok_Q_OVERRIDE) && - !match(Tok_QDOC_PROPERTY)) + int expected_tok = Tok_LeftParen; + if (match(Tok_Q_PRIVATE_PROPERTY)) { + expected_tok = Tok_Comma; + if (!skipTo(Tok_Comma)) + return false; + } + else if (!match(Tok_Q_PROPERTY) && + !match(Tok_Q_OVERRIDE) && + !match(Tok_QDOC_PROPERTY)) { return false; - if (!match(Tok_LeftParen)) + } + + if (!match(expected_tok)) return false; QString name; @@ -1949,6 +1970,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent) break; case Tok_Q_OVERRIDE: case Tok_Q_PROPERTY: + case Tok_Q_PRIVATE_PROPERTY: case Tok_QDOC_PROPERTY: matchProperty(parent); break; |