diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-02-20 13:52:24 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-02-20 13:52:24 +0100 |
commit | e67b2453c8996be3d1cdbdac5744d4028600f60c (patch) | |
tree | d5e7a83db9899eb4d5fcb9152dc70aa1ff92b75f /src/plugins/cpptools/cppdoxygen.cpp | |
parent | 5f7ab722b0b2faeba6ae2e29fb6d9faeeef7309d (diff) | |
download | qt-creator-e67b2453c8996be3d1cdbdac5744d4028600f60c.tar.gz |
Added support for some qdoc tags.
Diffstat (limited to 'src/plugins/cpptools/cppdoxygen.cpp')
-rw-r--r-- | src/plugins/cpptools/cppdoxygen.cpp | 173 |
1 files changed, 166 insertions, 7 deletions
diff --git a/src/plugins/cpptools/cppdoxygen.cpp b/src/plugins/cpptools/cppdoxygen.cpp index 5f00315714..c98441a249 100644 --- a/src/plugins/cpptools/cppdoxygen.cpp +++ b/src/plugins/cpptools/cppdoxygen.cpp @@ -163,9 +163,28 @@ static const char *doxy_token_spell[] = { "skipline", "typedef", "until", - "var" + "var", + + // qdoc + "endlist", + "endtable", + "header", + "i", + "l", + "list", + "mainclass", + "newcode", + "o", + "oldcode", + "property", + "row", + "section1", + "table" }; +const char *CppTools::doxygenTagSpell(int index) +{ return doxy_token_spell[index]; } + static inline int classify1(const QChar *s) { if (s[0].unicode() == 'a') { return T_DOXY_A; @@ -179,9 +198,18 @@ static inline int classify1(const QChar *s) { else if (s[0].unicode() == 'e') { return T_DOXY_E; } + else if (s[0].unicode() == 'i') { + return T_DOXY_I; + } + else if (s[0].unicode() == 'l') { + return T_DOXY_L; + } else if (s[0].unicode() == 'n') { return T_DOXY_N; } + else if (s[0].unicode() == 'o') { + return T_DOXY_O; + } else if (s[0].unicode() == 'p') { return T_DOXY_P; } @@ -262,6 +290,11 @@ static inline int classify3(const QChar *s) { return T_DOXY_REF; } } + else if (s[1].unicode() == 'o') { + if (s[2].unicode() == 'w') { + return T_DOXY_ROW; + } + } } else if (s[0].unicode() == 's') { if (s[1].unicode() == 'e') { @@ -339,6 +372,11 @@ static inline int classify4(const QChar *s) { return T_DOXY_LINK; } } + else if (s[2].unicode() == 's') { + if (s[3].unicode() == 't') { + return T_DOXY_LIST; + } + } } } else if (s[0].unicode() == 'n') { @@ -496,7 +534,16 @@ static inline int classify5(const QChar *s) { } } else if (s[0].unicode() == 't') { - if (s[1].unicode() == 'h') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 'b') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'e') { + return T_DOXY_TABLE; + } + } + } + } + else if (s[1].unicode() == 'h') { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'w') { @@ -576,6 +623,19 @@ static inline int classify6(const QChar *s) { } } } + else if (s[0].unicode() == 'h') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'd') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'r') { + return T_DOXY_HEADER; + } + } + } + } + } + } else if (s[0].unicode() == 'r') { if (s[1].unicode() == 'e') { if (s[2].unicode() == 't') { @@ -680,6 +740,11 @@ static inline int classify7(const QChar *s) { return T_DOXY_ENDLINK; } } + else if (s[5].unicode() == 's') { + if (s[6].unicode() == 't') { + return T_DOXY_ENDLIST; + } + } } } } @@ -739,6 +804,36 @@ static inline int classify7(const QChar *s) { } } } + else if (s[0].unicode() == 'n') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'w') { + if (s[3].unicode() == 'c') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'd') { + if (s[6].unicode() == 'e') { + return T_DOXY_NEWCODE; + } + } + } + } + } + } + } + else if (s[0].unicode() == 'o') { + if (s[1].unicode() == 'l') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 'c') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'd') { + if (s[6].unicode() == 'e') { + return T_DOXY_OLDCODE; + } + } + } + } + } + } + } else if (s[0].unicode() == 'p') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'c') { @@ -904,6 +999,23 @@ static inline int classify8(const QChar *s) { } } } + else if (s[0].unicode() == 'e') { + if (s[1].unicode() == 'n') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 'b') { + if (s[6].unicode() == 'l') { + if (s[7].unicode() == 'e') { + return T_DOXY_ENDTABLE; + } + } + } + } + } + } + } + } else if (s[0].unicode() == 'h') { if (s[1].unicode() == 't') { if (s[2].unicode() == 'm') { @@ -972,8 +1084,40 @@ static inline int classify8(const QChar *s) { } } } + else if (s[0].unicode() == 'p') { + if (s[1].unicode() == 'r') { + if (s[2].unicode() == 'o') { + if (s[3].unicode() == 'p') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'y') { + return T_DOXY_PROPERTY; + } + } + } + } + } + } + } + } else if (s[0].unicode() == 's') { - if (s[1].unicode() == 'k') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'n') { + if (s[7].unicode() == '1') { + return T_DOXY_SECTION1; + } + } + } + } + } + } + } + else if (s[1].unicode() == 'k') { if (s[2].unicode() == 'i') { if (s[3].unicode() == 'p') { if (s[4].unicode() == 'l') { @@ -1137,6 +1281,25 @@ static inline int classify9(const QChar *s) { } } } + else if (s[0].unicode() == 'm') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 'i') { + if (s[3].unicode() == 'n') { + if (s[4].unicode() == 'c') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 'a') { + if (s[7].unicode() == 's') { + if (s[8].unicode() == 's') { + return T_DOXY_MAINCLASS; + } + } + } + } + } + } + } + } + } else if (s[0].unicode() == 'n') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'm') { @@ -1608,9 +1771,6 @@ static inline int classify15(const QChar *s) { return T_DOXY_IDENTIFIER; } -const char *CppTools::doxygenTagSpell(int index) -{ return doxy_token_spell[index]; } - int CppTools::classifyDoxygenTag(const QChar *s, int n) { switch (n) { case 1: return classify1(s); @@ -1630,4 +1790,3 @@ int CppTools::classifyDoxygenTag(const QChar *s, int n) { default: return T_DOXY_IDENTIFIER; } // switch } - |