From a755049931031d7e234ba157c960e7cf96489b2a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 24 May 2012 12:23:59 +0200 Subject: qdoc: Fixed pure doc parser This parser was meant to parse any file for qdoc comments only, ignoring everything else that is not inside a qdoc comment. But it wasn't doing that. It was parsing all code, regardless of the language, using the C++ parser. Now it has been corrected to look at qdoc comments and skip over everything else. Note thast this means qdoc will expect a qdoc topic command in each and every qdoc comment in the file. The posiution of the qdoc comment with respect to the code it is meant to document is not taken into account in the pure doc parser. This is in contrast to the QML and C++ parsers which do take comment location into account in some cases. Change-Id: I0804a4149baa942b463e0b6990c71e4039ac1a50 Reviewed-by: Keith Isdale Reviewed-by: Martin Smith --- src/tools/qdoc/tokenizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tools/qdoc/tokenizer.cpp') diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp index e9906a13c5..82effb9bae 100644 --- a/src/tools/qdoc/tokenizer.cpp +++ b/src/tools/qdoc/tokenizer.cpp @@ -460,7 +460,8 @@ int Tokenizer::getToken() default: // ### We should really prevent qdoc from looking at snippet files rather than // ### suppress warnings when reading them. - if (yyNumPreprocessorSkipping == 0 && !yyTokLoc.fileName().endsWith(".qdoc")) { + if (yyNumPreprocessorSkipping == 0 && !(yyTokLoc.fileName().endsWith(".qdoc") || + yyTokLoc.fileName().endsWith(".js"))) { yyTokLoc.warning(tr("Hostile character 0x%1 in C++ source") .arg((uchar)yyCh, 1, 16)); } -- cgit v1.2.3