Info Node: (g77-300.info)Statements Comments Lines
(g77-300.info)Statements Comments Lines
Statements, Comments, and Lines
-------------------------------
(Corresponds to Section 2.3 of ANSI X3.9-1978 FORTRAN 77.)
Use of an exclamation point (`!') to begin a trailing comment (a
comment that extends to the end of the same source line) is permitted
under the following conditions:
* The exclamation point does not appear in column 6. Otherwise, it
is treated as an indicator of a continuation line.
* The exclamation point appears outside a character or Hollerith
constant. Otherwise, the exclamation point is considered part of
the constant.
* The exclamation point appears to the left of any other possible
trailing comment. That is, a trailing comment may contain
exclamation points in their commentary text.
Use of a semicolon (`;') as a statement separator is permitted under
the following conditions:
* The semicolon appears outside a character or Hollerith constant.
Otherwise, the semicolon is considered part of the constant.
* The semicolon appears to the left of a trailing comment.
Otherwise, the semicolon is considered part of that comment.
* Neither a logical `IF' statement nor a non-construct `WHERE'
statement (a Fortran 90 feature) may be followed (in the same,
possibly continued, line) by a semicolon used as a statement
separator.
This restriction avoids the confusion that can result when reading
a line such as:
IF (VALIDP) CALL FOO; CALL BAR
Some readers might think the `CALL BAR' is executed only if
`VALIDP' is `.TRUE.', while others might assume its execution is
unconditional.
(At present, `g77' does not diagnose code that violates this
restriction.)