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

66 cleaner unittests, filedirectory and looser coupling #107

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

Conversation

Aavild
Copy link
Collaborator

@Aavild Aavild commented Jun 29, 2023

Tests for each visitor are now created in their each individual folder. When running the tests they are catagorized in the order: All testcases are catagorised by their testfile. This means that if in Rider catagorised view is selected the tests will be much more sorted. The catagorised sorting looks as following: Filename, Testclass, Testmethod, Testname

Restructered the folders and files to be more clean.

Restructured usage of the visitors so that their usage are more standardised to promote looser coupling.
Changes include:

  • Renamed Typechecker to LogicChecker and enforced master-worker pattern for the Typechecking phase, so that it can be started by just using TypeChecker.Run().
  • Uses a general fascade pattern for all visitors by privatising the constructor of any of the visitors. Instead they can only be used with their static Run method. This is because everything stored in the objects should only be used for one specific run. None of the visitors should ever be used for more than one analysis.
  • It shouldn't be Codegens concern to dispose of the filestream.
  • Similar for how PrettyPrint supports both writing into console and file, the TypeChecker should also allow changing the text output for the exceptions
  • The old TypeChecker(now named: LogicChecker) was incredibly confusing and tightly coupled with StmtLogicChecker and ExpLogicChecker. The purpose of the 3 classes was to seperate the typecheckers logic for that analysis run into more files. Doing this should use partial classes rather than inheritance as they work on the same data and doesn't make sense individually.

closes #66

Doesn't solve but does Improve #72. This issue should also be easier to work on now.

changing this line should make it much easier to start working on #70

Aavild added 4 commits June 27, 2023 13:13
Restructured usage of the visitors so that their usage are more standardised to promote looser coupling.
Changes include:
 - Renamed Typechecker to LogicChecker and created a Poltergeist for the Typechecking phase, so that it can be started by just using TypeChecker.Run().
 - Disallowing any form of instancing of the visitors. Instead they can only be used with their static Run method. This is because everything stored in the objects can only be used for that specific run. Nothing can or should be used for more runs.
 - It shouldn't be Codegens concern to dispose of the filestream.
 - Similar for how PrettyPrint supports both writing into console and file, the TypeChecker should also allow the usage to define where the exceptions should be printed.
 - The old TypeChecker(now LogicChecker) was incredibly confusing and tightly coupled with StmtLogicChecker and ExpLogicChecker. The purpose of the 3 classes was to seperate the typecheckers logic into more files. Doing this should use partial classes rather than inheritance
@Aavild Aavild linked an issue Jun 29, 2023 that may be closed by this pull request
@Aavild Aavild mentioned this pull request Jun 30, 2023
@Aavild Aavild marked this pull request as ready for review June 30, 2023 15:53
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.

Cleaner unittests
1 participant