Commit 772046d4 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Merge pull request #257 from albert-github/feature/bug_fortran_inline

Support for INLINE_SOURCES in Fortran
parents 03f779ae 940a802a
......@@ -472,6 +472,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
}
^{BS}interface{BS_}{ID}{ARGS}? { ifType = IF_GENERIC;
current->bodyLine = yyLineNr + lineCountPrepass + 1; // we have to be at the line after the definition and we have to take continuation lines into account.
yy_push_state(InterfaceBody);
// extract generic name
......@@ -484,6 +485,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
<InterfaceBody>^{BS}end{BS}interface({BS_}{ID})? {
// end scope only if GENERIC interface
last_entry->parent()->endBodyLine = yyLineNr - 1;
if (ifType == IF_GENERIC && !endScope(current_root))
yyterminate();
......@@ -611,6 +613,7 @@ private {
current->name = yytext;
current->fileName = yyFileName;
current->bodyLine = yyLineNr;
current->startLine = yyLineNr;
/* if type is part of a module, mod name is necessary for output */
if ((current_root) &&
......@@ -651,6 +654,7 @@ private {
current->name = name;
current->fileName = yyFileName;
current->bodyLine = yyLineNr;
current->startLine = yyLineNr;
addCurrentEntry(1);
}
{BS}"=>"[^(\n|\!)]* { /* Specific bindings come after the ID. */
......@@ -666,6 +670,7 @@ private {
<TypedefBody,TypedefBodyContains>{
^{BS}"end"{BS}"type"({BS_}{ID})?{BS}/(\n|!) { /* end type definition */
last_entry->parent()->endBodyLine = yyLineNr;
if (!endScope(current_root))
yyterminate();
typeMode = false;
......@@ -681,6 +686,7 @@ private {
// in a scope of their own, even if multiple
// are group in one INTERFACE/END INTERFACE block.
//
last_entry->endBodyLine = yyLineNr - 1;
if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC)
endScope(current_root);
......@@ -695,6 +701,8 @@ private {
}
<Start,ModuleBody,TypedefBody,SubprogBody>{
^{BS}{TYPE_SPEC}/{SEPARATE} {
current->bodyLine = yyLineNr + 1;
current->endBodyLine = yyLineNr + lineCountPrepass;
/* variable declaration starts */
if(YY_START == Start)
{
......@@ -806,6 +814,7 @@ private {
current->type = argType;
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->startLine = yyLineNr;
addCurrentEntry(1);
}
else if (!argType.isEmpty())
......@@ -885,7 +894,8 @@ private {
// locate !< comment
updateVariablePrepassComment(yyColNr-(int)yyleng, yyColNr);
}
<Variable>{BS}"=" { yy_push_state(YY_START);
<Variable>{BS}"=" {
yy_push_state(YY_START);
initializer="=";
initializerScope = initializerArrayScope = 0;
BEGIN(Initialization);
......@@ -986,6 +996,8 @@ private {
result = QCString(yytext).stripWhiteSpace();
addSubprogram(result);
yy_push_state(Subprog);
current->bodyLine = yyLineNr + lineCountPrepass + 1; // we have to be at the line after the definition and we have to take continuation lines into account.
current->startLine = yyLineNr;
}
<Subprog>{BS} { /* ignore white space */ }
......@@ -1493,7 +1505,9 @@ static void copyEntry(Entry *dest, Entry *src)
{
dest->type = src->type;
dest->fileName = src->fileName;
dest->startLine = src->startLine;
dest->bodyLine = src->bodyLine;
dest->endBodyLine = src->endBodyLine;
dest->args = src->args;
dest->argList = new ArgumentList(*src->argList);
dest->doc = src->doc;
......@@ -2048,6 +2062,7 @@ static void addModule(const char *name, bool isModule)
current->type = "program";
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->startLine = yyLineNr;
current->protection = Public ;
addCurrentEntry(1);
startScope(last_entry);
......@@ -2064,8 +2079,8 @@ static void addSubprogram(const char *text)
current->type += " " + subtype;
current->type = current->type.stripWhiteSpace();
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->startLine = -1; // ??? what is startLine for?
current->bodyLine = yyLineNr; // used for source reference start of body of routine
current->startLine = yyLineNr; // used for source reference start of definition
current->args.resize(0);
current->argList->clear();
docBlock.resize(0);
......@@ -2113,6 +2128,7 @@ static void addInterface(QCString name, InterfaceType type)
current->fileName = yyFileName;
current->bodyLine = yyLineNr;
current->startLine = yyLineNr;
addCurrentEntry(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment