From: Angelo Graziosi <angelo.graziosi@alice.it>
To: Glenn Morris <rgm@gnu.org>
Cc: 20969@debbugs.gnu.org
Subject: bug#20969: f90-indent-subprogram indents incorrectly when the buffer includes type, extend(...)
Date: Sat, 04 Jul 2015 10:26:37 +0200 [thread overview]
Message-ID: <559798BD.6090709@alice.it> (raw)
In-Reply-To: <s0lhewrd8t.fsf@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
Il 04/07/2015 02:13, Glenn Morris ha scritto:
>
> Works for me.
>
Hmm... indeed the Zach example works.. but try with the attached test
case.. It comes with the right formatting.. Select, now, from 'module'
to 'end module', then press TAB.. The formatting becomes totally broken.
Now, remove, from the original foo.f90, the text ', extends(Shape),'
(after "type" keyword), and repeat (select from 'module' to 'end
module', then press TAB..). The formatting is not changed! it remans
unbroken..
So, the 'extends' keyword, in some manner, breaks the formatting.
Angelo
[-- Attachment #2: foo.f90 --]
[-- Type: text/plain, Size: 1233 bytes --]
module Rectangle_mod
use kinds_mod, only : DP
use Shape_mod, only : Shape
implicit none
private
type, extends(Shape), public :: Rectangle
private
real(DP) :: length
real(DP) :: width
contains
private
procedure, pass(this) :: ConstructRectangle
procedure, pass(this), public :: getArea
generic, public :: Construct => ConstructRectangle
end type Rectangle
contains
subroutine ConstructRectangle(this, length, width, xCenter, yCenter)
class(Rectangle), intent(inout) :: this
real(DP), intent(in) :: length
real(DP), intent(in) :: width
real(DP), intent(in) :: xCenter
real(DP), intent(in) :: yCenter
!.. Create the base class
call this%Construct(xCenter=xCenter, yCenter=yCenter)
print *, "Constructing rectangle"
this%length = length
this%width = width
!How to invoke the base class constructor here?
!The line below works for non-abstract base classes where the
!constructor result can be type(Shape)
end subroutine ConstructRectangle
function getArea(this) result(area)
class(Rectangle), intent(in) :: this
real(DP) :: area
area = this%length * this%width
end function getArea
end module Rectangle_mod
next prev parent reply other threads:[~2015-07-04 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 22:36 bug#20969: f90-indent-subprogram indents incorrectly when the buffer includes type, extend(...) Zach Jibben
2015-07-02 22:56 ` Glenn Morris
2015-07-03 22:25 ` Angelo Graziosi
2015-07-04 0:13 ` Glenn Morris
2015-07-04 8:26 ` Angelo Graziosi [this message]
2015-07-06 2:26 ` Glenn Morris
2015-07-06 10:06 ` Angelo Graziosi
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=559798BD.6090709@alice.it \
--to=angelo.graziosi@alice.it \
--cc=20969@debbugs.gnu.org \
--cc=rgm@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.