@@ -66,16 +66,6 @@ TYPE_PARSER(
66
66
normalProgramUnit) /
67
67
skipStuffBeforeStatement))
68
68
69
- // R504 specification-part ->
70
- // [use-stmt]... [import-stmt]... [implicit-part]
71
- // [declaration-construct]...
72
- TYPE_CONTEXT_PARSER (" specification part" _en_US,
73
- construct<SpecificationPart>(many(openaccDeclarativeConstruct),
74
- many (openmpDeclarativeConstruct), many(indirect(compilerDirective)),
75
- many (statement(indirect(Parser<UseStmt>{}))),
76
- many (unambiguousStatement(indirect(Parser<ImportStmt>{}))),
77
- implicitPart, many(declarationConstruct)))
78
-
79
69
// R507 declaration-construct ->
80
70
// specification-construct | data-stmt | format-stmt |
81
71
// entry-stmt | stmt-function-stmt
@@ -106,18 +96,29 @@ constexpr auto misplacedSpecificationStmt{Parser<UseStmt>{} >>
106
96
fail<DeclarationConstruct>(
107
97
" IMPLICIT statements must follow USE and IMPORT and precede all other declarations" _err_en_US)};
108
98
109
- TYPE_PARSER (recovery(
110
- withMessage (" expected declaration construct" _err_en_US,
111
- CONTEXT_PARSER (" declaration construct" _en_US,
112
- first (construct<DeclarationConstruct>(specificationConstruct),
113
- construct<DeclarationConstruct>(statement(indirect(dataStmt))),
114
- construct<DeclarationConstruct>(
115
- statement (indirect(formatStmt))),
116
- construct<DeclarationConstruct>(statement(indirect(entryStmt))),
117
- construct<DeclarationConstruct>(
118
- statement (indirect(Parser<StmtFunctionStmt>{}))),
119
- misplacedSpecificationStmt))),
120
- construct<DeclarationConstruct>(declErrorRecovery)))
99
+ TYPE_CONTEXT_PARSER (" declaration construct" _en_US,
100
+ first (construct<DeclarationConstruct>(specificationConstruct),
101
+ construct<DeclarationConstruct>(statement(indirect(dataStmt))),
102
+ construct<DeclarationConstruct>(statement(indirect(formatStmt))),
103
+ construct<DeclarationConstruct>(statement(indirect(entryStmt))),
104
+ construct<DeclarationConstruct>(
105
+ statement (indirect(Parser<StmtFunctionStmt>{}))),
106
+ misplacedSpecificationStmt))
107
+
108
+ constexpr auto recoveredDeclarationConstruct{
109
+ recovery (withMessage (" expected declaration construct" _err_en_US,
110
+ declarationConstruct),
111
+ construct<DeclarationConstruct>(declErrorRecovery))};
112
+
113
+ // R504 specification-part ->
114
+ // [use-stmt]... [import-stmt]... [implicit-part]
115
+ // [declaration-construct]...
116
+ TYPE_CONTEXT_PARSER (" specification part" _en_US,
117
+ construct<SpecificationPart>(many(openaccDeclarativeConstruct),
118
+ many(openmpDeclarativeConstruct), many(indirect(compilerDirective)),
119
+ many(statement(indirect(Parser<UseStmt>{}))),
120
+ many(unambiguousStatement(indirect(Parser<ImportStmt>{}))),
121
+ implicitPart, many(recoveredDeclarationConstruct)))
121
122
122
123
// R507 variant of declaration-construct for use in limitedSpecificationPart.
123
124
constexpr auto invalidDeclarationStmt{formatStmt >>
0 commit comments