@@ -153,6 +153,9 @@ static TypeDeclarationStmt makeIterSpecDecl(std::list<ObjectName> &&names) {
153153 makeEntityList(std::move(names)));
154154}
155155
156+ TYPE_PARSER(sourced(construct<OmpDirectiveSpecification>(
157+ OmpDirectiveNameParser{}, maybe(indirect(Parser<OmpClauseList>{})))))
158+
156159// --- Parsers for context traits -------------------------------------
157160
158161static std::string nameToString(Name &&name) { return name.ToString(); }
@@ -496,6 +499,9 @@ TYPE_PARSER(sourced(construct<OmpToClause::Modifier>(
496499 construct<OmpToClause::Modifier>(Parser<OmpMapper>{}) ||
497500 construct<OmpToClause::Modifier>(Parser<OmpIterator>{})))))
498501
502+ TYPE_PARSER(sourced(construct<OmpWhenClause::Modifier>( //
503+ Parser<OmpContextSelector>{})))
504+
499505// --- Parsers for clauses --------------------------------------------
500506
501507/// `MOBClause` is a clause that has a
@@ -693,6 +699,16 @@ TYPE_PARSER(construct<OmpOrderClause>(
693699 maybe(nonemptyList(Parser<OmpOrderClause::Modifier>{}) / ":"),
694700 "CONCURRENT" >> pure(OmpOrderClause::Ordering::Concurrent)))
695701
702+ TYPE_PARSER(construct<OmpMatchClause>(
703+ Parser<traits::OmpContextSelectorSpecification>{}))
704+
705+ TYPE_PARSER(construct<OmpOtherwiseClause>(
706+ maybe(sourced(Parser<OmpDirectiveSpecification>{}))))
707+
708+ TYPE_PARSER(construct<OmpWhenClause>(
709+ maybe(nonemptyList(Parser<OmpWhenClause::Modifier>{}) / ":"),
710+ maybe(sourced(Parser<OmpDirectiveSpecification>{}))))
711+
696712// OMP 5.2 12.6.1 grainsize([ prescriptiveness :] scalar-integer-expression)
697713TYPE_PARSER(construct<OmpGrainsizeClause>(
698714 maybe(nonemptyList(Parser<OmpGrainsizeClause::Modifier>{}) / ":"),
@@ -810,6 +826,8 @@ TYPE_PARSER(
810826 parenthesized(Parser<OmpObjectList>{}))) ||
811827 "MAP" >> construct<OmpClause>(construct<OmpClause::Map>(
812828 parenthesized(Parser<OmpMapClause>{}))) ||
829+ "MATCH" >> construct<OmpClause>(construct<OmpClause::Match>(
830+ parenthesized(Parser<OmpMatchClause>{}))) ||
813831 "MERGEABLE" >> construct<OmpClause>(construct<OmpClause::Mergeable>()) ||
814832 "MESSAGE" >> construct<OmpClause>(construct<OmpClause::Message>(
815833 parenthesized(Parser<OmpMessageClause>{}))) ||
@@ -830,6 +848,8 @@ TYPE_PARSER(
830848 parenthesized(Parser<OmpOrderClause>{}))) ||
831849 "ORDERED" >> construct<OmpClause>(construct<OmpClause::Ordered>(
832850 maybe(parenthesized(scalarIntConstantExpr)))) ||
851+ "OTHERWISE" >> construct<OmpClause>(construct<OmpClause::Otherwise>(
852+ maybe(parenthesized(Parser<OmpOtherwiseClause>{})))) ||
833853 "PARTIAL" >> construct<OmpClause>(construct<OmpClause::Partial>(
834854 maybe(parenthesized(scalarIntConstantExpr)))) ||
835855 "PRIORITY" >> construct<OmpClause>(construct<OmpClause::Priority>(
@@ -885,7 +905,9 @@ TYPE_PARSER(
885905 parenthesized(nonemptyList(name)))) ||
886906 "UNTIED" >> construct<OmpClause>(construct<OmpClause::Untied>()) ||
887907 "UPDATE" >> construct<OmpClause>(construct<OmpClause::Update>(
888- parenthesized(Parser<OmpUpdateClause>{}))))
908+ parenthesized(Parser<OmpUpdateClause>{}))) ||
909+ "WHEN" >> construct<OmpClause>(construct<OmpClause::When>(
910+ parenthesized(Parser<OmpWhenClause>{}))))
889911
890912// [Clause, [Clause], ...]
891913TYPE_PARSER(sourced(construct<OmpClauseList>(
@@ -905,6 +927,9 @@ TYPE_PARSER(sourced(construct<OpenMPUtilityConstruct>(
905927 sourced(construct<OpenMPUtilityConstruct>(
906928 sourced(Parser<OmpNothingDirective>{}))))))
907929
930+ TYPE_PARSER(sourced(construct<OmpMetadirectiveDirective>(
931+ "METADIRECTIVE" >> Parser<OmpClauseList>{})))
932+
908933// Omp directives enclosing do loop
909934TYPE_PARSER(sourced(construct<OmpLoopDirective>(first(
910935 "DISTRIBUTE PARALLEL DO SIMD" >>
@@ -1050,6 +1075,8 @@ TYPE_PARSER(
10501075 construct<OpenMPStandaloneConstruct>(Parser<OpenMPCancelConstruct>{}) ||
10511076 construct<OpenMPStandaloneConstruct>(
10521077 Parser<OpenMPCancellationPointConstruct>{}) ||
1078+ construct<OpenMPStandaloneConstruct>(
1079+ Parser<OmpMetadirectiveDirective>{}) ||
10531080 construct<OpenMPStandaloneConstruct>(Parser<OpenMPDepobjConstruct>{})) /
10541081 endOfLine)
10551082
0 commit comments