Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318385

Summary: Fortran INCLUDE lines handle preceding whitespace inconsistently
Product: [Tools] PTP Reporter: Jeffrey Overbey <com-eclipse-dot-org>
Component: Photran.For Internal UseAssignee: Photran Inbox <photran-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P4 CC: snegara2
Version: 6.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Jeffrey Overbey CLA 2010-06-29 17:22:30 EDT
The whitetext preceding the first token in an INCLUDE file (token.getWhiteBefore()) is used to print the INCLUDE directive, which means that whitetext at the top of the INCLUDE file is lost.  This means that, if all tokens' preprocessor directives are set to null, the resulting text is not what one would expect if Fortran INCLUDE lines were simply replaced with their respective files' contents.

Instead, preprocessor directives should have their own whitetext affixes, and the whitetext preceding the INCLUDE directive should (1) become the preceding whitetext for the directive at (2) be prepended to the preceding whitetext for the first token in the INCLUDE file.

This should guarantee that source reproduction works correctly for refactoring while, at the same time, removing directives produces the correct expansion.