-
Notifications
You must be signed in to change notification settings - Fork 27
WI #2850 Check wrong values on an OCCURS clause #2854
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
Finou1404
merged 2 commits into
develop
from
2850-missing-check-on-min-and-max-occurrence
May 29, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
41 changes: 41 additions & 0 deletions
41
TypeCobol.Test/Parser/Programs/Cobol85/OccursWrongValues.CodeElements.txt
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,41 @@ | ||
| --- Diagnostics --- | ||
| Line 10[25,30] <27, Error, Syntax> - Syntax error : The max value ('0') is not valid in an OCCURS. RuleStack=codeElement>dataDescriptionEntry>occursClause, OffendingSymbol=[25,30:OCCURS]<OCCURS> | ||
| Line 11[25,30] <27, Error, Syntax> - Syntax error : The max value ('-2') is not valid in an OCCURS. RuleStack=codeElement>dataDescriptionEntry>occursClause, OffendingSymbol=[25,30:OCCURS]<OCCURS> | ||
| Line 15[22,27] <27, Error, Syntax> - Syntax error : The min value ('-2') is not valid in an OCCURS. RuleStack=codeElement>dataDescriptionEntry>occursClause, OffendingSymbol=[22,27:OCCURS]<OCCURS> | ||
| Line 17[29,34] <27, Error, Syntax> - Syntax error : The min value ('2') must not exceed the max value ('1') in an OCCURS. RuleStack=codeElement>dataDescriptionEntry>occursClause, OffendingSymbol=[29,34:OCCURS]<OCCURS> | ||
| --- Code Elements --- | ||
| [[ProgramIdentification]] [8,21:IDENTIFICATION]<IDENTIFICATION> --> [28,28+:.]<PeriodSeparator> | ||
| - ProgramName = TCOCCLVL | ||
| - IsInitial = False | ||
| - IsRecursive = False | ||
| - IsCommon = False | ||
|
|
||
| [[DataDivisionHeader]] [8,11:DATA]<DATA> --> [21,21+:.]<PeriodSeparator> | ||
|
|
||
| [[WorkingStorageSectionHeader]] [8,22:WORKING-STORAGE]<WORKING_STORAGE> --> [31,31+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [8,9:01]<LevelNumber>{1} --> [19,19+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [34,34+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [8,9:05]<LevelNumber>{5} --> [32,33:. ]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [44,44+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [44,44+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [59,59+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [59,59+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [11,12:05]<LevelNumber>{5} --> [65,65+:.]<PeriodSeparator> | ||
|
|
||
| [[ProcedureDivisionHeader]] [8,16:PROCEDURE]<PROCEDURE> --> [26,26+:.]<PeriodSeparator> | ||
|
|
||
| [[GobackStatement]] [12,17:GOBACK]<GOBACK> --> [12,17:GOBACK]<GOBACK> | ||
|
|
||
| [[SentenceEnd]] [12,12+:.]<PeriodSeparator> --> [12,12+:.]<PeriodSeparator> | ||
|
|
||
| [[ProgramEnd]] [8,10:END]<END> --> [28,28+:.]<PeriodSeparator> | ||
| - ProgramName = TCOCCLVL | ||
|
|
22 changes: 22 additions & 0 deletions
22
TypeCobol.Test/Parser/Programs/Cobol85/OccursWrongValues.rdz.cbl
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,22 @@ | ||
| IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. TCOCCLVL. | ||
| DATA DIVISION. | ||
| WORKING-STORAGE SECTION. | ||
| 01 ROOT-GRP. | ||
| 05 CNT PIC S9(2) BINARY. | ||
| * OK | ||
| 05 MAX-OK OCCURS 5 PIC X. | ||
| * KO: Max value cannot be zero or negative | ||
| 05 MAX-ZERO OCCURS 0 PIC X. | ||
| 05 MAX-NEG OCCURS -2 PIC X. | ||
| * OK: Min value can be zero | ||
| 05 MIN-ZERO OCCURS 0 TO 5 DEPENDING ON CNT PIC X. | ||
| * KO: Min value cannot be negative | ||
| 05 MIN-NEG OCCURS -2 TO 1 DEPENDING ON CNT PIC X. | ||
| * KO: Min value cannot exceed Max value | ||
| 05 MIN-EXCEED-MAX OCCURS 2 TO 1 DEPENDING ON CNT PIC X. | ||
|
|
||
| PROCEDURE DIVISION. | ||
| GOBACK | ||
| . | ||
| END PROGRAM TCOCCLVL. |
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
Oops, something went wrong.
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.
unwanted space between 0 and )