0b...
, the octal notation 0...
, and the
hexadecimal notation 0x...
. Thus, 0b101
expands to 5,
0101
expands to 65, and 0x101
expands to 257.
C
commenting convention. Use /*
... */
or // ...
.
@?
(see AT?), not a C
in
column 1.
// ...
convention for
short comments, you must say @n/
(see -n/) or
@n9[-n/]
as your language command. Otherwise, \FWEB\ will treat
the //
as \FORTRAN'S standard token for concatenation. (You
may always use \/
for concatenation.)
@#if 0...@#endif
(see Preprocessing). Don't put a comment character at the beginning
of each line; that prevents FWEAVE from formatting the code
sensibly and can be annoying to undo. With the preprocessor form, one
can also implement conditional comments by using FWEB preprocessor
macros: e.g., @#if(DEBUG)...@#endif
.
Pre-FWEB codes may have such blocks commented out with a C
in column 1. Those should be converted to the preprocessor
construction. However, if you're in a real hurry, temporarily use the
-nC
option (see -nC) to kill those lines very early in the
processing, before they can give you all kinds of trouble.
//
for short comments is that,
in general, format constructions like format(//)
won't work. (It
will work if one uses -nC
; see -nC.) Alternatively, one
can say format(/ /)
.
C
, c
, *
, or
!
in column 1 are converted into a single comment before
processing by FWEB. Large blocks of such lines (common in
pre-FWEB code) may overflow FWEB's tables. To avoid that,
insert blank lines between some of the comments. Better, however, is to
move most such blocks out of the code part to the TeX part of the
section. It's most readable to have only a few very short comments
interspersed in the code.
To help with conversion of existing codes, the command-line option
-nC
can be used to completely ignore comment lines.
@
commands should, by and large, start in column 1. That's not
necessary for short module names that fit on one line. However, a long
module name that must be broken across lines must begin in column 1, as
in
@n @ @a @<This is a module name broken across lines@>@;
Failure to do this results in a spurious semicolon being inserted in the middle of the name. This happens because the FORTRAN-77 input driver does various low-level manipulations of the source before it presents it to the innards of FWEB; it's not tokenizing the source at that time and doesn't understand all of the FWEB syntax such as module names.
#:0
(see Tokens). Such names should be followed by a colon. Thus,
@n @ @m EXIT #:0 @m ABORT #:0 @a . . ABORT: continue . . EXIT: continue . .
\llap
'd from the body of the
statement. With this convention, long labels can extend too far into
the left margin. Instead, try the command-line option -n:
(see -ncolon), which puts them on a separate line. Alternatively, one
can redefine the macro \Wlbl
, found with some discussion in
fwebmac.sty
.
IOSTAT
.
However, by default the lower-case forms are also recognized. To permit
only upper case, use -k
(see -k). Note that although there
is a command -nk
, it is unfortunately not related to -k
.
^
as an alternative for the exponentiation operator
**
.
++
, --
, +=
, -=
, *=
, and /=
in a way compatible with the usage in C and C++. For example, it
expands x += y
into x = x + (y)
. This feature can be a
great time-saver and also makes the code substantially more legible; it
is strongly recommended. To turn off this feature, use the option
-+
. See -plus.
Notice that in FORTRAN-90 /=
is a token for "not equal,"
so if you want to use that you must use the -+
option. However,
a better solution is to use !=
, FWEB's preferred operator
for "not equal."
.true.
and .false.
will weave as
caligraphic T and F. That appearance be changed by redefining the macros
\WTRUE
and \WFALSE
in fwebmac.sty
or in the limbo
section of your source file.
-#
(see -#) (and then
report the problem.)
|5: continue|
doesn't
format quite properly (the colon disappears); this problem is solved by
putting a semicolon after the continue
. Also, if one is talking
about multiple statements (for example, with a shift into code mode
during TeX documentation), there's no choice but to insert the
semicolon between statements. For example, |a = b; c = d;|
.
!
. But such lines are not recognized on input unless
-n!
is used. See -n!.
(To be completed.)