Changeset View
Changeset View
Standalone View
Standalone View
autotests/folding/highlight.f.fold
1 | * This file is an example to test the syntax highlighting file fortran-fixed.xml | 1 | * This file is an example to test the syntax highlighting file fortran-fixed.xml | ||
---|---|---|---|---|---|
2 | * (for fortran, fixed format) | 2 | * (for fortran, fixed format) | ||
3 | 3 | | |||
4 | c <-- this is a comment in the old fortran 77 style (fixed form) | 4 | c <-- this is a comment in the old fortran 77 style (fixed form) | ||
5 | c In the free form file, so we shouldn't use this kind of comments! | 5 | c In the free form file, so we shouldn't use this kind of comments! | ||
6 | c But fortran 90 still understands fixed form, when parsing sources with | 6 | c But fortran 90 still understands fixed form, when parsing sources with | ||
7 | c the *.f extension. | 7 | c the *.f extension. | ||
8 | 8 | | |||
9 | * this 'c' shouldn't be highlighted as a comment! | 9 | * this 'c' shouldn't be highlighted as a comment! | ||
10 | c | 10 | c | ||
11 | 11 | | |||
12 | * Prints the values of e ** (j * i * pi / 4) for i = 0, 1, 2, ..., 7 | 12 | * Prints the values of e ** (j * i * pi / 4) for i = 0, 1, 2, ..., 7 | ||
13 | * where j is the imaginary number sqrt(-1) | 13 | * where j is the imaginary number sqrt(-1) | ||
14 | 14 | | |||
15 | <beginfold id='1'>PROGRAM</beginfold id='1'> CMPLXD | 15 | <beginfold id='1'>PROGRAM</beginfold id='1'> CMPLXD | ||
16 | IMPLICIT COMPLEX(X) | 16 | IMPLICIT COMPLEX(X) | ||
17 | PARAMETER (PI = 3.141592653589793, XJ = (0, 1)) | 17 | PARAMETER (PI = 3.141592653589793, XJ = (0, 1)) this text should be highlighted as a comment because it is after the 72th column (ignored by the compiler) | ||
18 | <beginfold id='2'>DO</beginfold id='2'> 1, I = 0, 7 | 18 | <beginfold id='2'>DO</beginfold id='2'> 1, I = 0, 7 | ||
19 | X = EXP(XJ * I * PI / 4) | 19 | X = EXP(XJ * I * PI / 4) | ||
20 | IF (AIMAG(X).LT.0) <beginfold id='2'>THEN</beginfold id='2'> | 20 | IF (AIMAG(X).LT.0) <beginfold id='2'>THEN</beginfold id='2'> | ||
21 | PRINT 2, 'e**(j*', I, '*pi/4) = ', REAL(X), ' - j',-AIMAG(X) | 21 | PRINT 2, 'e**(j*', I, '*pi/4) = ', ! I am an in-line comment | ||
22 | * REAL(X), ' - j',-AIMAG(X) ! the character at the 6th column indicate a continuation line and should be highlighted as a continuation character | ||||
22 | <endfold id='2'></endfold id='2'><beginfold id='2'>ELSE</beginfold id='2'> | 23 | <endfold id='2'></endfold id='2'><beginfold id='2'>ELSE</beginfold id='2'> | ||
23 | PRINT 2, 'e**(j*', I, '*pi/4) = ', REAL(X), ' + j', AIMAG(X) | 24 | PRINT 2, 'e**(j*', I, '*pi/4) = ', | ||
25 | * REAL(X), ' + j', AIMAG(X) | ||||
24 | <endfold id='2'>END IF</endfold id='2'> | 26 | <endfold id='2'>END IF</endfold id='2'> | ||
25 | FORMAT (A, I1, A, F10.7, A, F9.7) | 27 | FORMAT (A, I1, A, F10.7, A, F9.7) | ||
26 | CONTINUE | 28 | CONTINUE | ||
29 | <endfold id='2'>ENDDO</endfold id='2'> | ||||
27 | STOP | 30 | STOP | ||
28 | <endfold id='1'>END</endfold id='1'> | 31 | <endfold id='1'>END</endfold id='1'> |