Changeset View
Changeset View
Standalone View
Standalone View
autotests/input/highlight.f90
1 | ! This file is an example to test the syntax highlighting file F.xml | 1 | ! This file is an example to test the syntax highlighting file fortran-free.xml | ||
---|---|---|---|---|---|
2 | ! (for fortran 90 and F) | 2 | ! (for fortran, free format) | ||
3 | 3 | | |||
4 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
5 | ! THIS IS AN EXAMPLE OF A MODULE ! | 5 | ! THIS IS AN EXAMPLE OF A MODULE ! | ||
6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
7 | module module_example | 7 | module module_example | ||
8 | 8 | | |||
9 | ! use 'implicit none' when you want all variables to be declared | 9 | ! use 'implicit none' when you want all variables to be declared | ||
10 | implicit none | 10 | implicit none | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 59 | ! SOME DECLARATIONS... | |||
72 | character(len=10) :: str_var | 72 | character(len=10) :: str_var | ||
73 | 73 | | |||
74 | ! This is an allocatable array, which can be a target of a pointer | 74 | ! This is an allocatable array, which can be a target of a pointer | ||
75 | type(example_type), private, dimension(:), allocatable, target :: & | 75 | type(example_type), private, dimension(:), allocatable, target :: & | ||
76 | many_examples | 76 | many_examples | ||
77 | 77 | | |||
78 | ! Fortran 90 hasn't got its own preprocessor, it uses the C preprocessor! | 78 | ! Fortran 90 hasn't got its own preprocessor, it uses the C preprocessor! | ||
79 | #ifdef XXX | 79 | #ifdef XXX | ||
80 | c <-- this is a comment in the old fortran 77 style (fixed form) | 80 | | ||
81 | c This is a free form file, so we shouldn't use this kind of comments! | | |||
82 | c But fortran 90 still understands fixed form, when parsing sources with | | |||
83 | c the *.f extension. | | |||
84 | c ! <-- this 'c' shouldn't be highlighted as a comment! | | |||
85 | #endif | 81 | #endif | ||
86 | 82 | | |||
87 | contains | 83 | contains | ||
88 | 84 | | |||
89 | 85 | | |||
90 | ! The sum of two points | 86 | ! The sum of two points | ||
91 | pure function point3d_add(a, b) result(rs) | 87 | pure function point3d_add(a, b) result(rs) | ||
92 | type(point3d) :: rs | 88 | type(point3d) :: rs | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |