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

[Feature] Implement semantic analysis warnings using CompilableASTNode.checkForWarnings() #199

Closed
6 tasks done
Tracked by #211 ...
Luna-Klatzer opened this issue Jun 18, 2022 · 1 comment · Fixed by #211
Closed
6 tasks done
Tracked by #211 ...
Assignees
Labels
feature New feature or enhancement high priority High priority issue, discussion or pull request
Milestone

Comments

@Luna-Klatzer
Copy link
Member

Luna-Klatzer commented Jun 18, 2022

Is there an existing proposal for this?

  • I have searched the existing issues

This feature does not exist in the latest version

  • I am using the latest version

Proposal

Implement semantic analysis warnings using CompilableASTNode.checkForWarnings(), which is a specific function that will check for warnings during the semantic analysis of a program. If the user decides to disable warnings using a compile config flag, then this function is not called at all avoiding unnecessary checking.

This function should be called last after the primary semantic analysis, type checking and target-specific semantic analysis was finished and not called at all if an error occurred, even with recovery mode (#198).

Exact behaviour / changes you want

  • Add new CLI flags -w/--warnings and --no-warnings.
  • Add new abstract function CompilableASTNode.checkForWarnings(), which must be implemented by every child class.
  • Implement system for handling warnings in CompilableASTNode.semanticAnalysis() and KipperProgramContext, which will keep track of all warnings.
  • Add new field warnings in the class KipperCompileResult, which stores a list of all warnings.
@Luna-Klatzer Luna-Klatzer added the feature New feature or enhancement label Jun 18, 2022
@Luna-Klatzer Luna-Klatzer added this to the Stable Kipper Release milestone Jun 18, 2022
@Luna-Klatzer Luna-Klatzer self-assigned this Jun 18, 2022
@Luna-Klatzer Luna-Klatzer added the high priority High priority issue, discussion or pull request label Jun 26, 2022
@Luna-Klatzer
Copy link
Member Author

This will be partially implemented in v0.9.0 and fully implemented with v0.10.0 using a new KipperWarningsChecker class that extends KipperSemanticErrorHandler. This should allow a similar error behaviour that is used in the KipperTypeChecker and KipperSemanticChecker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement high priority High priority issue, discussion or pull request
Projects
1 participant