-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not let
Parser.Parse
edit the default module (#4059)
- `Parser.Parse` no longer takes the default module as an argument which it then appends to, but instead returns a new type `FileModuleDefinition`, which acts as a container for file contents. - `SourceProcessor.ProcessDirectives` now makes sure not to remove or add newlines at the end of the file. - Parsing code is shared between CLI and IDE - Module cloning code has been moved out of `Cloner` and into the module classes. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
- Loading branch information
1 parent
abf4e4d
commit 3e555a0
Showing
60 changed files
with
1,189 additions
and
1,143 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.Dafny; | ||
|
||
/// <summary> | ||
/// This is a temporary container of everything declared at the top level of a file, including include directives. | ||
/// After parsing, the contents of this 'module' are moved into the default module. | ||
/// In the future, files may declare implicit modules and then this class will play a non-temporary role: | ||
/// https://github.com/dafny-lang/dafny/issues/3027 | ||
/// </summary> | ||
public class FileModuleDefinition : ModuleDefinition { | ||
public List<Include> Includes { get; } = new(); | ||
|
||
public FileModuleDefinition() : | ||
base(RangeToken.NoToken, new Name("_module"), new List<IToken>(), | ||
false, false, null, null, null, true, false) { | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.