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

Bug 337039

Summary: syntax error caused by preprocessor macro
Product: [Tools] PTP Reporter: Missing name <rohou>
Component: Photran.Editor & Outline ViewAssignee: Jeffrey Overbey <com-eclipse-dot-org>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: com-eclipse-dot-org, rohou
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Reproducer none

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  :-)