[J3] Are the parentheses really necessary for an unlimited format item?

Van Snyder van.snyder at sbcglobal.net
Sat Aug 21 02:05:32 UTC 2021


It seems that the parentheses aren't really necessary for an unlimited
format item, so long as <format-items> consists of one data edit
descriptor. For example, *f7.3 or *g15.7 would not be ambiguous.

R1305 could be

R1305 unlimited-format-item is * ( format-items )
                            or * data-edit-desc

13.4p8 in 21-007 would need adjustment. Replace "rightmost parenthesis"
with "end" and "leftmost parenthesis" with "beginning". This also
eliminates the question whether, after reversion, the format item is
still unlimited. Append "The file is not positioned in a manner
identical with the way it is positioned when a slash edit descriptor is
processed (13.8.2)." 

C1303 could be eliminated if R1305 were

R1305 unlimited-format-item is * ( [ format-items, ] data-edit-desc [, format-items ] )
                            or * data-edit-desc

Given 13.4p8 it isn't really necessary for the syntax to require an
unlimited format item to be the last thing. Having something after it
is no different from having junk after the final right parenthesis in a
format specification given by a character data object. Folding
unlimited-format-item into format-items would allow nonsense like
nested or repeated unlimited format items, but the specification in
13.4p8 would have exactly the same result as if unlimited-format-
item were required to be the last thing. A kindly processor might issue
a "Questionable: format items that appear after an unlimited format
item are not processed" message.

Eliminate "or ( [ format-items, ] unlimited-format-item )" from R1301.

Eliminate R1303.

Replace R1306:

R1306 r is int-literal-constant
        or *

Eliminate C1304 because int-literal-constant doesn't include a sign, so
r must necessarily be positive.

Eliminate C1303.

Replace 13.4p8:

   "When format control encounters the end of a format item in which the
   repeat specification r is an asterisk, control reverts to the beginning
   of that format item. This reversion of format control has no effect on
   the changeable modes (12.5.2)."

This change would not affect the semantics of a program that conforms
to a8-007r1.

Maybe the simplification of syntax and constraints isn't enough to
justify the change.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210820/dc585a47/attachment.htm>


More information about the J3 mailing list