diff options
author | albert-github <albert.tests@gmail.com> | 2014-03-09 17:57:12 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2014-03-09 17:57:12 (GMT) |
commit | 2dec1060623165057628ee678eb3580351922408 (patch) | |
tree | 24f78a22f5220010d75f86a6f6702996b7d1fb0a /src/fortranscanner.l | |
parent | 8eeaae0b06fd320745f22efe176e0f19d6c8e2a6 (diff) | |
download | Doxygen-2dec1060623165057628ee678eb3580351922408.zip Doxygen-2dec1060623165057628ee678eb3580351922408.tar.gz Doxygen-2dec1060623165057628ee678eb3580351922408.tar.bz2 |
Bug 625601 - FORTRAN: recognition free versus fixed formatted code
The recognition of the type (free or fixed) of Fortran code is not reliable possible. A well known possibility as used with compilers as well is to specify the type of code by means of the extension.
With EXTENSION_MAPPING it is possible to select the type of Fortran code, when not explicitly set doxygen tries to guess the type of Fortran code.
Diffstat (limited to 'src/fortranscanner.l')
-rw-r--r-- | src/fortranscanner.l | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 623f587..f34ad21 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -187,7 +187,7 @@ static InterfaceType ifType = IF_NONE; static bool functionLine = FALSE; static char stringStartSymbol; // single or double quote -static bool parsingPrototype = FALSE; // see parsePrototype() +static bool parsingPrototype = FALSE; // see parsePrototype() //! Accumulated modifiers of current statement, eg variable declaration. static SymbolModifiers currentModifiers; @@ -1313,11 +1313,14 @@ void truncatePrepass(int index) // simplified way to know if this is fixed form // duplicate in fortrancode.l -static bool recognizeFixedForm(const char* contents) +static bool recognizeFixedForm(const char* contents, FortranKind codeType) { int column=0; bool skipLine=FALSE; + if (codeType == FORTRAN_FIXED) return TRUE; + if (codeType == FORTRAN_FREE) return FALSE; + for(int i=0;;i++) { column++; @@ -2243,7 +2246,7 @@ level--; #endif -static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) +static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, FortranKind codeType) { char *tmpBuf = NULL; initParser(); @@ -2263,7 +2266,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) inputFile.setName(fileName); if (inputFile.open(IO_ReadOnly)) { - isFixedForm = recognizeFixedForm(fileBuf); + isFixedForm = recognizeFixedForm(fileBuf,codeType); if (isFixedForm) { @@ -2342,7 +2345,7 @@ void FortranLanguageScanner::parseInput(const char *fileName, printlex(yy_flex_debug, TRUE, __FILE__, fileName); - ::parseMain(fileName,fileBuf,root); + ::parseMain(fileName,fileBuf,root,this->codeType); printlex(yy_flex_debug, FALSE, __FILE__, fileName); } @@ -2365,7 +2368,7 @@ void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, { ::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, fileDef,startLine,endLine,inlineFragment,memberDef, - showLineNumbers,searchCtx,collectXRefs); + showLineNumbers,searchCtx,collectXRefs,this->codeType); } bool FortranLanguageScanner::needsPreprocessing(const QCString &extension) |