-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang] Handle substring in data statement constant #120130
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -929,8 +929,11 @@ TYPE_PARSER(construct<DataStmtRepeat>(intLiteralConstant) || | |
// components can be ambiguous with a scalar-constant-subobject. | ||
// So we parse literal constants, designator, null-init, and | ||
// structure-constructor, so that semantics can figure things out later | ||
// with the symbol table. | ||
TYPE_PARSER(sourced(first(construct<DataStmtConstant>(literalConstant), | ||
// with the symbol table. A literal constant substring must be attempted | ||
// first to avoid a partial match with a literal constant. | ||
TYPE_PARSER(sourced(first( | ||
construct<DataStmtConstant>(indirect(charLiteralConstantSubstring)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it allows the type |
||
construct<DataStmtConstant>(literalConstant), | ||
construct<DataStmtConstant>(signedRealLiteralConstant), | ||
construct<DataStmtConstant>(signedIntLiteralConstant), | ||
extension<LanguageFeature::SignedComplexLiteral>( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
!RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s | ||
!Regression test for bug #119005 | ||
character*2 :: ary4 | ||
!CHECK: DATA ary4/"cd"/ | ||
data ary4/"abcdef"(3:4)/ | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the comment above (starting on line 921) could be updated to include literal constant substrings?