// nextCh is a parser that succeeds if the parsing state is not
// at the end of its input, returning the next character location and
// advancing the parse when it does so.
-constexpr struct NextCh {
+struct NextCh {
using resultType = const char *;
constexpr NextCh() {}
std::optional<const char *> Parse(ParseState &state) const {
state.Say("end of file"_err_en_US);
return std::nullopt;
}
-} nextCh;
+};
+
+constexpr NextCh nextCh;
// If a is a parser for some nonstandard language feature LF, extension<LF>(a)
// is a parser that optionally enabled, sets a strict conformance violation
using Ty = std::decay_t<decltype(x)>;
if constexpr (common::HasMember<Ty, decltype(DataRef::u)>) {
return {DataRef{std::move(x)}};
- } else {
- return std::nullopt;
}
+ return std::nullopt;
},
std::move(designator->u));
} else {
if (sym == nullptr) {
context.messages.Say(sc.component.source,
"component name was not resolved to a symbol"_err_en_US);
- } else if (const auto *tpDetails{
- sym->detailsIf<semantics::TypeParamDetails>()}) {
+ } else if (sym->detailsIf<semantics::TypeParamDetails>()) {
context.messages.Say(sc.component.source,
"TODO: type parameter inquiry unimplemented"_err_en_US);
} else if (&sym->owner() != dtExpr->result.spec().scope()) {