Handle Fortran's MODULE PROCEDURE construct.

pull/15/head
Jussi Pakkanen 10 years ago
parent a5863477f8
commit f3d0778403
  1. 2
      ninjabackend.py
  2. 4
      test cases/fortran/3 module procedure/meson.build
  3. 15
      test cases/fortran/3 module procedure/prog.f90

@ -991,6 +991,8 @@ class NinjaBackend(backends.Backend):
modmatch = modre.match(line)
if modmatch is not None:
modname = modmatch.group(1)
if modname.lower() == 'procedure': # MODULE PROCEDURE construct
continue
if modname in module_files:
raise InvalidArguments('Namespace collision: module %s defined in two files %s and %s.' %
(modname, module_files[modname], s))

@ -0,0 +1,4 @@
project('use in same file', 'fortran')
e = executable('prog', 'prog.f90')
test('simple', e)

@ -0,0 +1,15 @@
MODULE Circle
REAL, PARAMETER :: Pi = 3.1415927
REAL :: radius
INTERFACE DEFAULT
MODULE PROCEDURE func
END INTERFACE
CONTAINS
FUNCTION func()
func = 0
END FUNCTION
END MODULE Circle
PROGRAM PROG
print *, "Module procedure is working."
END PROGRAM PROG
Loading…
Cancel
Save