-
Notifications
You must be signed in to change notification settings - Fork 67
Throw clearer error message when integer dimension indices are present; remove known ddt case sensitivity #662
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2d1761c
fix two bugs
peverwhee f28b5d6
add error handling for integer dimension indices
peverwhee 6e7098d
back out line length fix and address review comments
peverwhee faff223
another stab at fixing line length cusp bug
peverwhee 4f7230d
Add test for writing long strings
17442fe
Merge pull request #17 from gold2718/small-bugfixes
peverwhee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
test/unit_tests/sample_files/fortran_files/long_string_test.F90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| ! | ||
| ! This work (Common Community Physics Package Framework), identified by | ||
| ! NOAA, NCAR, CU/CIRES, is free of known copyright restrictions and is | ||
| ! placed in the public domain. | ||
| ! | ||
| ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| ! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| ! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| ! THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| ! IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| ! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
|
|
||
| !> | ||
| !! @brief Auto-generated Test of long string breaking for FortranWriter | ||
| !! | ||
| ! | ||
| module long_string_test | ||
|
|
||
| foo100 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' | ||
|
|
||
| foo101 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' | ||
|
|
||
| foo102 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901' | ||
|
|
||
| foo103 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012' | ||
|
|
||
| foo104 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123' | ||
|
|
||
| foo105 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234' | ||
|
|
||
| foo106 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345' | ||
|
|
||
| foo107 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456' | ||
|
|
||
| foo108 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567' | ||
|
|
||
| foo109 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678' | ||
|
|
||
| foo110 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' | ||
|
|
||
| foo111 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' | ||
|
|
||
| foo112 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901' | ||
|
|
||
| foo113 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012' | ||
|
|
||
| foo114 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123' | ||
|
|
||
| foo115 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234' | ||
|
|
||
| foo116 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345' | ||
|
|
||
| foo117 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456' | ||
|
|
||
| foo118 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567' | ||
|
|
||
| foo119 = & | ||
| '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678' | ||
|
|
||
| foo120 = & | ||
| '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' | ||
|
|
||
| foo121 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &' | ||
| foo122 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &1' | ||
| foo123 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &12' | ||
| foo124 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &123' | ||
| foo125 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &1234' | ||
| foo126 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &12345' | ||
| foo127 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &123456' | ||
| foo128 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &1234567' | ||
| foo129 = & | ||
| '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890& | ||
| &12345678' | ||
|
|
||
| end module long_string_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this okay? Isn't
1an integer dimension index?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.
a valid question! The problem I ran into is that sometimes the parse checker is called after the "ccpp_constant_one:" is prepended to the integer dimension (which I believe we're allowing) and sometimes it's called before.
So, the metadata could specify
dimensions = (2)and we'd end up calling check_dimensions onccpp_constant_one:2I thought about diving deeper into figuring out what the specifics were of when we're calling what, but decided that
ccpp_constant_one:1is the same as saying1and left it at that.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.
Here is what is confusing: If "integer dimension indices not supported", how is the
1, an integer okay? Also, when did we decide it is okay to use integers for array extents?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.
basically, it's only ok if you do
ccpp_constant_one:1. any other use of integer indices isn't ok. And that's because of my earlier comment - to appease the checker.As for when we started allowing integer sizes, i believe @dustinswales brought that in recently for his work in SCM - #652