Node:-n\, Next:-n&, Previous:-np, Up:Options
-n\
: Free-form syntax continued by backslashIn FORTRAN-90, this turns on free-form syntax and sets the continuation character to be the backslash (as it would be in C). For example,
-n9[-n\] @ @a program main x = \ y end
In the tangled output the backslash is converted into FORTRAN-90's standard continuation character, the ampersand.
See also -n&.
Node:-n&, Next:-n/, Previous:-n\, Up:Options
-n&
: Free-form syntax continued by ampersandIn FORTRAN-90, this turns on free-form syntax and sets the continuation character to be the ampersand. For example,
-n9[-n&] @ @a program main x = & y end
For FORTRAN-90, free-form syntax continued by the ampersand is
FWEB's default, so one probably will not need to use -n&
explicitly.
See also -n\.
Node:-n/, Next:-n!, Previous:-n&, Up:Options
-n/
: Recognize short comments [FORTRAN]The standard FWEB notation for a short comment (one terminated by
the next newline) is // ...
. However, in FORTRAN the
//
denotes concatenation by default. To make it denote a short
comment, use the -n/
option. One can do this in the .fweb
file (see Customization) or with the language-setting command in
limbo, as in @n/
.
In FWEB, one may always use \/
for concatenation, so there's
no penalty for using -n/
.
Node:-n!, Next:-n), Previous:-n/, Up:Options
-n!
: Make !
denote short comment [FORTRAN]In FORTRAN-90, !
starts a short comment. However,
by default FWEB usurps !
for the logical not, as in
if(x != y)
. To force it to recognize !
as a comment, use
-n!
. However, the recommended style is to use FWEB's
standard convention that //
denotes the start of a short
comment (see -n/). See also -! and -r!.
In FORTRAN-77, to include the exclamation point inside a string, escape it with a backslash, as in
s = "A \! inside a string"
This possibly annoying restriction arises because the unduly complicated FORTRAN input driver does some preprocessing of the FORTRAN source before it feeds it to the cores of the processors.
Node:-n), Next:-o, Previous:-n!, Up:Options
-n)
: Reverse array indices [FORTRAN] (FTANGLE)This somewhat experimental flag permits FORTRAN programmers to use C-style array indices. Conversions such as the following are made (during the output phase of FTANGLE):
a(k)(i) => a(i,k) a(k)(i,j) => a(i,j,k) a(k)(j)(i) => a(i,j,k)
[No spaces may intervene between )
and (
; effectively,
)(
is treated as one token for the purposes of -n)
.]
This feature permits convenient definitions of macros that deal with
multi-dimensional vectors.
Unfortunately, FTANGLE doesn't fully understand the syntax of the source code--and never will, unless it is fully integrated with a compiler. It will therefore be confused by situations like the following FORTRAN example:
dimension x(0:4)(1:2) // OK character*90 ch(4) // OK write(6,*) ((x(i)(j),i=1,2), j=3,4) // Will reverse incorrectly. c = ch(4)(3:4) // Shouldn't reverse, but will.
One solution, due to Charles Karney, is to insert a space to prevent
)(
from being recognized as a single token. However,
since ordinary white space is eaten on input, one must resort to
something like the following ($UNQUOTE
is a built-in FWEB
function; see $UNQUOTE):
@m SP $UNQUOTE(' ') @a dimension x(0:4)(1:2) character*90 ch(4) write(6,*) SP ((x(i)(j),i=1,2), j=3,4) c = ch(4)SP(3:4)
This option is controlled by the three style-file parameters
paren.len
, paren.num
, and paren.nest
. (See Style.)
paren.len
is the default number of bytes to be allocated for each
index; if an index is longer than this number, the current length is
increased by this number and storage is automatically reallocated.
paren.num
is the maximum number of allowed indices; for example,
when processing a(i)(j)(k)
, paren.num
is 3.
paren.nest
is the maximum parenthesis nesting level. In the
example x(a(i)(j)(k))
, paren.nest
is 2. If either of the
last two parameters is exceeded, a message will be issued asking you to
increase the appropriate value.