@@ -23,6 +23,22 @@ namespace Fortran::parser {
2323constexpr auto startOmpLine = skipStuffBeforeStatement >> " !$OMP " _sptok;
2424constexpr auto endOmpLine = space >> endOfLine;
2525
26+ // Map modifiers come from two categories: map-type-modifier and map-type.
27+ // There can be zero or more map-type-modifiers, and zero or one map-type.
28+ // Syntax-wise they look like a single list, where the last element could
29+ // be a map-type, and all elements in that list are comma-separated[1].
30+ // Only if there was at least one modifier (of any kind) specified, the
31+ // list must end with ":".
32+ // [1] Any of the commas are optional, but that syntax has been deprecated,
33+ // and the parsing code is intended to identify that. There are complications
34+ // coming from the fact that the comma separating the two kinds of modifiers
35+ // is only allowed if there is at least one modifier of each kind.
36+ // The MapModifiers parser parses the modifier list as a whole, and returns
37+ // a tuple with the (optional) map-type-modifier list, and the (optional)
38+ // type modifier as its members.
39+ // The list is then parsed, first with a mandatory separator, and if that
40+ // fails, with an optional one. If the latter succeeds, a deprecation
41+ // message is printed.
2642template <typename Separator> struct MapModifiers {
2743 constexpr MapModifiers (
2844 Separator sep, std::optional<MessageFixedText> msg = std::nullopt )
0 commit comments