Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337039 - syntax error caused by preprocessor macro
Summary: syntax error caused by preprocessor macro
Status: RESOLVED WORKSFORME
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Editor & Outline View (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-12 12:58 EST by Missing name CLA
Modified: 2011-03-17 10:07 EDT (History)
2 users (show)

See Also:


Attachments
Reproducer (136 bytes, application/octet-stream)
2011-02-20 18:02 EST, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2011-02-12 12:58:09 EST
Build Identifier: M20100909-0800

With Photran 6.0.5.201011100956, the __DATE__ macro is not parsed properly. The outline view shows a SyntaxException on the line which follows the macro.

Reproducible: Always

Steps to Reproduce:
1. Create a new Fortran source file, e.g. with extension .f90 so that Photran expects free-form and C preprocessed
2. Add the following lines to the file:
MODULE TEST
CHARACTER(LEN=*),PARAMETER	::	COMPILE_DATE =	__DATE__
LOGICAL	::	INTERACTIVE	=	.FALSE.
END MODULE TEST
3. Check the Outline view - I get this: SyntaxException: Syntax error: Unexpected logical (...)
Comment 1 Missing name CLA 2011-02-20 18:02:47 EST
Created attachment 189388 [details]
Reproducer
Comment 2 Jeffrey Overbey CLA 2011-03-17 09:57:03 EDT
Hi Alexis,

I tried this in Photran 6.0 and 7.0.  I think the problem is that you're using a .f90 extension, which is *unpreprocessed* free form.  If you change the filename extension to .F90 (capital F), it will be treated as C preprocessed free form and will parse correctly.  Alternately, you can change the source form settings in the project properties (right-click the project > Properties > Fortran > Source Form) to associate C preprocessed free form with the .f90 (lowercase f) filename extension.

Hope this helps.

Jeff
Comment 3 Missing name CLA 2011-03-17 10:06:08 EDT
Thanks - I can confirm that 
1. I didn't pay attention to the capitalisation
2. Your fixes work
3. There was never a bug in the first place. Oops - sorry about that.

Thanks a lot!
Comment 4 Jeffrey Overbey CLA 2011-03-17 10:07:58 EDT
Not a problem; glad to help  :-)