-
Notifications
You must be signed in to change notification settings - Fork 261
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: Legacy module names option #5679
Merged
robin-aws
merged 7 commits into
dafny-lang:master
from
robin-aws:legacy-module-names-option
Aug 12, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
24df35e
Add option
robin-aws 347031d
Hook up option
robin-aws 465fdb0
Fix double _Compile
robin-aws 24ea8f8
Updated test to export issue and use new option
robin-aws 5323228
Avoid empty parent module, whitespace
robin-aws 2ad5972
Merge branch 'master' of github.com:dafny-lang/dafny into legacy-modu…
robin-aws af12024
Fix bad merge
robin-aws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 18 additions & 11 deletions
29
...onTests/TestFiles/LitTests/LitTest/comp/separate-compilation/Inputs/producer/timesTwo.dfy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
module {:options "--function-syntax:4"} LibraryModule { | ||
module {:options "--function-syntax:4"} CoolLibraryName { | ||
|
||
function TimesTwo(x: nat): nat | ||
{ | ||
x * 2 | ||
} | ||
// Ensuring this module is not empty, | ||
// or else it will be omitted from the translation record. | ||
const FOO := 42 | ||
|
||
module LibraryModule { | ||
|
||
datatype Result<+T, +E> = Success(value: T) | Failure(error: E) | ||
function TimesTwo(x: nat): nat | ||
{ | ||
x * 2 | ||
} | ||
|
||
// Record type | ||
datatype Pair<+T, +U> = Pair(first: T, second: U) | ||
datatype Result<+T, +E> = Success(value: T) | Failure(error: E) | ||
|
||
datatype NestedTypeConstructorRecord<+T> = First(value: Pair<T, T>) | ||
datatype NestedTypeConstructorClass<+T> = First2(value: Pair<T, T>) | Second2(value: Pair<T, T>) | ||
// Record type | ||
datatype Pair<+T, +U> = Pair(first: T, second: U) | ||
|
||
datatype NoTypeArgs = Success2 | Failure2 | ||
datatype NestedTypeConstructorRecord<+T> = First(value: Pair<T, T>) | ||
datatype NestedTypeConstructorClass<+T> = First2(value: Pair<T, T>) | Second2(value: Pair<T, T>) | ||
|
||
datatype NoTypeArgs = Success2 | Failure2 | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make it so that read translation record options are automatically stored in the module specific options that are attached to ModuleDecl, and then let the
options
here be those module specific options, so that if a Dafny 4.7 project that does not use--legacy-module-names
, imports a Dafny 4.7 project that does use--legacy-module-names
, it still works.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that in mind as a future improvement when I added translation records too.