Skip to content

Commit 3d88aad

Browse files
authored
Merge branch 'users/kparzysz/spr/m02-context-parse' into users/kparzysz/spr/m03-meta-simple
2 parents 909b251 + 13740f9 commit 3d88aad

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,15 @@ static constexpr auto propertyListParser(PropParser... pp) {
213213
// the entire list in each of the alternative property parsers. Otherwise,
214214
// the name parser could stop after "foo" in "(foo, bar(1))", without
215215
// allowing the next parser to give the list a try.
216+
auto listOf{[](auto parser) { //
217+
return nonemptySeparated(parser, ","_tok);
218+
}};
216219

217220
using P = OmpTraitProperty;
218-
return maybe("(" >>
221+
return maybe("(" >> //
219222
construct<OmpTraitSelector::Properties>(
220223
maybe(Parser<OmpTraitScore>{} / ":"_tok),
221-
(attempt(nonemptySeparated(construct<P>(pp), ","_tok) / ")"_tok) ||
222-
...)));
224+
(attempt(listOf(sourced(construct<P>(pp))) / ")"_tok) || ...)));
223225
}
224226

225227
// Parser for OmpTraitSelector
@@ -286,8 +288,8 @@ struct TraitSelectorParser {
286288
const Parser<OmpTraitSelectorName> np;
287289
};
288290

289-
TYPE_PARSER(construct<OmpTraitSelector>(
290-
TraitSelectorParser(Parser<OmpTraitSelectorName>{})))
291+
TYPE_PARSER(sourced(construct<OmpTraitSelector>(
292+
sourced(TraitSelectorParser(Parser<OmpTraitSelectorName>{})))))
291293

292294
TYPE_PARSER(construct<OmpTraitSetSelectorName::Value>(
293295
"CONSTRUCT" >> pure(OmpTraitSetSelectorName::Value::Construct) ||

0 commit comments

Comments
 (0)