diff options
author | albert-github <albert.tests@gmail.com> | 2020-03-08 11:41:56 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-03-08 11:41:56 (GMT) |
commit | 98302da8f020c339960617761a8e5a4dd602f5ca (patch) | |
tree | ce5612e54cd5d17c1cf60f2ce04391770d804113 /src/pre.l | |
parent | fbebfae209139fccb15fde8fb7d1bdbb4b941875 (diff) | |
download | Doxygen-98302da8f020c339960617761a8e5a4dd602f5ca.zip Doxygen-98302da8f020c339960617761a8e5a4dd602f5ca.tar.gz Doxygen-98302da8f020c339960617761a8e5a4dd602f5ca.tar.bz2 |
Function definitions at begin of a line
When we have an Fortran source that needs preprocessing like:
```
INTEGER FUNCTION &
BI()
END FUNCTION BI
```
the preprocessor will output:
```
00001 INTEGER FUNCTION &
00002
00003 END FUNCTION BI
```
we see that the function name (and argumentlist (`BI()`) are gone, resulting in the error:
```
Error in file .../test.F90 line: 4, state: 4(SubprogBody)
```
The original problem came from the `BIND` attribute (as found by Fossies in the HDF5 package), but the example has been reduced to the above example.
Diffstat (limited to 'src/pre.l')
-rw-r--r-- | src/pre.l | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -376,6 +376,7 @@ struct preYY_state bool skip; QStack<CondCtx> condStack; bool insideCS; // C# has simpler preprocessor + bool insideFtn; bool isSource; int fenceSize = 0; @@ -495,7 +496,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) name=name.left(name.find('(')).stripWhiteSpace(); Define *def=0; - if (skipFuncMacros && + if (skipFuncMacros && !yyextra->insideFtn && name!="Q_PROPERTY" && !( (yyextra->includeStack.isEmpty() || yyextra->curlyCount>0) && @@ -1711,6 +1712,7 @@ static void setFileName(yyscan_t yyscanner,const char *name) // name,state->yyFileName.data(),state->yyFileDef); if (state->yyFileDef && state->yyFileDef->isReference()) state->yyFileDef=0; state->insideCS = getLanguageFromFileName(state->yyFileName)==SrcLangExt_CSharp; + state->insideFtn = getLanguageFromFileName(state->yyFileName)==SrcLangExt_Fortran; state->isSource = guessSection(state->yyFileName); } |