NODE(CommonStmt, Block)
NODE(parser, CompilerDirective)
NODE(CompilerDirective, IgnoreTKR)
+ NODE(CompilerDirective, NameValue)
NODE(parser, ComplexLiteralConstant)
NODE(parser, ComplexPart)
NODE(parser, ComponentArraySpec)
TUPLE_CLASS_BOILERPLATE(IgnoreTKR);
std::tuple<std::list<const char *>, Name> t;
};
+ struct NameValue {
+ TUPLE_CLASS_BOILERPLATE(NameValue);
+ std::tuple<Name, std::optional<std::uint64_t>> t;
+ };
CharBlock source;
- std::variant<std::list<IgnoreTKR>, std::list<Name>> u;
+ std::variant<std::list<IgnoreTKR>, std::list<NameValue>> u;
};
// Legacy extensions
defaulted(parenthesized(some("tkr"_ch))), name))};
TYPE_PARSER(
beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr) ||
- construct<CompilerDirective>("DIR$" >> many(name))) /
+ construct<CompilerDirective>("DIR$" >>
+ many(construct<CompilerDirective::NameValue>(
+ name, maybe("=" >> digitString64))))) /
endDirective)
TYPE_PARSER(extension<LanguageFeature::CrayPointer>(construct<BasedPointerStmt>(
Word("!DIR$ IGNORE_TKR"); // emitted even if tkr list is empty
Walk(" ", tkr, ", ");
},
- [&](const std::list<Name> &names) { Walk("!DIR$ ", names, " "); },
+ [&](const std::list<CompilerDirective::NameValue> &names) {
+ Walk("!DIR$ ", names, " ");
+ },
},
x.u);
Put('\n');
}
Walk(std::get<Name>(x.t));
}
+ void Unparse(const CompilerDirective::NameValue &x) {
+ Walk(std::get<Name>(x.t));
+ Walk("=", std::get<std::optional<std::uint64_t>>(x.t));
+ }
// OpenACC Directives & Clauses
void Unparse(const AccAtomicCapture &x) {