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

Compiler Validator Pass #79

Merged
merged 9 commits into from
Mar 21, 2023
Merged

Compiler Validator Pass #79

merged 9 commits into from
Mar 21, 2023

Conversation

ScottCarda-MS
Copy link
Contributor

@ScottCarda-MS ScottCarda-MS commented Mar 17, 2023

Added a Validator pass to check that the submitted code does not contain:

  • Adj/Ctl operations that return non-Unit
  • Partial applications
  • Lambda expressions
  • Callable type parameters on callables
  • Type holes

Issue #71

@ScottCarda-MS ScottCarda-MS marked this pull request as ready for review March 17, 2023 23:51
@ScottCarda-MS ScottCarda-MS changed the title Validator Compiler Validator Pass Mar 17, 2023
Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

I think it would make sense to include calls to the validator in the compile function in compiler/qsc_frontend/src/compile.rs. That way you can collect errors and surface them up in a way consistent with how parsing and symbol resolution errors work. That will involve introducing a new ErrorKind alongside the existing ErrorKind::Parse and ErrorKind::Resolve, and then updating the new code in validate.rs to collect errors into an internal structure instead of using panic. We chat more about the details here, but I think this is a good foundation so far.

compiler/qsc_frontend/src/validate.rs Outdated Show resolved Hide resolved
compiler/qsc_frontend/src/validate.rs Outdated Show resolved Hide resolved
compiler/qsc_frontend/src/validate.rs Outdated Show resolved Hide resolved
@swernli swernli mentioned this pull request Mar 20, 2023
swernli
swernli previously approved these changes Mar 21, 2023
Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

One minor formatting comment, otherwise this looks good!

@ScottCarda-MS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@ScottCarda-MS ScottCarda-MS merged commit 4092677 into main Mar 21, 2023
@ScottCarda-MS ScottCarda-MS deleted the sccarda/Validator branch March 21, 2023 17:47
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.

None yet

2 participants