[geany/geany] 7d7606: Fortran: fix handling of pointer association operator

Colomban Wendling git-noreply at xxxxx
Mon Feb 17 22:17:35 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 17 Feb 2014 22:17:35 UTC
Commit:      7d760632824efacd44231f89d46de3a1deac64ec
             https://github.com/geany/geany/commit/7d760632824efacd44231f89d46de3a1deac64ec

Log Message:
-----------
Fortran: fix handling of pointer association operator

Test case contributed by Adam Hirst, thanks.

Closes #1030.


Modified Paths:
--------------
    tagmanager/ctags/fortran.c
    tests/ctags/Makefile.am
    tests/ctags/procpoint.f90
    tests/ctags/procpoint.f90.tags

Modified: tagmanager/ctags/fortran.c
3 files changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -1371,7 +1371,8 @@ static void parseEntityDecl (tokenInfo *const token)
 			readToken (token);
 			skipPast (token, TOKEN_OPERATOR);
 		}
-		else if (strcmp (vStringValue (token->string), "=") == 0)
+		else if (strcmp (vStringValue (token->string), "=") == 0 ||
+				 strcmp (vStringValue (token->string), "=>") == 0)
 		{
 			while (! isType (token, TOKEN_COMMA) &&
 					! isType (token, TOKEN_STATEMENT_END))


Modified: tests/ctags/Makefile.am
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -193,6 +193,7 @@ test_sources = \
 	Package.pm						\
 	php5_5_class_kw.php				\
 	procedure_pointer_module.f90	\
+	procpoint.f90					\
 	property.cs						\
 	prototype.h						\
 	pure_elem.f95					\


Modified: tests/ctags/procpoint.f90
32 files changed, 32 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,32 @@
+module Test
+  implicit none
+
+  procedure(ProcOne), pointer :: MyProc => null(), &
+  MyOtherProc => ProcTwo
+  real, parameter :: myparameter
+
+contains
+
+  function ProcOne(arg1, optformat)
+    ! not relevant
+  end function ProcOne
+
+  function ProcTwo(arg1, optformat)
+    ! not relevant
+  end function ProcTwo
+
+end module Test
+
+program Main
+  implicit none
+
+  ! deliberately break up the line to make sure the tagparser doesn't choke on awkward cases
+  procedure(:), pointer :: ProcPointOne &
+  => null(), ProcPointTwo => &
+  null()
+  real :: variable, variable_two
+  integer :: variable_three
+
+  ProcPointOne => ProcTwo
+
+end program Main


Modified: tests/ctags/procpoint.f90.tags
13 files changed, 13 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,13 @@
+# format=tagmanager
+MainÌ512Ö0
+MyOtherProcÌ16384ÎTestÖ0
+MyProcÌ16384ÎTestÖ0
+ProcOneÌ16ÎTestÖ0
+ProcPointOneÌ16384ÎMainÖ0
+ProcPointTwoÌ16384ÎMainÖ0
+ProcTwoÌ16ÎTestÖ0
+TestÌ256Ö0
+myparameterÌ16384ÎTestÖ0
+variableÌ16384ÎMainÖ0
+variable_threeÌ16384ÎMainÖ0
+variable_twoÌ16384ÎMainÖ0



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list