Original-commit: flang-compiler/f18@d12d1129b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/775
This commit is contained in:
peter klausler 2019-10-02 15:42:07 -07:00
parent 019627ebd7
commit 78d33b600e
2 changed files with 9 additions and 5 deletions

View File

@ -751,6 +751,7 @@ TYPE_PARSER(recovery(
// R737 data-component-def-stmt ->
// declaration-type-spec [[, component-attr-spec-list] ::]
// component-decl-list
// N.B. The standard requires double colons if there's an initializer.
TYPE_PARSER(construct<DataComponentDefStmt>(declarationTypeSpec,
optionalListBeforeColons(Parser<ComponentAttrSpec>{}),
nonemptyList(
@ -999,11 +1000,14 @@ TYPE_PARSER(construct<AcImpliedDoControl>(
// declaration-type-spec [[, attr-spec]... ::] entity-decl-list
TYPE_PARSER(
construct<TypeDeclarationStmt>(declarationTypeSpec,
optionalListBeforeColons(Parser<AttrSpec>{}),
defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::",
nonemptyList("expected entity declarations"_err_en_US, entityDecl)) ||
// PGI-only extension: don't require the colons
// N.B.: The standard requires the colons if the entity
// declarations contain initializers.
// C806: no initializers allowed without colons ("REALA=1" is ambiguous)
construct<TypeDeclarationStmt>(declarationTypeSpec,
construct<std::list<AttrSpec>>(),
nonemptyList(
"expected entity declarations"_err_en_US, entityDeclWithoutInit)) ||
// PGI-only extension: comma in place of doubled colons
extension<LanguageFeature::MissingColons>(construct<TypeDeclarationStmt>(
declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})),
withMessage("expected entity declarations"_err_en_US,

View File

@ -87,7 +87,7 @@ constexpr Parser<TypeDeclarationStmt> typeDeclarationStmt; // R801
constexpr Parser<NullInit> nullInit; // R806
constexpr Parser<AccessSpec> accessSpec; // R807
constexpr Parser<LanguageBindingSpec> languageBindingSpec; // R808, R1528
constexpr Parser<EntityDecl> entityDecl; // R803
constexpr Parser<EntityDecl> entityDecl, entityDeclWithoutInit; // R803
constexpr Parser<CoarraySpec> coarraySpec; // R809
constexpr Parser<ArraySpec> arraySpec; // R815
constexpr Parser<ExplicitShapeSpec> explicitShapeSpec; // R816