diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2018-10-28 12:55:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-28 12:55:50 (GMT) |
commit | 99d49a1875dccb696028dbab83f97011543586e5 (patch) | |
tree | 23648c75a9c62fab8b3d05f6a5df032238dd2347 | |
parent | 6920a401aad289054dff87f8dedb7c54f80c7d7d (diff) | |
parent | ee12e104e1f43aa4e5301b314f7c620dbbf58ecc (diff) | |
download | Doxygen-99d49a1875dccb696028dbab83f97011543586e5.zip Doxygen-99d49a1875dccb696028dbab83f97011543586e5.tar.gz Doxygen-99d49a1875dccb696028dbab83f97011543586e5.tar.bz2 |
Merge pull request #6572 from albert-github/feature/bug_fortran_state_debug
Fortran scanner abort message
-rw-r--r-- | src/fortranscanner.l | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 2bd6788..5f10669 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -231,6 +231,8 @@ static void updateVariablePrepassComment(int from, int to); static void newLine(); static void initEntry(); +static const char *stateToString(int state); + //----------------------------------------------------------------------------- #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); @@ -2759,7 +2761,7 @@ void FortranLanguageScanner::parsePrototype(const char *text) static void scanner_abort() { fprintf(stderr,"********************************************************************\n"); - fprintf(stderr,"Error in file %s line: %d, state: %d\n",yyFileName.data(),yyLineNr,YY_START); + fprintf(stderr,"Error in file %s line: %d, state: %d(%s)\n",yyFileName.data(),yyLineNr,YY_START,stateToString(YY_START)); fprintf(stderr,"********************************************************************\n"); EntryListIterator eli(*global_root->children()); @@ -2788,3 +2790,47 @@ extern "C" { // some bogus code to keep the compiler happy } #endif +#define scanStateToString(x) case x: resultString = #x; break; +static const char *stateToString(int state) +{ + const char *resultString; + switch(state) + { + scanStateToString(INITIAL) + scanStateToString(Subprog) + scanStateToString(SubprogPrefix) + scanStateToString(Parameterlist) + scanStateToString(SubprogBody) + scanStateToString(SubprogBodyContains) + scanStateToString(Start) + scanStateToString(Comment) + scanStateToString(Module) + scanStateToString(Program) + scanStateToString(ModuleBody) + scanStateToString(ModuleBodyContains) + scanStateToString(AttributeList) + scanStateToString(Variable) + scanStateToString(Initialization) + scanStateToString(ArrayInitializer) + scanStateToString(Enum) + scanStateToString(Typedef) + scanStateToString(TypedefBody) + scanStateToString(TypedefBodyContains) + scanStateToString(InterfaceBody) + scanStateToString(StrIgnore) + scanStateToString(String) + scanStateToString(Use) + scanStateToString(UseOnly) + scanStateToString(ModuleProcedure) + scanStateToString(Prepass) + scanStateToString(DocBlock) + scanStateToString(DocBackLine) + scanStateToString(EndDoc) + scanStateToString(BlockData) + scanStateToString(Prototype) + scanStateToString(PrototypeSubprog) + scanStateToString(PrototypeArgs) + default: resultString = "Unknown"; break; + } + return resultString; +} |