-
Notifications
You must be signed in to change notification settings - Fork 271
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
Support all option types in the project file #4506
Support all option types in the project file #4506
Conversation
} | ||
errorWriter.WriteLine( | ||
$"Error: property '{tomlPath}' is of type '{tomlValue.GetType()}' but should be of type '{type}'"); | ||
var parseResult = option.Parse(new[] { option.Aliases.First(), tomlValue }); |
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.
This will parse the project file options in the same way as the CLI parses them, so there won't be any discrepancy any more.
ghost function Bar(): int { 3 }".TrimStart(); | ||
|
||
var projectFileSource = @" | ||
includes = [""**/*.dfy""] | ||
|
||
[options] | ||
warn-shadowing = false | ||
quantifier-syntax = 4 |
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.
In your test, could you please add an option that was otherwise translated to an enum or otherwise processed?
For example:
test-assumptions = externs
It serves no purpose for your example other than testing that the parsing mechanism works (which it did not until this PR)
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.
quantifier-syntax
is an enum type option, even though it looks like an int. If I just add test-assumptions = externs
without testing its effects, then it's not testing much is it?
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.
Oh great, you got my point and that's perfect then.
…ardDrummer/dafny into supportAllOptionTypesInProjectFile
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.
Perfect!
…ardDrummer/dafny into supportAllOptionTypesInProjectFile
@@ -9,7 +9,7 @@ Warning: only Dafny project files named dfyconfig.toml are recognised by the Daf | |||
Warning: option 'does-not-exist' that was specified in the project file, is not a valid Dafny option. | |||
|
|||
Dafny program verifier did not attempt verification | |||
Error: property 'warn-shadowing' is of type 'System.Int64' but should be of type 'System.Boolean' | |||
Error: Could not parse value '3' for option 'warn-shadowing' that has type 'Boolean' |
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.
Much better error message.
…ardDrummer/dafny into supportAllOptionTypesInProjectFile
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.
Previously approved
### Changes - Support all option types in the project file by parsing the project file options in the same way as the CLI parses them ### Testing - Added a case that uses an enum option to an existing test <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>
### Changes - Support all option types in the project file by parsing the project file options in the same way as the CLI parses them ### Testing - Added a case that uses an enum option to an existing test <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>
Wow thanks @keyboardDrummer! I just tested it, the feature I implemented can finally be accessed easily. I'm super happy :D |
### Changes - Support all option types in the project file by parsing the project file options in the same way as the CLI parses them ### Testing - Added a case that uses an enum option to an existing test <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>
### Changes - Support all option types in the project file by parsing the project file options in the same way as the CLI parses them ### Testing - Added a case that uses an enum option to an existing test <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>
### Changes - Support all option types in the project file by parsing the project file options in the same way as the CLI parses them ### Testing - Added a case that uses an enum option to an existing test <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>
Changes
Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.