"PRINT" >> format, defaulted("," >> nonemptyList(outputItem))))
// R1215 format -> default-char-expr | label | *
-TYPE_PARSER(construct<Format>(defaultCharExpr / !"="_tok) ||
- construct<Format>(label) || construct<Format>(star))
+TYPE_PARSER(construct<Format>(label) ||
+ construct<Format>(defaultCharExpr / !"="_tok) || construct<Format>(star))
// R1216 input-item -> variable | io-implied-do
TYPE_PARSER(construct<InputItem>(variable) ||
void Post(const parser::EndLabel &endLabel) { addLabelReference(endLabel.v); }
void Post(const parser::EorLabel &eorLabel) { addLabelReference(eorLabel.v); }
void Post(const parser::Format &format) {
- // BUG: the label is saved as an IntLiteralConstant rather than a Label
-#if 0
if (const auto *P{std::get_if<parser::Label>(&format.u)}) {
addLabelReferenceFromFormatStmt(*P);
}
-#else
- if (const auto *P{std::get_if<0>(&format.u)}) {
- addLabelReferenceFromFormatStmt(
- parser::Label{std::get<0>(std::get<parser::IntLiteralConstant>(
- std::get<parser::LiteralConstant>((*P->thing).u).u)
- .t)});
- }
-#endif
}
void Post(const parser::CycleStmt &cycleStmt) {
if (cycleStmt.v.has_value()) {