Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 147689 - end token for subroutines and programs in Fortran code is not correctly indented (Sun Studio 12)
end token for subroutines and programs in Fortran code is not correctly inden...
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Editor
6.x
Sun All
: P3 (vote)
: 6.x
Assigned To: Alexander Simon
issues@cnd
fortran 61fixes4-fixed release551_fix...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-19 09:28 UTC by Alexander Simon
Modified: 2008-12-09 13:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2008-09-19 09:28:05 UTC
This is from Esc# 1-24701712 on CR# 6749396

In the Sun Studio 12 IDE, when you type in Fortran source code, there seems to be no automatic indenting of the source
code to reflect either subroutine or program structure.

In Sun Studio 12, if I choose

   "File" -> "New..."

and then

   "Choose File Type" -> "Fortran Files" -> "Fortran File (Free Format)"

and then entering the following source code, I get

Note: the vertical bars are there simply to indicate the left edge of the window


   |program test
   |
   |    write (*,*) 'Hello'
   |
   |    contains
   |
   |    subroutine p(c)
   |        integer :: c
   |        c = c+1
   |        end subroutine p
   |
   |        end program test


The above example demonstrates that the "end" token for subroutine and program is not correctly indented.

Note: an "end" token alone is indented to the column 0, and the "end" indentation seems to work for interfaces and functions


The expected result looks as follows. After each carriage return, the newly entered line should be automatically
indented to reflect the subroutine and program block structure.

   |program test
   |
   |    write (*,*) 'Hello'
   |
   |    contains
   |
   |    subroutine p(c)
   |        integer :: c
   |        c = c+1
   |    end subroutine p
   |
   |end program test


Note: the "Source" -> "Reformat Code" function (Ctrl+Shift+F) should do that formatting as well, which is NOT at present
Comment 1 Alexander Simon 2008-09-19 09:38:27 UTC
fixed IZ#147688 & IZ#147689
http://hg.netbeans.org/main/rev/d70f5ec86b7c

unit tests for  IZ#147688 & IZ#147689
http://hg.netbeans.org/main/rev/d013e11f278f
Comment 2 Quality Engineering 2008-09-19 17:31:03 UTC
Integrated into 'main-golden', will be available in build *200809191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d70f5ec86b7c
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed IZ#147688:infinite loop in indent when "c" is first important line token and IZ#147689:no indent for end program and subroutine
Comment 3 Alexander Pepin 2008-09-24 14:21:37 UTC
verified in NB6.5 build 20080924
Comment 4 Karthikeyan Rajeswaran 2008-10-01 02:25:37 UTC
The fix has been ported to release551_fixes branch.

Checking in src/org/netbeans/modules/cnd/editor/fortran/FFormatSupport.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatSupport.java,v  <--  FFormatSupport.java
new revision: 1.1.2.3.6.2; previous revision: 1.1.2.3.6.1
done
Checking in src/org/netbeans/modules/cnd/editor/fortran/FFormatter.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatter.java,v  <--  FFormatter.java
new revision: 1.1.2.3.6.2; previous revision: 1.1.2.3.6.1
done
Checking in src/org/netbeans/modules/cnd/editor/fortran/FSyntax.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FSyntax.java,v  <--  FSyntax.java
new revision: 1.1.2.2.6.1; previous revision: 1.1.2.2
done

The unit tests were not ported to release551_fixes, since the test infrastructure is more basic and different from trunk
for 65.
Comment 5 Karthikeyan Rajeswaran 2008-10-01 18:53:01 UTC
The fix has been ported into the release61_fixes repository.
http://hg.netbeans.org/release61_fixes/rev/0ce771bf3f24
Comment 6 Alexander Pepin 2008-10-08 14:19:08 UTC
verified in patch4
Comment 7 Karthikeyan Rajeswaran 2008-10-08 18:04:27 UTC
The fix for 147688 , 147689, 136699 and 145858 have been backported to release601_fixes branch.

For details, please refer to:
   ------- Additional comments from krajeswaran Wed Oct 8 17:00:03 +0000 2008 -------
in issue 147688
Comment 8 Alexander Pepin 2008-11-11 14:57:52 UTC
verified in 5.5.1 with manually installed nbms from PromoG1Patch4


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo