-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: @-attributes on top-level declarations (#5825)
Related to #5795 ### Description This is the first intruction of @-attributes in Dafny. * In this PR @-attributes are parsed only for top-level declarations and member declarations * Old-style attributes are still supported * An early resolution rewriting phase takes care of converting these new attributes whose name is "@" and have one argument, to regular attributes * Boogie does not receives these user-supplied @- attributes for now * @-attributes are resolved as if they were datatypes * For attributes used during parsing (i.e. options), I changed the code to also detect @-attributes * Formatting of @-attributes ### Future features in development not included in this PR * User-defined @-attributes * @-attributes on clauses, statements, expressions * Language server auto-complete of @-attributes ### How has this been tested? - Existing CI tests ensure we did not loose existing attributes - One test to pass when @-attributes are correctly supplied - Two failure tests to verify that @-attributes have correct resolution errors and don't parse @-calls - The `Compile(false)` on the new version of some `DafnyCore/**/.dfy` files is tested by the fact that the generated code still does not contain the modules annotated that way. - Pretty-printing checked by all checked Dafny source files in DafnyCore and DafnyStandardLibraries Note that I could not reach in this PR a failing test to trigger the "Attribute not expected here" error, because Coco interprets an @-attribute as the start of a TopLevelDecl for now. In an upcoming PR, non-empty @-attributes will be returned by TopDecl so this error message will be tested. <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
7681e01
commit a01b106
Showing
45 changed files
with
876 additions
and
149 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
Oops, something went wrong.