@@ -1261,24 +1261,28 @@ TYPE_PARSER(construct<StatOrErrmsg>("STAT =" >> statVariable) ||
12611261// Directives, extensions, and deprecated statements
12621262// !DIR$ IGNORE_TKR [ [(tkrdmac...)] name ]...
12631263// !DIR$ LOOP COUNT (n1[, n2]...)
1264- // !DIR$ name...
1264+ // !DIR$ name[=value] [, name[=value]]...
1265+ // !DIR$ <anything else>
12651266constexpr auto ignore_tkr{
1266- " DIR$ IGNORE_TKR" >> optionalList (construct<CompilerDirective::IgnoreTKR>(
1267- maybe (parenthesized (many (letter))), name))};
1267+ " IGNORE_TKR" >> optionalList (construct<CompilerDirective::IgnoreTKR>(
1268+ maybe (parenthesized (many (letter))), name))};
12681269constexpr auto loopCount{
1269- " DIR$ LOOP COUNT" >> construct<CompilerDirective::LoopCount>(
1270- parenthesized (nonemptyList (digitString64)))};
1271- constexpr auto assumeAligned{" DIR$ ASSUME_ALIGNED" >>
1270+ " LOOP COUNT" >> construct<CompilerDirective::LoopCount>(
1271+ parenthesized (nonemptyList (digitString64)))};
1272+ constexpr auto assumeAligned{" ASSUME_ALIGNED" >>
12721273 optionalList (construct<CompilerDirective::AssumeAligned>(
12731274 indirect (designator), " :" _tok >> digitString64))};
1274- TYPE_PARSER (beginDirective >>
1275- sourced (construct<CompilerDirective>(ignore_tkr) ||
1276- construct<CompilerDirective>(loopCount) ||
1277- construct<CompilerDirective>(assumeAligned) ||
1275+ TYPE_PARSER (beginDirective >> " DIR$ " _tok >>
1276+ sourced ((construct<CompilerDirective>(ignore_tkr) ||
1277+ construct<CompilerDirective>(loopCount) ||
1278+ construct<CompilerDirective>(assumeAligned) ||
1279+ construct<CompilerDirective>(
1280+ many (construct<CompilerDirective::NameValue>(
1281+ name, maybe((" =" _tok || " :" _tok) >> digitString64))))) /
1282+ endOfStmt ||
12781283 construct<CompilerDirective>(
1279- " DIR$" >> many (construct<CompilerDirective::NameValue>(name,
1280- maybe ((" =" _tok || " :" _tok) >> digitString64))))) /
1281- endOfStmt)
1284+ SkipTo<' \n ' >{} >> pure<CompilerDirective::Unrecognized>()) /
1285+ endOfStmt))
12821286
12831287TYPE_PARSER(extension<LanguageFeature::CrayPointer>(
12841288 " nonstandard usage: based POINTER" _port_en_US,
0 commit comments