Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Outline does not work when #endif is used in the code

Hi Guys,

thanks for your efford. I'm obliged for your help!
Here is an example file that causes this kind of problem.

Am Wednesday 23 November 2005 21:27 schrieb Spiros Xanthos:
> > '#ifdef', '#else' and '#define' do not cause problems, only  '#endif' 
> > is the
> > problem.
> >
> > Any clou what to do? 
> 
> 
> Currently, out Lexer handles preprocessor directives by just ignoring 
> them. So, this looks like a "Lexer bug". Daniel, can you send the file 
> that is causing the problem?
> 
> --Spiros
> 
> Craig Rasmussen wrote:
> 
> >
> > On Nov 23, 2005, at 8:34 AM, Daniel Schmode wrote:
> >
> >> Hi guys,
> >>
> >> I am a newbie in this list and I posted the topic already to
> >> 'photran@xxxxxxxxxxx'  so if this is an old matter or you already  
> >> receaved is
> >> from the old list I am appologuising for posting.
> >>
> >
> > No problem, this is an excellent question.
> >
> >> Photran seems to work quite well and I like it, but when I am  
> >> editing .f90
> >> files with CPP stuff like '#endif' the syntax highlighting is
> >> not working anymore and I get an:
> >>  'Lexer error (foo.f90) unexpected character #'
> >>
> >> '#ifdef', '#else' and '#define' do not cause problems, only  '#endif' 
> >> is the
> >> problem.
> >>
> >> Any clou what to do?
> >>
> >
> > I currently setting up accounts on our big machines at Los Alamos to  
> > begin
> > working with our code teams.  As our codes often use cpp, this is a
> > problem that needs to be solved.  I've looked briefly at the CDT classes
> > for handling preprocessing, but not enough to know if they can
> > be used directly in Photran.
> >
> > Have you thought about this Jeff?
> >
> > Cheers,
> > Craig
> >
> > _______________________________________________
> > photran mailing list
> > photran@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/photran
> >
> 
> 

-- 
--------------------------------------- 
Dipl-Ing. Daniel Schmode                
Hamburg University of Technology        
AB 3-13, Fluid Dynamics and Ship Theory 
D-21071 Hamburg                         
Tel. +49 40 42878 6044   Fax. 6048      
!----------------------------------------------------------------------
!
! photran bug report test file
! in my photran there is no outline and the syntaxhighligting stops
! working after the first #endif and the outline is not working.
! When I put an ! befote this syntaxhighlighting is working well again
! After saving the file the outline appers correct.
!
!
!----------------------------------------------------------------------

MODULE foo

!----------------------------------------------------------------------
! used modules
!----------------------------------------------------------------------

USE logging

IMPLICIT NONE
PRIVATE

!----------------------------------------------------------------------
! public variables
!----------------------------------------------------------------------


!----------------------------------------------------------------------
! private variables
!----------------------------------------------------------------------

LOGICAL, PRIVATE :: foo_initialized

!----------------------------------------------------------------------
! interface definitions
!----------------------------------------------------------------------

!-----------------------------------------------------------------------------
! public procedures
!-----------------------------------------------------------------------------

PUBLIC

CONTAINS


!=====================================================================
SUBROUTINE foo_init  
!=====================================================================
!
! foo_init: subroutine to initialize the module
!
!----------------------------------------------------------------------
CALL logging_trace('foo_init')

foo_initialized = .TRUE.

CALL logging_trace('foo_init',.TRUE.)
END SUBROUTINE foo_init

#ifdef photran_test
!dummmmmy
#else
!duuuumy
#endif

!=====================================================================
SUBROUTINE foo_exit
!=====================================================================
!
! foo_exit: subroutine to finish the module
!           and cleanup
!----------------------------------------------------------------------

CALL logging_trace('foo_exit')
foo_initialized = .FALSE.
CALL logging_trace('foo_exit',.TRUE.)
END SUBROUTINE foo_exit

!=====================================================================
LOGICAL FUNCTION foo_isinitialized()
!=====================================================================
!
! check if module foo is properly initialized
!
!--------------------------------------------------------------------
foo_isinitialized=foo_initialized
END FUNCTION foo_isinitialized

!=====================================================================
SUBROUTINE foo_info()
!=====================================================================
!
! writes information ...
!
!--------------------------------------------------------------------

CALL logging_trace('foo_info')
CALL logging_start_tag(report,'foo_info')

CALL logging_end_tag(report,'foo_info')
CALL logging_trace('foo_info',.TRUE.)
END SUBROUTINE foo_info
END MODULE foo

!----------------------------------------------------------------------
! test program
!----------------------------------------------------------------------
!#ifdef test_module_foo
!   PROGRAM test_foo
!USE foo
!     WRITE(*,*) 'testing module foo ...'
!     CALL  foo_init()
!     CALL  foo_info()
!     CALL  foo_exit()
!   END PROGRAM test_foo
!#endif

Back to the top