maybeReversionPoint);
return 0;
}
+ if (height_ != 1) {
+ ReportBadFormat(context,
+ "Invalid FORMAT: '*' must be nested in exactly one set of "
+ "parentheses",
+ maybeReversionPoint);
+ return 0;
+ }
}
ch = Capitalize(ch);
if (ch == '(') {
++restart;
}
if (stack_[height_ - 1].remaining == Iteration::unlimited) {
- offset_ = restart;
+ if (height_ > 1 && GetNextChar(context) != ')') {
+ ReportBadFormat(context,
+ "Unlimited repetition in FORMAT may not be followed by more "
+ "items",
+ restart);
+ return 0;
+ }
if (offset_ == unlimitedLoopCheck) {
ReportBadFormat(context,
"Unlimited repetition in FORMAT lacks data edit descriptors",
restart);
+ return 0;
}
+ offset_ = restart;
} else if (stack_[height_ - 1].remaining-- > 0) {
offset_ = restart;
} else {
ResultsTy{"'PI='", "F9.7", "'PI='", "F9.7", "'done'"}, 1},
{2, "(3('PI=',F9.7,:),'tooFar')",
ResultsTy{"'PI='", "F9.7", "'PI='", "F9.7"}, 1},
- {2, "(*('PI=',F9.7,:),'tooFar')",
- ResultsTy{"'PI='", "F9.7", "'PI='", "F9.7"}, 1},
+ {2, "(*('PI=',F9.7,:))", ResultsTy{"'PI='", "F9.7", "'PI='", "F9.7"}, 1},
{1, "(3F9.7)", ResultsTy{"2*F9.7"}, 2},
};