From: zimoun <zimon.toutoune@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: indent-region: unexpected result (Fortran2003)
Date: Wed, 13 Nov 2019 11:04:19 +0100 [thread overview]
Message-ID: <CAJ3okZ2mD2WLZDcTqz=8=q29Gh-QPD0mnjsMsuPD+P90_t3ZjA@mail.gmail.com> (raw)
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---
reply other threads:[~2019-11-13 10:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ3okZ2mD2WLZDcTqz=8=q29Gh-QPD0mnjsMsuPD+P90_t3ZjA@mail.gmail.com' \
--to=zimon.toutoune@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.