Merge branch 'pb/userdiff-fortran-update'
The regexp to identify the function boundary for FORTRAN programs has been updated. * pb/userdiff-fortran-update: userdiff: improve Fortran xfuncname regex userdiff: add tests for Fortran xfuncname regexmaint
commit
b350c4debe
|
@ -0,0 +1,5 @@
|
|||
BLOCK DATA RIGHT
|
||||
|
||||
COMMON /B/ C, ChangeMe
|
||||
DATA C, ChangeMe / 2.0, 6.0 /
|
||||
END
|
|
@ -0,0 +1,13 @@
|
|||
module a
|
||||
|
||||
contains
|
||||
|
||||
! subroutine wrong
|
||||
subroutine RIGHT
|
||||
! subroutine wrong
|
||||
|
||||
real ChangeMe
|
||||
|
||||
end subroutine RIGHT
|
||||
|
||||
end module a
|
|
@ -0,0 +1,14 @@
|
|||
module a
|
||||
|
||||
contains
|
||||
|
||||
subroutine RIGHT (funcA, funcB)
|
||||
|
||||
real funcA ! grid function a
|
||||
real funcB ! grid function b
|
||||
|
||||
real ChangeMe
|
||||
|
||||
end subroutine RIGHT
|
||||
|
||||
end module a
|
|
@ -0,0 +1,13 @@
|
|||
module a
|
||||
|
||||
contains
|
||||
|
||||
C subroutine wrong
|
||||
subroutine RIGHT
|
||||
C subroutine wrong
|
||||
|
||||
real ChangeMe
|
||||
|
||||
end subroutine RIGHT
|
||||
|
||||
end module a
|
|
@ -0,0 +1,13 @@
|
|||
module a
|
||||
|
||||
contains
|
||||
|
||||
* subroutine wrong
|
||||
subroutine RIGHT
|
||||
* subroutine wrong
|
||||
|
||||
real ChangeMe
|
||||
|
||||
end subroutine RIGHT
|
||||
|
||||
end module a
|
|
@ -0,0 +1,9 @@
|
|||
function RIGHT(a, b) result(c)
|
||||
|
||||
integer, intent(in) :: ChangeMe
|
||||
integer, intent(in) :: b
|
||||
integer, intent(out) :: c
|
||||
|
||||
c = a+b
|
||||
|
||||
end function RIGHT
|
|
@ -0,0 +1,5 @@
|
|||
subroutine RIGHT
|
||||
|
||||
real ChangeMe
|
||||
|
||||
end subroutine RIGHT
|
|
@ -0,0 +1,5 @@
|
|||
module RIGHT
|
||||
|
||||
use ChangeMe
|
||||
|
||||
end module RIGHT
|
|
@ -0,0 +1,13 @@
|
|||
module RIGHT
|
||||
|
||||
implicit none
|
||||
private
|
||||
|
||||
interface letters ! generic interface
|
||||
module procedure aaaa, &
|
||||
bbbb, &
|
||||
ChangeMe, &
|
||||
dddd
|
||||
end interface
|
||||
|
||||
end module RIGHT
|
|
@ -0,0 +1,5 @@
|
|||
program RIGHT
|
||||
|
||||
call ChangeMe
|
||||
|
||||
end program RIGHT
|
|
@ -46,10 +46,14 @@ PATTERNS("elixir",
|
|||
/* Not real operators, but should be grouped */
|
||||
"|:?%[A-Za-z0-9_.]\\{\\}?"),
|
||||
IPATTERN("fortran",
|
||||
/* Don't match comment lines */
|
||||
"!^([C*]|[ \t]*!)\n"
|
||||
/* Don't match 'module procedure' lines */
|
||||
"!^[ \t]*MODULE[ \t]+PROCEDURE[ \t]\n"
|
||||
/* Program, module, block data */
|
||||
"^[ \t]*((END[ \t]+)?(PROGRAM|MODULE|BLOCK[ \t]+DATA"
|
||||
"|([^'\" \t]+[ \t]+)*(SUBROUTINE|FUNCTION))[ \t]+[A-Z].*)$",
|
||||
/* Subroutines and functions */
|
||||
"|([^!'\" \t]+[ \t]+)*(SUBROUTINE|FUNCTION))[ \t]+[A-Z].*)$",
|
||||
/* -- */
|
||||
"[a-zA-Z][a-zA-Z0-9_]*"
|
||||
"|\\.([Ee][Qq]|[Nn][Ee]|[Gg][TtEe]|[Ll][TtEe]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]|[Aa][Nn][Dd]|[Oo][Rr]|[Nn]?[Ee][Qq][Vv]|[Nn][Oo][Tt])\\."
|
||||
|
|
Loading…
Reference in New Issue