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

feat: Semantics for dots in {:extern} module names in Python #3919

Merged

Conversation

fabiomadge
Copy link
Collaborator

@fabiomadge fabiomadge commented Apr 28, 2023

Fixes #2963.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@fabiomadge fabiomadge added the run-deep-tests Tells CI to run all tests label Apr 28, 2023
@fabiomadge fabiomadge removed the run-deep-tests Tells CI to run all tests label Apr 28, 2023
@fabiomadge fabiomadge self-assigned this Apr 28, 2023
Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

Definitely an improvement and the implementation LGTM. Does this fix #2963?

How about an update to docs/DafnyRef/integration-py/IntegrationPython.md?

What happens if you also include an Nested.Library.Child module? Is it impossible since then we'd want Nested/Library/__init__.py instead?

@@ -866,7 +866,7 @@ private record TargetPaths(string Directory, string Filename) {
var callToMainTree = new ConcreteSyntaxTree();
string baseName = Path.GetFileNameWithoutExtension(dafnyProgramName);
compiler.EmitCallToMain(mainMethod, baseName, callToMainTree);
callToMain = callToMainTree.ToString(); // assume there aren't multiple files just to call main
callToMain = callToMainTree.MakeString(compiler.TargetIndentSize); // assume there aren't multiple files just to call main
Copy link
Member

Choose a reason for hiding this comment

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

👍

@fabiomadge
Copy link
Collaborator Author

Yes, this only allows for definitions at the leafs, which seems to be the way to structure modules in Python anyway.

@robin-aws robin-aws merged commit 89786a2 into dafny-lang:master May 2, 2023
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.

Nested extern attribute creates stub with incorrect file name in Python
2 participants