Skip to content
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

#983: Refactor CTPG script options Java parser code #462

Merged

Conversation

tomuben
Copy link
Collaborator

@tomuben tomuben commented Oct 17, 2024

Nicoretti
Nicoretti previously approved these changes Oct 18, 2024
scriptCode.replace(optionIt->origPos, optionIt->origLen, optionIt->script);
}
collectImportScripts(optionIt->second, recursionDepth, collectedScript);
//Now replace the imported script bodies
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
//Now replace the imported script bodies

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

std::vector<ReplacedScripts> replacedScripts;
replacedScripts.reserve(optionIt->second.size());
std::vector<CollectedScript> collectedScript;
collectedScript.reserve(optionIt->second.size());
//In order to continue compatibility with legacy implementation we must collect import scripts in forward direction
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should probably go into collectImportScripts

Copy link
Collaborator Author

@tomuben tomuben Oct 18, 2024

Choose a reason for hiding this comment

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

Hm, the comment is about both steps:
collectImportScripts() + ``replaceImportScripts`. I think it's better to keep it here

std::vector<ReplacedScripts> replacedScripts;
replacedScripts.reserve(optionIt->second.size());
std::vector<CollectedScript> collectedScript;
collectedScript.reserve(optionIt->second.size());
//In order to continue compatibility with legacy implementation we must collect import scripts in forward direction
//but then replace in reverse direction (in order to keep consistency of positions)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this one is already in replaceImportScripts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

 (in order to keep consistency of positions)

@tomuben tomuben merged commit 684d0ef into master Oct 21, 2024
24 checks passed
@tomuben tomuben deleted the refactoring/983_refactor_ctpg_script_options_java_parser_code branch October 21, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants