Skip to content

Conversation

@mayanje
Copy link
Contributor

@mayanje mayanje commented Oct 29, 2020

Fixes #1752

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Oct 29, 2020
@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Oct 29, 2020
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels Oct 29, 2020
@mayanje
Copy link
Contributor Author

mayanje commented Oct 29, 2020

Sorry I made a mistake with my last commit the target issue should be #1752 rather than #1252

Comment on lines 60 to 64
internal bool IsForCopy
{
get;
set;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private readonly. Set via constructors.

Copy link
Contributor Author

@mayanje mayanje Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are so many parameters in constructors, I prefer to let FileCompiler set this specific and contextual option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also the case for CustomSymbols

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the CompilationDocument is always for Copy and CompilationUnit is always for Program, you can simplify with:
internal virtual bool IsForCopy => true;

And override it CompilationUnit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed

Comment on lines 69 to 73
public MultilineScanState InitialScanStateForCopy
{
get;
set;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, this field should be private readonly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done

@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two new using directives are the only changes in this file, they are not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok removed.

/// Look for pattern ':' (cobol word chars)+ ':'
/// </summary>
private bool CheckForPartialCobolWordPattern(int startIndex, out int patternEndIndex)
private bool CheckForPartialCobolWordPattern(MultilineScanState currentState, int startIndex, out int patternEndIndex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the state can be read directly by the method using the instance field tokensLine so the new parameter is not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Oct 30, 2020
@rooksdo rooksdo linked an issue Oct 30, 2020 that may be closed by this pull request
01 xxxENT3. COPY YxxxENT REPLACING ==::== BY ==S==.
PROCEDURE DIVISION.
MOVE 'A' TO xxxENTS-FCT01-Var1.
END PROGRAM CPYRPL4C.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much, but for this test we could simply use the following working-storage

01 xxxENT. COPY YxxxENT REPLACING ==::== BY ==S==.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal here is to test multiple COPY inclusion.

rooksdo
rooksdo previously approved these changes Nov 2, 2020
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels Nov 2, 2020
smedilol
smedilol previously approved these changes Dec 1, 2020
@mayanje mayanje requested review from fm-117 and rooksdo December 2, 2020 08:44
if (isCopyFile)
{
CompilationResultsForCopy = new CompilationDocument(TextDocument.Source, TextDocument.Lines, compilerOptions, documentProvider, scanState, copyTextNameVariations);
CompilationResultsForCopy = new CompilationDocument(TextDocument.Source, TextDocument.Lines, compilerOptions, documentProvider, scanState, copyTextNameVariations);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 25c29f9

fm-117
fm-117 previously approved these changes Dec 2, 2020
@@ -0,0 +1,2 @@
01 :MDVZOSM:-A::.
05 :MDVZOSM:-A::-Var0 pic X. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My remark is only a detail, but for more consistency with the copy name, the copy should be :

       01  :DVZOSM:-A::.
           05 :DVZOSM:-A::-Var0 pic X. 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in ba16d41

move 'A' to MDVZOSM-A
move 'A' to Foo-A2
.
end program DVZS0OSM. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following my remark on copy YDVZOSM, the 'M' prefix for all MDVZOSM could be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in ba16d41

xxxENT2:Alphanumeric
xxxENT2-FCT01:Alphanumeric
xxxENT2-FCT01-Var1:Alphanumeric
xxxENT1:Alphanumeric
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand how these variables are sorted but they are all there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to say

@mayanje mayanje dismissed stale reviews from fm-117 and smedilol via ba16d41 December 7, 2020 09:05
@mayanje mayanje merged commit f964118 into develop Dec 14, 2020
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Dec 14, 2020
@mayanje mayanje deleted the 1752_Handle_copy_replacing_with_4colonOL branch December 14, 2020 09:29
@mayanje mayanje mentioned this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Merged Pull Request has been merged successfully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle copy replacing with ==::==

5 participants