all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kester Habermann <kester@linuxtag.org>
To: 5484@debbugs.gnu.org
Subject: bug#5484: etags: fortran 90 recursive functions not recognozed. patch included
Date: Wed, 27 Jan 2010 13:40:48 +0100	[thread overview]
Message-ID: <20100127124048.GV21514@linuxtag.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

Hello,

etags doesn't recognize a Fortran 90 function or subroutine if this is
declared recursive. I've created a patch for etags.c (version included
in emacs 23.1) that fixes the problem. As I'm not familiar with the
etags source code, I'm not sure if I did it the way it should be
done. For me the patch works and I have not noticed any side effects
so far, please check if this makes sense to you.

Example on reproducing the problem: For the included file 'foo.f90'
etags will produce:

TAGS:
foo.f90,48
subroutine sub(1,0
integer function func(5,50

As you see, some functions and subroutines were missed.

The patched version will produce:
TAGS:
subroutine sub(1,0
integer function func(5,50
recursive subroutine rsub(12,127
recursive integer function rfunc(16,189
recursive function rfunc2(22,278

This included all functions and subroutines.

Patch 'emacs-23.1-etags.patch' included (to be applied in
emacs-23.1/lib-src/)


Kind Regards

Kester
-- 
Program-Co-Chair LinuxTag 2010 Free Conference Program

LinuxTag 2010: Where .com meets .org - kester@linuxtag.org

[-- Attachment #2: emacs-23.1-etags.patch --]
[-- Type: text/x-diff, Size: 320 bytes --]

--- etags.c.orig	2009-06-21 06:37:34.000000000 +0200
+++ etags.c	2010-01-27 13:21:07.646105000 +0100
@@ -4108,6 +4108,10 @@
       dbp = skip_spaces (dbp);
       if (*dbp == '\0')
 	continue;
+
+      if (LOOKING_AT_NOCASE (dbp, "recursive"))
+	dbp = skip_spaces (dbp);
+
       switch (lowcase (*dbp))
 	{
 	case 'i':

[-- Attachment #3: foo.f90 --]
[-- Type: text/plain, Size: 436 bytes --]

subroutine sub(a)
  integer a
end subroutine sub

integer function func(a)
  integer a

  func = 0
  return
end function func

recursive subroutine rsub(a)
  integer a
end subroutine rsub

recursive integer function rfunc(a)
  integer a
  rfunc = 0
  return
end function rfunc

recursive function rfunc2(a) result(b)
  integer a
  integer b
  b = 0
  return
end function rfunc2

program test
  integer a

  call sub(a)
end program test

             reply	other threads:[~2010-01-27 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 12:40 Kester Habermann [this message]
2010-01-29 19:14 ` bug#5484: etags: fortran 90 recursive functions not recognozed. patch included Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100127124048.GV21514@linuxtag.org \
    --to=kester@linuxtag.org \
    --cc=5484@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.