forked from OSchip/llvm-project
[flang] Change parsing of ambiguous array-spec
An array-spec like `(:,:)` (with one or more colons) is either a deferred-shape-spec-list or an assumed-shape-spec-list and they can only be distinguished by context that the parser doesn't have. We were parsing these as assumed-shape-spec-list but they are easier to deal with if we parse them as deferred-shape-spec-list because anything that is the latter is also one of the former. Original-commit: flang-compiler/f18@78c3f3b96f Reviewed-on: https://github.com/flang-compiler/f18/pull/630 Tree-same-pre-rewrite: false
This commit is contained in:
parent
80678685a3
commit
73738d8bba
|
@ -1088,9 +1088,9 @@ TYPE_PARSER(construct<ExplicitCoshapeSpec>(
|
||||||
// a need for forced look-ahead.
|
// a need for forced look-ahead.
|
||||||
TYPE_PARSER(
|
TYPE_PARSER(
|
||||||
construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec))) ||
|
construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec))) ||
|
||||||
|
construct<ArraySpec>(parenthesized(deferredShapeSpecList)) ||
|
||||||
construct<ArraySpec>(
|
construct<ArraySpec>(
|
||||||
parenthesized(nonemptyList(Parser<AssumedShapeSpec>{}))) ||
|
parenthesized(nonemptyList(Parser<AssumedShapeSpec>{}))) ||
|
||||||
construct<ArraySpec>(parenthesized(deferredShapeSpecList)) ||
|
|
||||||
construct<ArraySpec>(parenthesized(Parser<AssumedSizeSpec>{})) ||
|
construct<ArraySpec>(parenthesized(Parser<AssumedSizeSpec>{})) ||
|
||||||
construct<ArraySpec>(parenthesized(Parser<ImpliedShapeSpec>{})) ||
|
construct<ArraySpec>(parenthesized(Parser<ImpliedShapeSpec>{})) ||
|
||||||
construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec>{})))
|
construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec>{})))
|
||||||
|
|
Loading…
Reference in New Issue