Fixed problem with comment line after continuation character [Fortran, Bug #858165].
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@399 c5d04d22-be80-434c-894e-aa346cc9e8e8
This commit is contained in:
parent
38be352cdb
commit
40e6aea7f7
4
NEWS
4
NEWS
|
@ -1,6 +1,6 @@
|
|||
Current Version: @@VERSION@@
|
||||
|
||||
ctags-5.5.3 (Sat Feb 28 2004)
|
||||
ctags-5.5.3 (Sun Feb 29 2004)
|
||||
* Removed forgotten debug statement [Bug #811704].
|
||||
* Added support for Perl "use constant" [Perl, Patch #853704].
|
||||
* Added support for "and" keyword [SML, Bug #816636].
|
||||
|
@ -16,6 +16,8 @@ ctags-5.5.3 (Sat Feb 28 2004)
|
|||
* Fixed spurious local tags for statements following labels [C].
|
||||
* Fixed missing tags for certain scoped functions [Vim].
|
||||
* Fixed missing tags for certain initializers [Fortran, Bug #877956].
|
||||
* Fixed problem with comment line after continuation character [Fortran,
|
||||
Bug #858165].
|
||||
|
||||
ctags-5.5.2 (Wed Sep 17 2003)
|
||||
* Added tags for local variables for C-based languages [C/C++/C#/Java/Vera,
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
! Bugs item #858165, was opened at 2003-12-11 10:09
|
||||
! Message generated for change (Tracker Item Submitted) made by Item Submitter
|
||||
! You can respond by visiting:
|
||||
! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=858165&group_id=6556
|
||||
!
|
||||
! Category: None
|
||||
! Group: None
|
||||
! Status: Open
|
||||
! Resolution: None
|
||||
! Priority: 5
|
||||
! Submitted By: Blazej Krzeminski (blazk)
|
||||
! Assigned to: Nobody/Anonymous (nobody)
|
||||
! Summary: Fortran90: comment line after continuation character &
|
||||
!
|
||||
! Initial Comment:
|
||||
program test
|
||||
|
||||
integer :: a, & !comment on variable a
|
||||
b, & !comment on variable b
|
||||
!more comment on variable b, CTAGS STOPS HERE
|
||||
c, & !comment on variable c
|
||||
d !comment on variable d
|
||||
end program test
|
||||
|
||||
! ctags will index program test, a,b but not c,d
|
34
fortran.c
34
fortran.c
|
@ -696,29 +696,47 @@ static int skipToNextLine (void)
|
|||
static int getFreeFormChar (void)
|
||||
{
|
||||
static boolean newline = TRUE;
|
||||
boolean recurse = FALSE;
|
||||
boolean advanceLine = FALSE;
|
||||
int c = fileGetc ();
|
||||
|
||||
if (c == '&') /* handle line continuation */
|
||||
/* If the last nonblank, non-comment character of a FORTRAN 90
|
||||
* free-format text line is an ampersand then the next non-comment
|
||||
* line is a continuation line.
|
||||
*/
|
||||
if (c == '&')
|
||||
{
|
||||
recurse = TRUE;
|
||||
c = fileGetc ();
|
||||
do
|
||||
c = fileGetc ();
|
||||
while (isspace (c) && c != '\n');
|
||||
if (c == '\n')
|
||||
{
|
||||
newline = TRUE;
|
||||
advanceLine = TRUE;
|
||||
}
|
||||
else if (c == '!')
|
||||
advanceLine = TRUE;
|
||||
else
|
||||
{
|
||||
fileUngetc (c);
|
||||
c = '&';
|
||||
}
|
||||
}
|
||||
else if (newline && (c == '!' || c == '#'))
|
||||
recurse = TRUE;
|
||||
while (recurse)
|
||||
advanceLine = TRUE;
|
||||
while (advanceLine)
|
||||
{
|
||||
while (isspace (c))
|
||||
c = fileGetc ();
|
||||
while (c == '!' || (newline && c == '#'))
|
||||
if (c == '!' || (newline && c == '#'))
|
||||
{
|
||||
c = skipToNextLine ();
|
||||
newline = TRUE;
|
||||
continue;
|
||||
}
|
||||
if (c == '&')
|
||||
c = fileGetc ();
|
||||
else
|
||||
recurse = FALSE;
|
||||
advanceLine = FALSE;
|
||||
}
|
||||
newline = (boolean) (c == '\n');
|
||||
return c;
|
||||
|
|
Loading…
Reference in New Issue