Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing bug on DATA statement #1012

Merged
merged 1 commit into from Feb 21, 2020
Merged

Fix parsing bug on DATA statement #1012

merged 1 commit into from Feb 21, 2020

Conversation

tskeith
Copy link
Collaborator

@tskeith tskeith commented Feb 21, 2020

This DATA statement was getting a parsing error:
data x /a(i)%b/

The parser was expecting the ending '/' where the '%' was. The problem
was parsing a(i) as a structure constructor. Instead, move the
constant subobject case before structure constructor, but match it only
if not followed by '('. That is because in data x /a(1)(2)/, a(1) is
a valid structure constructor.

Also, remove the NamedConstant alternative from DataStmtRepeat. A named
constant is always parsed as a ConstantSubobject so it can never occur.

This DATA statement was getting a parsing error:
`data x /a(i)%b/`

The parser was expecting the ending '/' where the '%' was. The problem
was parsing `a(i)` as a structure constructor. Instead, move the
constant subobject case before structure constructor, but match it only
if not followed by '('. That is because in `data x /a(1)(2)/`, `a(1)` is
a valid structure constructor.

Also, remove the NamedConstant alternative from DataStmtRepeat. A named
constant is always parsed as a ConstantSubobject so it can never occur.
@tskeith tskeith merged commit b9f2617 into master Feb 21, 2020
@tskeith tskeith deleted the tsk-rewrite branch February 21, 2020 23:46
swift-ci pushed a commit to apple/llvm-project that referenced this pull request Apr 9, 2020
This DATA statement was getting a parsing error:
`data x /a(i)%b/`

The parser was expecting the ending '/' where the '%' was. The problem
was parsing `a(i)` as a structure constructor. Instead, move the
constant subobject case before structure constructor, but match it only
if not followed by '('. That is because in `data x /a(1)(2)/`, `a(1)` is
a valid structure constructor.

Also, remove the NamedConstant alternative from DataStmtRepeat. A named
constant is always parsed as a ConstantSubobject so it can never occur.

Original-commit: flang-compiler/f18@04a76b2
Reviewed-on: flang-compiler/f18#1012
swift-ci pushed a commit to apple/llvm-project that referenced this pull request Apr 9, 2020
…r/tsk-rewrite

Fix parsing bug on DATA statement

Original-commit: flang-compiler/f18@b9f2617
Reviewed-on: flang-compiler/f18#1012
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
This DATA statement was getting a parsing error:
`data x /a(i)%b/`

The parser was expecting the ending '/' where the '%' was. The problem
was parsing `a(i)` as a structure constructor. Instead, move the
constant subobject case before structure constructor, but match it only
if not followed by '('. That is because in `data x /a(1)(2)/`, `a(1)` is
a valid structure constructor.

Also, remove the NamedConstant alternative from DataStmtRepeat. A named
constant is always parsed as a ConstantSubobject so it can never occur.

Original-commit: flang-compiler/f18@04a76b2
Reviewed-on: flang-compiler/f18#1012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants