stadelmanma / tree-sitter-fortran

Fortran grammar for tree-sitter
MIT License
30 stars 15 forks source link

Support procedures in derived types #25

Closed stadelmanma closed 6 years ago

stadelmanma commented 6 years ago

This was a feature I didn't realize existed so I need to support it eventually. I'm not sure if procedures can appear anywhere else but I should try and check. References:

Generic procedure ref inside dervied types:

module m
   type myclass
   contains
      procedure, nopass :: static_method ! static method
      procedure, pass :: instance_method ! instance method
   end type myclass
contains
   subroutine static_method(arg)
      integer :: arg
      ! code to implement method goes here
   end subroutine static_method
   subroutine instance_method(this,arg)
      ! "this" refers to the instance of the class
      class(myclass) :: this
      integer :: arg
      ! code to implement method goes here
   end subroutine instance_method
end module m