@@ -150,11 +150,12 @@ TYPE_PARSER(sourced(construct<AccLoopDirective>(
150
150
TYPE_PARSER(construct<AccBeginLoopDirective>(
151
151
sourced (Parser<AccLoopDirective>{}), Parser<AccClauseList>{}))
152
152
153
- TYPE_PARSER(construct<AccEndLoop>(startAccLine >> " END LOOP" _tok))
153
+ TYPE_PARSER(construct<AccEndLoop>(" END LOOP" _tok))
154
154
155
155
TYPE_PARSER(construct<OpenACCLoopConstruct>(
156
156
sourced (Parser<AccBeginLoopDirective>{} / endAccLine),
157
- maybe(Parser<DoConstruct>{}), maybe(Parser<AccEndLoop>{} / endAccLine)))
157
+ maybe(Parser<DoConstruct>{}),
158
+ maybe(startAccLine >> Parser<AccEndLoop>{} / endAccLine)))
158
159
159
160
// 2.15.1 Routine directive
160
161
TYPE_PARSER(sourced(construct<OpenACCRoutineConstruct>(verbatim(" ROUTINE" _tok),
@@ -227,22 +228,25 @@ TYPE_PARSER(construct<OpenACCStandaloneConstruct>(
227
228
TYPE_PARSER(construct<OpenACCStandaloneDeclarativeConstruct>(
228
229
sourced (Parser<AccDeclarativeDirective>{}), Parser<AccClauseList>{}))
229
230
230
- TYPE_PARSER(
231
- startAccLine >> first (sourced(construct<OpenACCDeclarativeConstruct>(
232
- Parser<OpenACCStandaloneDeclarativeConstruct>{})),
233
- sourced(construct<OpenACCDeclarativeConstruct>(
234
- Parser<OpenACCRoutineConstruct>{}))))
231
+ TYPE_PARSER(startAccLine >>
232
+ withMessage (" expected OpenACC directive" _err_en_US,
233
+ first (sourced(construct<OpenACCDeclarativeConstruct>(
234
+ Parser<OpenACCStandaloneDeclarativeConstruct>{})),
235
+ sourced(construct<OpenACCDeclarativeConstruct>(
236
+ Parser<OpenACCRoutineConstruct>{})))))
235
237
236
238
// OpenACC constructs
237
239
TYPE_CONTEXT_PARSER(" OpenACC construct" _en_US,
238
240
startAccLine >>
239
- first (construct<OpenACCConstruct>(Parser<OpenACCBlockConstruct>{}),
240
- construct<OpenACCConstruct>(Parser<OpenACCCombinedConstruct>{}),
241
- construct<OpenACCConstruct>(Parser<OpenACCLoopConstruct>{}),
242
- construct<OpenACCConstruct>(Parser<OpenACCStandaloneConstruct>{}),
243
- construct<OpenACCConstruct>(Parser<OpenACCCacheConstruct>{}),
244
- construct<OpenACCConstruct>(Parser<OpenACCWaitConstruct>{}),
245
- construct<OpenACCConstruct>(Parser<OpenACCAtomicConstruct>{})))
241
+ withMessage (" expected OpenACC directive" _err_en_US,
242
+ first (construct<OpenACCConstruct>(Parser<OpenACCBlockConstruct>{}),
243
+ construct<OpenACCConstruct>(Parser<OpenACCCombinedConstruct>{}),
244
+ construct<OpenACCConstruct>(Parser<OpenACCLoopConstruct>{}),
245
+ construct<OpenACCConstruct>(
246
+ Parser<OpenACCStandaloneConstruct>{}),
247
+ construct<OpenACCConstruct>(Parser<OpenACCCacheConstruct>{}),
248
+ construct<OpenACCConstruct>(Parser<OpenACCWaitConstruct>{}),
249
+ construct<OpenACCConstruct>(Parser<OpenACCAtomicConstruct>{}))))
246
250
247
251
TYPE_PARSER(startAccLine >>
248
252
sourced (construct<AccEndCombinedDirective>(sourced(" END" _tok >>
0 commit comments