all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indent-region: unexpected result (Fortran2003)
@ 2019-11-13 10:04 zimoun
  0 siblings, 0 replies; only message in thread
From: zimoun @ 2019-11-13 10:04 UTC (permalink / raw)
  To: help-gnu-emacs

Dear,

From the standard example [1], the function `f90-indent-subprogram'
(C-M-q) returns this unexpected output:

--8<---------------cut here---------------start------------->8---
Indenting module points...
END function does not match module.
Indenting module points...done
--8<---------------cut here---------------end--------------->8---


My guess is that it comes from the internal parser -- the entry point
is the function `f90-indent-region' -- which does not support the
Fortran 2003 norm; from my understanding.


Moreover, this snippet:

--8<---------------cut here---------------start------------->8---
submodule (singleton) sons
contains

 module procedure print_son
   print *,"son print ",this%child_num,count
 end procedure

 end submodule sons
--8<---------------cut here---------------end--------------->8---

is transformed, when applying C-M-q, into:

--8<---------------cut here---------------start------------->8---
submodule (singleton) sons
contains

  module procedure print_son
  print *,"son_ print ",this%child_num,count
end submodule sons

end submodule sons
--8<---------------cut here---------------end--------------->8---


The block detection is wrong. Is it a "feature" or a real bug?


Thank you in advance for any comments.

All the best,
simon



[1] http://fortranwiki.org/fortran/show/Submodules

--8<---------------cut here---------------start------------->8---
module points
  type :: point
     real :: x, y
  end type point

  interface
     module function point_dist(a, b) result(distance)
       type(point), intent(in) :: a, b
       real :: distance
     end function point_dist
  end interface
end module points

submodule (points) points_a
contains
  module function point_dist(a, b) result(distance)
    type(point), intent(in) :: a, b
    real :: distance
    distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2)
  end function point_dist
end submodule points_a
--8<---------------cut here---------------end--------------->8---



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-13 10:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13 10:04 indent-region: unexpected result (Fortran2003) zimoun

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.