maybe(Parser<StopCode>{}), maybe(", QUIET =" >> scalarLogicalExpr)))
// R1162 stop-code -> scalar-default-char-expr | scalar-int-expr
-TYPE_PARSER(construct<StopCode>(scalarDefaultCharExpr) ||
- construct<StopCode>(scalarIntExpr))
+// The two alternatives for stop-code can't be distinguished at
+// parse time.
+TYPE_PARSER(construct<StopCode>(expr))
// R1164 sync-all-stmt -> SYNC ALL [( [sync-stat-list] )]
TYPE_CONTEXT_PARSER("SYNC ALL statement"_en_US,
};
// R1162 stop-code -> scalar-default-char-expr | scalar-int-expr
-struct StopCode {
- UNION_CLASS_BOILERPLATE(StopCode);
- std::variant<ScalarDefaultCharExpr, ScalarIntExpr> u;
-};
+// We can't distinguish character expressions from integer
+// expressions until semantics, so we just parse an expr and
+// check its type later.
+WRAPPER_CLASS(StopCode, Expr);
// R1160 stop-stmt -> STOP [stop-code] [, QUIET = scalar-logical-expr]
// R1161 error-stop-stmt ->