Re: utility to replace "end" with "end subroutine foo"
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Sat, 28 Apr 2007 03:10:29 -0800
gsal wrote:
O.k. maybe is not the easiest thing in fortran, it gets a little
easier in C and of course it does not get any easier when using one of
those scripting languages like tcl, perl, python...
If you simplify the problem somewhat, good enough for the programs
it is likely to be used for, it isn't bad. No continuation between
the beginning of the subroutine statement and the end of the
name, no continued END statements.
I offer this in awk, which didn't take long at all.
/^ *subroutine / {
x=$2
sub("\\(.*$","",x)
}
/^ *function / {
x=$2
sub("\\(.*$","",x)
}
/^ *end *$/ {
sub(" *$","")
print $0, x
}
-- glen
.
- Follow-Ups:
- References:
- utility to replace "end" with "end subroutine foo"
- From: Beliavsky
- Re: utility to replace "end" with "end subroutine foo"
- From: gsal
- utility to replace "end" with "end subroutine foo"
- Prev by Date: Re: add a0 format to language to print trimmed character variables
- Next by Date: Re: add a0 format to language to print trimmed character variables
- Previous by thread: Re: utility to replace "end" with "end subroutine foo"
- Next by thread: Re: utility to replace "end" with "end subroutine foo"
- Index(es):
Relevant Pages
|
|