-
Notifications
You must be signed in to change notification settings - Fork 25
1791 initial value and continuation lines #1799
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
13 commits
Select commit
Hold shift + click to select a range
40757a4
WI #1777 Include comments in continuation line groups in non-incremen…
fm-117 6291931
WI #1777 Add LSR test for error reporting on continued lines
fm-117 e5c927e
WI #1777 Fix final ScanState for continuation line group
fm-117 6bec04b
WI #1791 Keep trailing spaces in literals from continued lines
fm-117 523d17b
WI #457 Update MultiLines.cbl test
fm-117 8e38b02
WI #1791 #457 #1671 Rewrite token attribution algorithm for continuat…
fm-117 737b7ac
WI #1791 Add unit test
fm-117 b7333ab
WI #457 Move SubscriptAndMultiLines test into regular test folder
fm-117 9c54b3a
WI #1671 Add unit test
fm-117 897af76
WI #1671 Improve readability of SplitToken local function
fm-117 2bc76f0
Merge branch 'develop' into 1791_initial_value_and_continuation_lines
fm-117 d922866
WI #1791 Update unit tests
fm-117 cf81825
Merge branch 'develop' into 1791_initial_value_and_continuation_lines
fm-117 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| using System.IO; | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
| using TypeCobol.Compiler; | ||
| using TypeCobol.Compiler.Nodes; | ||
| using TypeCobol.Test.Utils; | ||
|
|
||
| namespace TypeCobol.Test.Misc | ||
| { | ||
| [TestClass] | ||
| public class TestInitialValueParsing | ||
| { | ||
| /// <summary> | ||
| /// Issue #1791, parse 'InitialValuesContinuations.cbl' in Parser\Programs\Cobol85\ContinuationLine | ||
| /// and check initial string values for all fields | ||
| /// </summary> | ||
| [TestMethod] | ||
| [TestCategory("Parsing")] | ||
| [TestProperty("Time", "fast")] | ||
| public void CheckInitialValuesContinuations() | ||
| { | ||
| string[] expectedInitialValues = | ||
| { | ||
| "start1 end1", | ||
| "start2 end2", | ||
| "start3 end3", | ||
| "start4 end4", | ||
| "start5 extension end5" | ||
| }; | ||
|
|
||
| var folder = Path.Combine("Parser", "Programs", "Cobol85", "ContinuationLine"); | ||
| var compilationUnit = ParserUtils.ParseCobolFile("InitialValuesContinuations", DocumentFormat.RDZReferenceFormat, folder); | ||
| var workingStorage = compilationUnit.TemporaryProgramClassDocumentSnapshot.Root.MainProgram.Children[0].Children[0]; | ||
|
|
||
| for (int i = 0; i < workingStorage.ChildrenCount; i++) | ||
| { | ||
| var field = (DataDescription) workingStorage.Children[i]; | ||
| string expectedInitialValue = expectedInitialValues[i]; | ||
| string actualInitialValue = field.CodeElement.InitialValue.AlphanumericValue.Value; | ||
| Assert.AreEqual(expectedInitialValue, actualInitialValue); | ||
| } | ||
| } | ||
| } | ||
| } |
1 change: 0 additions & 1 deletion
1
TypeCobol.Test/NewTestsToFix/Parser/ResultFiles/MidPriority/MultiLines.rdz-Nodes.txt
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
TypeCobol.Test/NewTestsToFix/Parser/ResultFiles/MidPriority/MultiLines.rdzPGM.txt
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
TypeCobol.Test/NewTestsToFix/Parser/ResultFiles/MidPriority/SubscriptAndMultiLines.rdz.txt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
TypeCobol.Test/NewTestsToFix/Parser/ResultFiles/MidPriority/SubscriptAndMultiLinesPGM.txt
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
TypeCobol.Test/NewTestsToFix/Parser/Samples/MidPriority/MultiLines.rdz.cbl
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
TypeCobol.Test/Parser/Programs/Cobol85/ContinuationLine/ContinuationPictureString.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,31 @@ | ||
| IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. DVZZMFT0. | ||
| DATA DIVISION. | ||
| WORKING-STORAGE SECTION. | ||
| *Testing various interrupted PIC/usage clauses, expect no errors | ||
| 01 group1. | ||
| 05 data1 PIC X | ||
| - X. | ||
| 05 data2 PIC X( | ||
| - 1). | ||
| 05 data3 PIC 9(4) COM | ||
| - P-3. | ||
| 05 data4 PIC 9(4) COMP | ||
| - -3. | ||
| 05 data5 PIC 9(4) COMP- | ||
| - 3. | ||
| 01 group2. | ||
| 05 data1 PIC X | ||
| - X. | ||
| 05 data2 PIC X( | ||
| - 1). | ||
| 05 data3 PIC 9(4) COM | ||
| - P-3. | ||
| 05 data4 PIC 9(4) COMP | ||
| - -3. | ||
| 05 data5 PIC 9(4) COMP- | ||
| - 3. | ||
| PROCEDURE DIVISION. | ||
| GOBACK | ||
| . | ||
| END PROGRAM DVZZMFT0. |
31 changes: 31 additions & 0 deletions
31
TypeCobol.Test/Parser/Programs/Cobol85/ContinuationLine/ContinuationPictureString.rdzMix.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,31 @@ | ||
| IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. DVZZMFT0. | ||
| DATA DIVISION. | ||
| WORKING-STORAGE SECTION. | ||
| *Testing various interrupted PIC/usage clauses, expect no errors | ||
| 01 group1. | ||
| 05 data1 PIC X | ||
| - X. | ||
| 05 data2 PIC X( | ||
| - 1). | ||
| 05 data3 PIC 9(4) COM | ||
| - P-3. | ||
| 05 data4 PIC 9(4) COMP | ||
| - -3. | ||
| 05 data5 PIC 9(4) COMP- | ||
| - 3. | ||
| 01 group2. | ||
| 05 data1 PIC X | ||
| - X. | ||
| 05 data2 PIC X( | ||
| - 1). | ||
| 05 data3 PIC 9(4) COM | ||
| - P-3. | ||
| 05 data4 PIC 9(4) COMP | ||
| - -3. | ||
| 05 data5 PIC 9(4) COMP- | ||
| - 3. | ||
| PROCEDURE DIVISION. | ||
| GOBACK | ||
| . | ||
| END PROGRAM DVZZMFT0. |
27 changes: 27 additions & 0 deletions
27
TypeCobol.Test/Parser/Programs/Cobol85/ContinuationLine/InitialValuesContinuations.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,27 @@ | ||
| IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. TCOMFL01. | ||
| data division. | ||
| working-storage section. | ||
| 01 var1 PIC X(120) VALUE "start1 | ||
| - "end1". | ||
| 01 var2 PIC X(120) VALUE 'start2 | ||
| *comment | ||
| - 'end2'. | ||
| 01 var3 PIC X(120) VALUE "start3 | ||
|
|
||
| - "end3". | ||
| 01 var4 PIC X(120) VALUE 'start4 | ||
| - | ||
| - 'end4'. | ||
| 01 var5 PIC X(120) VALUE "start5 | ||
| - "extension | ||
| - "end5". | ||
| procedure division. | ||
| display var1 | ||
| display var2 | ||
| display var3 | ||
| display var4 | ||
| display var5 | ||
| goback | ||
| . | ||
| end program TCOMFL01. |
27 changes: 27 additions & 0 deletions
27
...Cobol.Test/Parser/Programs/Cobol85/ContinuationLine/InitialValuesContinuations.rdzMix.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,27 @@ | ||
| IDENTIFICATION DIVISION. | ||
| PROGRAM-ID. TCOMFL01. | ||
| data division. | ||
| working-storage section. | ||
| 01 var1 PIC X(120) VALUE "start1 | ||
| - "end1". | ||
| 01 var2 PIC X(120) VALUE 'start2 | ||
| *comment | ||
| - 'end2'. | ||
| 01 var3 PIC X(120) VALUE "start3 | ||
|
|
||
| - "end3". | ||
| 01 var4 PIC X(120) VALUE 'start4 | ||
| - | ||
| - 'end4'. | ||
| 01 var5 PIC X(120) VALUE "start5 | ||
| - "extension | ||
| - "end5". | ||
| procedure division. | ||
| display var1 | ||
| display var2 | ||
| display var3 | ||
| display var4 | ||
| display var5 | ||
| goback | ||
| . | ||
| end program TCOMFL01. |
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
27 changes: 27 additions & 0 deletions
27
TypeCobol.Test/Parser/Programs/Cobol85/ContinuationLine/SubscriptAndMultiLines.rdz.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,27 @@ | ||
| --- Code Elements --- | ||
| [[ProgramIdentification]] [8,21:IDENTIFICATION]<IDENTIFICATION> --> [25,25+:.]<PeriodSeparator> | ||
| - ProgramName = MYPGM | ||
| - 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} --> [65,65+:.]<PeriodSeparator> | ||
|
|
||
| [[DataDescriptionEntry]] [8,9:01]<LevelNumber>{1} --> [51,51+:.]<PeriodSeparator> | ||
|
|
||
| [[ProcedureDivisionHeader]] [8,16:PROCEDURE]<PROCEDURE> --> [26,26+:.]<PeriodSeparator> | ||
|
|
||
| [[DisplayStatement]] [12,18:DISPLAY]<DISPLAY> --> [35,43:W-CPT-LUS]<UserDefinedWord> | ||
| - variables = '>>> DOUBLON BIN: ' ENTREE-ENR ' ENREG NUM: ' W-CPT-LUS | ||
|
|
||
| [[ExitStatement]] [12,15:EXIT]<EXIT> --> [12,15:EXIT]<EXIT> | ||
|
|
||
| [[SentenceEnd]] [16,16+:.]<PeriodSeparator> --> [16,16+:.]<PeriodSeparator> | ||
|
|
||
| [[ProgramEnd]] [8,10:END]<END> --> [25,25+:.]<PeriodSeparator> | ||
| - ProgramName = MYPGM | ||
|
|
13 changes: 13 additions & 0 deletions
13
TypeCobol.Test/Parser/Programs/Cobol85/ContinuationLine/SubscriptAndMultiLinesPGM.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,13 @@ | ||
| --- Program --- | ||
| PROGRAM: C6LIST1B common:False initial:False recursive:False | ||
| author: ? written: ? compiled: ? installation: ? security: ? | ||
| --- Intrinsic:Namespace:Program:Global:Local | ||
| -- DATA -------- | ||
| W-CPT-LUS:Numeric | ||
| ENTREE-ENR:Alphanumeric | ||
| --- Intrinsic | ||
| -- TYPES ------- | ||
| BOOL:BOOL | ||
| DATE:DATE | ||
| CURRENCY:CURRENCY | ||
| STRING:STRING |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.