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

Timechart refactoring #490

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

51-code
Copy link
Contributor

@51-code 51-code commented Jan 29, 2025

Fixes #473 .

Refactored TimechartStep:

  • Made it immutable
  • Removed the AbstractTimechartStep class which basically just contained getters and setters and the class variables

Reworked TimechartTest:

  • The tests broke because they checked the correct translation of the parse tree with the getters from TimechartStep. Reworked the tests to assert equality with an expected TimechartStep object instead.

Refactored TimechartTransformation:

  • Removed unused parameters, unused code, commented out code and so on.
  • Refactored the visiting logic. Old version used a for loop to go over the child nodes and collect values for the TimechartStep. The new version calls visitChildren() and collects the values for TimechartStep to class variables instead.

@51-code 51-code added the feature Existing feature label Jan 29, 2025
@51-code 51-code self-assigned this Jan 29, 2025
@51-code 51-code requested a review from eemhu January 29, 2025 11:21
@eemhu
Copy link
Contributor

eemhu commented Jan 29, 2025

Check the possibility of using ContextValue to avoid object mutability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor timechart command
2 participants