diff options
author | albert-github <albert.tests@gmail.com> | 2020-12-16 10:02:47 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-12-16 10:02:47 (GMT) |
commit | f573b414b482a01e87869a277cdb913d173fc925 (patch) | |
tree | 673fcfe296c39129da4c929e332727e40c0ed63d /addon/doxywizard/config_doxyw.l | |
parent | 7b2e841b3a3d7d787458f236e2447c890cfbf590 (diff) | |
download | Doxygen-f573b414b482a01e87869a277cdb913d173fc925.zip Doxygen-f573b414b482a01e87869a277cdb913d173fc925.tar.gz Doxygen-f573b414b482a01e87869a277cdb913d173fc925.tar.bz2 |
Improvements of reading the configuration file
- making the parsing of the configuration consistent with the reading of the configuration file a doxygen run
- adding a number of warnings in case of problems in the configuration file
- making the configuration warnings better visible (popping up the "Output log Window").
Diffstat (limited to 'addon/doxywizard/config_doxyw.l')
-rw-r--r-- | addon/doxywizard/config_doxyw.l | 62 |
1 files changed, 7 insertions, 55 deletions
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l index 71d48c9..38d9f38 100644 --- a/addon/doxywizard/config_doxyw.l +++ b/addon/doxywizard/config_doxyw.l @@ -24,7 +24,7 @@ #include "config.h" #include "input.h" #include "inputstring.h" -#include "doxywizard.h" +#include "config_msg.h" #include <QString> #include <QVariant> @@ -93,48 +93,6 @@ static yy_size_t yyread(char *buf,yy_size_t maxSize) } } -static QString warning_str = QString::fromLatin1("warning: "); -static QString error_str = QString::fromLatin1("error: "); - -void config_err(const char *fmt, ...) -{ - QString msg = error_str; - - msg.append(QString::fromLatin1(fmt)); - va_list args; - va_start(args, fmt); - if (DoxygenWizard::debugFlag) - { - char debugOut[1000]; // this size should be sufficient - vsnprintf(debugOut, 1000,qPrintable(msg), args); - MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); - } - else - { - vfprintf(stderr, qPrintable(msg), args); - } - va_end(args); -} -void config_warn(const char *fmt, ...) -{ - QString msg = warning_str; - - msg.append(QString::fromLatin1(fmt)); - va_list args; - va_start(args, fmt); - if (DoxygenWizard::debugFlag) - { - char debugOut[1000]; - vsnprintf(debugOut, 1000,qPrintable(msg), args); - MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); - } - else - { - vfprintf(stderr, qPrintable(msg), args); - } - va_end(args); -} - static void substEnvVarsInStrList(QStringList &sl); static void substEnvVarsInString(QString &s); @@ -190,9 +148,8 @@ static void readIncludeFile(const QString &incName) { if (g_includeDepth==MAX_INCLUDE_DEPTH) { - config_err("maximum include depth (%d) reached, %s is not included. Aborting...\n", + config_err("maximum include depth (%d) reached, %s is not included.", MAX_INCLUDE_DEPTH,qPrintable(incName)); - exit(1); } QString inc = incName; @@ -230,7 +187,6 @@ static void readIncludeFile(const QString &incName) else { config_err("@INCLUDE = %s: not found!\n",qPrintable(inc)); - exit(1); } } @@ -495,9 +451,11 @@ static void readIncludeFile(const QString &incName) } <SkipComment>\n { BEGIN(Start); } <SkipComment>\\[ \r\t]*\n { BEGIN(Start); } +<SkipComment,SkipInvalid>. { } <*>\\[ \r\t]*\n { } +<*>[ \r\t] { } <*>\n -<*>. +<*>. { config_warn("ignoring unknown character '%c' at line %d, file %s\n",yytext[0],yylineno,qPrintable(g_yyFileName)); } %% @@ -607,10 +565,7 @@ bool parseConfig( ) { yylineno = 1; - if (DoxygenWizard::debugFlag) - { - MainWindow::instance().outputLogStart(); - } + config_open(); QHashIterator<QString, Input*> i(options); g_file = fopen(fileName.toLocal8Bit(),"r"); if (g_file==NULL) return false; @@ -651,10 +606,7 @@ bool parseConfig( } } fclose(g_file); - if (DoxygenWizard::debugFlag) - { - MainWindow::instance().outputLogFinish(); - } + config_finish(); return true; } |