-
Notifications
You must be signed in to change notification settings - Fork 6k
update compiler directives page of FSharp reference #47130
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
base: main
Are you sure you want to change the base?
Conversation
and for extended if grammar
|`#nowarn` *warningcode*|Disables a compiler warning or warnings. To disable multiple warning numbers on the same line, separate each string by a space. <br/> For example: `#nowarn 9 42`<br/> The warning is disabled until eof or until a `#warnon` directive for that same warning number is foud.| | ||
|`#warnon` *warningcode*|Enables a compiler warning (or warnings) that was disabled by a compiler option or by a `#nowarn` directive..<br/> The warning is enabled until eof or until a `#nowarn` directive for that same warning number is found.| |
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.
Do we want to list also the #nowarn "42"
option (with quotes), since it is what most codebases use?
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.
Maybe include pseudogrammar:
#nowarn (int list | string list)
, where strings are without the FS
prefix?
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 guess I will add a whole section then with more details. I will come back to 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.
I added a more detailed section on the warn directives.
In this context I also removed the redundant term "preprocessor directives" from the page. In the F# spec, the term "preprocessor directive" is used only for what in this document is called "conditional compilation directives". Also, the one and only compiler has no separate preprocessor, so "compiler directives" seems to be the right general term.
This PR updates the compiler directives page of the FSharp reference according to RFC FS-1146 (scoped nowarn) that was implemented for FSharp 10 here.
Also, the section on conditional directives is updated according this speclet that was implemented for F# 4.0 ten years ago but never found its way into the reference.
/cc @T-Gro
Internal previews