Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318385 - Fortran INCLUDE lines handle preceding whitespace inconsistently
Summary: Fortran INCLUDE lines handle preceding whitespace inconsistently
Status: NEW
Alias: None
Product: PTP
Classification: Tools
Component: Photran.For Internal Use (show other bugs)
Version: 6.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Photran Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-29 17:22 EDT by Jeffrey Overbey CLA
Modified: 2012-03-14 16:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.