Skip to content

Commit 60fc17d

Browse files
authored
Merge pull request #17584 from dotnet/merges/main-to-release/dev17.12
Merge main to release/dev17.12
2 parents e8d381b + bab72ca commit 60fc17d

File tree

977 files changed

+3241
-3238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

977 files changed

+3241
-3238
lines changed

.git-blame-ignore-revs

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Format src/Compiler/Checking/CheckComputationExpressions.fs, https://github.com/dotnet/fsharp/pull/16512
22
603a310cdfd9902ec1d29b399377dcc9ac56235b
3+
4+
# Spelling, https://github.com/dotnet/fsharp/pull/16212
5+
823d5e99fdd13f696ea8fe572d502e5fa68f6fd1

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Fixes # (issue, if applicable)
1313
>
1414
> Release notes files:
1515
> - If anything under `src/Compiler` has been changed, please make sure to make an entry in `docs/release-notes/.FSharp.Compiler.Service/<version>.md`, where `<version>` is usually "highest" one, e.g. `42.8.200`
16-
> - If language feature was added (i.e. `LanguageFeatures.fsi` was changed), please add it to `docs/releae-notes/.Language/preview.md`
16+
> - If language feature was added (i.e. `LanguageFeatures.fsi` was changed), please add it to `docs/release-notes/.Language/preview.md`
1717
> - If a change to `FSharp.Core` was made, please make sure to edit `docs/release-notes/.FSharp.Core/<version>.md` where version is "highest" one, e.g. `8.0.200`.
1818
1919
> Information about the release notes entries format can be found in the [documentation](https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html).

DEVGUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,4 @@ See the "Debugging The Compiler" section of this [article](https://medium.com/@w
342342

343343
If you are behind a proxy server, NuGet client tool must be configured to use it:
344344

345-
See the Nuget config file documention for use with a proxy server [https://learn.microsoft.com/nuget/reference/nuget-config-file](https://learn.microsoft.com/nuget/reference/nuget-config-file)
345+
See the Nuget config file documentation for use with a proxy server [https://learn.microsoft.com/nuget/reference/nuget-config-file](https://learn.microsoft.com/nuget/reference/nuget-config-file)

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
When developers load the FSharp.Compiler.Service solution we set FSHARPCORE_USE_PACKAGE to true if it hasn't already been set to a value.
1414
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local FSharp.Core project.
1515
We also disable arcade and reset certain artifacts and compiler paths to use default ones.
16-
All settings below can be overriden via CLI switches if needed. -->
16+
All settings below can be overridden via CLI switches if needed. -->
1717

1818
<PropertyGroup Condition="'$(SolutionName)' == 'FSharp.Compiler.Service' and '$(BUILDING_USING_DOTNET)' != 'false'">
1919
<BUILDING_USING_DOTNET>true</BUILDING_USING_DOTNET>

TESTGUIDE.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# F# Compiler, Core Library and Visual F# Tools Tests
22

3-
Where this guide mentions the command `build` it means either `build.cmd` in the root folder for Windows, or `build.sh` for Linux/MacOS.
3+
Where this guide mentions the command `build` it means either `build.cmd` in the root folder for Windows, or `build.sh` for Linux/macOS.
44

55
## In this guide
66

@@ -49,9 +49,9 @@ Some test groups can only be run in `CI` configuration, for that, you need to pa
4949

5050
To run tests, from a command prompt, use variations such as the following, depending on which test suite and build configuration you want.
5151

52-
### Tests that can be run on Linux and MacOS
52+
### Tests that can be run on Linux and macOS
5353

54-
If you're using Linux or MacOS to develop, the group of tests that are known to succeed are all in `-testCoreClr`. Any other `-testXXX` argument will currently fail. An effort is underway to make testing and running tests easier on all systems.
54+
If you're using Linux or macOS to develop, the group of tests that are known to succeed are all in `-testCoreClr`. Any other `-testXXX` argument will currently fail. An effort is underway to make testing and running tests easier on all systems.
5555

5656
### Tests that can only be run in Release mode
5757

@@ -123,7 +123,7 @@ This is compiled using [tests\fsharp\FSharp.Tests.FSharpSuite.fsproj](tests/fsha
123123
Tests are grouped in folders per area. Each test compiles and executes a `test.fsx|fs` file in its folder using some combination of compiler or FSI flags specified in the FSharpSuite test project.
124124
If the compilation and execution encounter no errors, the test is considered to have passed.
125125

126-
There are also negative tests checking code expected to fail compilation. See note about baseline under "Other Tips" bellow for tests checking expectations against "baseline" (.bsl) files.
126+
There are also negative tests checking code expected to fail compilation. See note about baseline under "Other Tips" below for tests checking expectations against "baseline" (.bsl) files.
127127

128128
### FSharpQA Suite
129129

@@ -174,7 +174,7 @@ All test execution logs and result files will be dropped into the `tests\TestRes
174174
### Working with baseline tests
175175

176176
FSharp Test Suite works with a couple of `.bsl` (or `.bslpp`) files describing "expected test results" and are called the _Baseline Tests_. Those are matched against the actual output that resides under `.err` or `.vserr` files of the same name during test execution.
177-
When doing so keep in mind to carefully review the diff before comitting updated baseline files.
177+
When doing so keep in mind to carefully review the diff before committing updated baseline files.
178178

179179
The `.bslpp` (for: baseline pre-process) files are specially designed to enable substitution of certain tokens to generate the `.bsl` file. You can look further about the pre-processing logic under [tests/fsharp/TypeProviderTests.fs](tests/fsharp/TypeProviderTests.fs), this is used only for type provider tests for now.
180180

buildtools/README-fslexyacc.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ That means we have to build up FsLex and FsYacc from scratch, _including_ their
1515
We can't pick up the source from "packages" because in a build-from-source scenario we can't even fetch those
1616
packages - we really have to build from just our source tree and .NET SDK.
1717

18-
Please do _not_ modify the code in these directories except by copying over from an upgraded FsLexYacc pacakge.
18+
Please do _not_ modify the code in these directories except by copying over from an upgraded FsLexYacc package.
1919
Without the testing and documentation in the `FsLexYacc` repo, this copied code is just a bunch of untested, undocumented and
2020
largely generated code checked into our source tree.
2121

@@ -31,14 +31,14 @@ For (1), to improve the code/table generators, make a PR to the `FsLexYacc` repo
3131

3232
For (2), normally for FsLexYacc-based tools the runtime is either a source inclusion of `Lexing.fs`, Lexing.fsi, Parsing.fs, Parsing.fsi or a reference to the `FsLexYacc.Runtime` package. The runtime contains LexBuffer and the lexing/parsing table interpreters.
3333

34-
However long ago we decided to duplicate and ingest the _runtime_ files for FsLex and FsYacc into the F# compiler rather than taking them directly from the FsLexYacc project. This was mainly because we wanted to squeeze optimizations out of them based on profiling and simplify them a bit. The duplicated files are `prim-lexing.fs`, `prim-parsing.fs` and the corresponding `.fsi` files in `src/utils`. These files are sufficient to implement the contracts exepcted by the FsLex/FsYacc generated code, and require exactly the same table formats as generated by FsLex/FsYacc.
34+
However long ago we decided to duplicate and ingest the _runtime_ files for FsLex and FsYacc into the F# compiler rather than taking them directly from the FsLexYacc project. This was mainly because we wanted to squeeze optimizations out of them based on profiling and simplify them a bit. The duplicated files are `prim-lexing.fs`, `prim-parsing.fs` and the corresponding `.fsi` files in `src/utils`. These files are sufficient to implement the contracts excepted by the FsLex/FsYacc generated code, and require exactly the same table formats as generated by FsLex/FsYacc.
3535

3636
This means you can improve some aspects of the _runtime_ for FsLex and FsYacc by making direct changes to `prim-lexing.fs` and `prim-parsing.fs`.
3737

3838
For example, the _actual_ `LexBuffer` type being used in the F# compiler (for all three lexers and grammars) is this one: https://github.com/dotnet/fsharp/blob/bdb64624f0ca220ca4433c83d02dd5822fe767a5/src/Compiler/Facilities/prim-lexing.fsi#L102 . (That version of the Lex/Yacc runtime has added some things: `BufferLocalStore` for example, which we use for the `XmlDoc` accumulator as we strip those out. It's also dropped any mention of async lexing, and any mention of `byte`. The use
3939
of generics for `LexBuffer<'Char>` is also superfluous because `'Char` is always `char` but is needed because the FsLex/FsYacc generated code expects this type to be generic.)
4040

41-
## What if I want to eridicate our use of FsLex and FsYacc?
41+
## What if I want to eradicate our use of FsLex and FsYacc?
4242

4343
The use of FsLex and FsYacc in this repo is somewhat controversial since the C# compiler implementation uses hand-written lexers and parsers.
4444

@@ -48,7 +48,7 @@ overly difficult given the declarative nature of `FsLex` tokenization.
4848
The use of a table-driven LALR(1) parser is more controversial: there is a general feeling that it would be great to
4949
somehow move on from FsYacc and do parsing some other way. However, it is not at all easy to do that and remain
5050
fully compatible. For this reason it is unlikely we will remove the use of FsYacc any time soon. However incremental
51-
modifications to extract more information from the grammer may yield good results.
51+
modifications to extract more information from the grammar may yield good results.
5252

5353
## Why aren't FsLex and FsYacc just ingested into this repo if we depend on them (and even have an exact copy of them for build-from-source)?
5454

@@ -57,7 +57,7 @@ considered carefully. While we are open to adding features to these tools specif
5757
independently. For these reasons it is generally best that these tools live in their own repository.
5858

5959
The copy of the `fslex` and `fsyacc` source code in `buildtools` is an exact copy and is not tested or documented
60-
apart from what's been done before in FsLexYacc repo. Adjusting these copies is not allowed and would be wrong from an engineering persepctive,
60+
apart from what's been done before in FsLexYacc repo. Adjusting these copies is not allowed and would be wrong from an engineering perspective,
6161
because there's no place to put documentation or tests.
6262

6363
Occasionally we discuss ingesting FsLex and FsYacc into this repository. This often comes up in the hope that by doing so

buildtools/checkpackages/check.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if ($LASTEXITCODE -eq 0)
99
{
1010
$package = Get-Content -Path .\Version.txt
1111
Write-Error "
12-
Package restore succeded for '${package}', expected to fail.
12+
Package restore succeeded for '${package}', expected to fail.
1313
This usually means that the package has been already published.
1414
Please, bump the version to fix this failure." -ErrorAction Stop
1515
} else {

buildtools/fslex/Lexing.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ and [<Sealed>]
7272
let extendBufferAsync = (fun () -> match filler.fillAsync with Some refill -> refill this | None -> invalidOp "attempt to read asynchronously from a synchronous lex buffer")
7373
let mutable buffer=[||]
7474

75-
/// number of valid charactes beyond bufferScanStart
75+
/// number of valid characters beyond bufferScanStart
7676
let mutable bufferMaxScanLength=0
7777

7878
/// count into the buffer when scanning

buildtools/fslex/Lexing.fsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ type AsciiTables =
136136
/// Interpret tables for an ascii lexer generated by fslex.
137137
member Interpret: initialState:int * LexBuffer<byte> -> int
138138

139-
[<System.Obsolete("Async interretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
139+
[<System.Obsolete("Async interpretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
140140
/// Interpret tables for an ascii lexer generated by fslex, processing input asynchronously
141141
member AsyncInterpret: initialState:int * LexBuffer<byte> -> Async<int>
142142

@@ -150,7 +150,7 @@ type UnicodeTables =
150150
/// Interpret tables for a unicode lexer generated by fslex.
151151
member Interpret: initialState:int * LexBuffer<char> -> int
152152

153-
[<System.Obsolete("Async interretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
153+
[<System.Obsolete("Async interpretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
154154
/// Interpret tables for a unicode lexer generated by fslex, processing input asynchronously
155155
member AsyncInterpret: initialState:int * LexBuffer<char> -> Async<int>
156156

buildtools/fslex/Parsing.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ module Implementation =
431431
// and an EOF token.
432432
if inEofCountDown && eofCountDown < 10 then
433433
#if __DEBUG
434-
if Flags.debug then printfn "poppin stack, lokking to shift both 'error' and that token, during end-of-file error recovery"
434+
if Flags.debug then printfn "poppin stack, looking to shift both 'error' and that token, during end-of-file error recovery"
435435
#endif
436436
popStackUntilErrorShifted(if haveLookahead then Some(lookaheadToken) else None)
437437

buildtools/fslex/Parsing.fsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ type Tables<'tok> =
113113
/// Returns an object indicating the final synthesized value for the parse.
114114
member Interpret : lexer:(LexBuffer<'char> -> 'tok) * lexbuf:LexBuffer<'char> * startState:int -> obj
115115

116-
/// Indicates an accept action has occured
116+
/// Indicates an accept action has occurred
117117
exception Accept of obj
118-
/// Indicates a parse error has occured and parse recovery is in progress
118+
/// Indicates a parse error has occurred and parse recovery is in progress
119119
exception RecoverableParseError
120120

121121
#if __DEBUG

buildtools/fslex/fslexast.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ let LexerStateToNfa ctx (macros: Map<string,_>) (clauses: Clause list) =
258258
// These cases unwind the difficult cases in the syntax that rely on knowing the
259259
// entire alphabet.
260260
//
261-
// Note we've delayed the expension of these until we've worked out all the 'special' Unicode characters
261+
// Note we've delayed the expansion of these until we've worked out all the 'special' Unicode characters
262262
// mentioned in the entire lexer spec, i.e. we wait until GetAlphabet returns a reliable and stable answer.
263263
| Inp (UnicodeCategory uc) ->
264264
let re = Alt(fun ctx ->

buildtools/fsyacc/Lexing.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ and [<Sealed>]
7272
let extendBufferAsync = (fun () -> match filler.fillAsync with Some refill -> refill this | None -> invalidOp "attempt to read asynchronously from a synchronous lex buffer")
7373
let mutable buffer=[||]
7474

75-
/// number of valid charactes beyond bufferScanStart
75+
/// number of valid characters beyond bufferScanStart
7676
let mutable bufferMaxScanLength=0
7777

7878
/// count into the buffer when scanning

buildtools/fsyacc/Lexing.fsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ type AsciiTables =
136136
/// Interpret tables for an ascii lexer generated by fslex.
137137
member Interpret: initialState:int * LexBuffer<byte> -> int
138138

139-
[<System.Obsolete("Async interretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
139+
[<System.Obsolete("Async interpretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
140140
/// Interpret tables for an ascii lexer generated by fslex, processing input asynchronously
141141
member AsyncInterpret: initialState:int * LexBuffer<byte> -> Async<int>
142142

@@ -150,7 +150,7 @@ type UnicodeTables =
150150
/// Interpret tables for a unicode lexer generated by fslex.
151151
member Interpret: initialState:int * LexBuffer<char> -> int
152152

153-
[<System.Obsolete("Async interretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
153+
[<System.Obsolete("Async interpretation of lexer tables is now obsolete and will be removed. Please use a background thread if you want async lexing")>]
154154
/// Interpret tables for a unicode lexer generated by fslex, processing input asynchronously
155155
member AsyncInterpret: initialState:int * LexBuffer<char> -> Async<int>
156156

buildtools/fsyacc/Parsing.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ module Implementation =
431431
// and an EOF token.
432432
if inEofCountDown && eofCountDown < 10 then
433433
#if __DEBUG
434-
if Flags.debug then printfn "poppin stack, lokking to shift both 'error' and that token, during end-of-file error recovery"
434+
if Flags.debug then printfn "poppin stack, looking to shift both 'error' and that token, during end-of-file error recovery"
435435
#endif
436436
popStackUntilErrorShifted(if haveLookahead then Some(lookaheadToken) else None)
437437

buildtools/fsyacc/Parsing.fsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ type Tables<'tok> =
113113
/// Returns an object indicating the final synthesized value for the parse.
114114
member Interpret : lexer:(LexBuffer<'char> -> 'tok) * lexbuf:LexBuffer<'char> * startState:int -> obj
115115

116-
/// Indicates an accept action has occured
116+
/// Indicates an accept action has occurred
117117
exception Accept of obj
118-
/// Indicates a parse error has occured and parse recovery is in progress
118+
/// Indicates a parse error has occurred and parse recovery is in progress
119119
exception RecoverableParseError
120120

121121
#if __DEBUG

buildtools/fsyacc/fsyaccast.fs

+7-7
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ let ProcessParserSpecAst (spec: ParserSpec) =
134134
// Process LALR(1) grammars to tables
135135

136136
type ProductionIndex = int
137-
type ProdictionDotIndex = int
137+
type ProductionDotIndex = int
138138

139-
/// Represent (ProductionIndex,ProdictionDotIndex) as one integer
139+
/// Represent (ProductionIndex,ProductionDotIndex) as one integer
140140
type Item0 = uint32
141141

142142
let mkItem0 (prodIdx,dotIdx) : Item0 = (uint32 prodIdx <<< 16) ||| uint32 dotIdx
@@ -287,7 +287,7 @@ type ProductionTable(ntTab:NonTerminalTable, termTab:TerminalTable, nonTerminals
287287
if n >= syms.Length then None else Some syms.[n]
288288
member prodTab.Productions = productions
289289

290-
/// A mutable table maping kernels to sets of lookahead tokens
290+
/// A mutable table mapping kernels to sets of lookahead tokens
291291
type LookaheadTable() =
292292
let t = Dictionary<KernelItemIndex,Set<TerminalIndex>>()
293293
member table.Add(x,y) =
@@ -311,7 +311,7 @@ type KernelTable(kernels) =
311311
member t.Index(kernel) = toIdxMap.[kernel]
312312
member t.Kernel(i) = ofIdxMap.[i]
313313

314-
/// Hold the results of cpmuting the LALR(1) closure of an LR(0) kernel
314+
/// Hold the results of computing the LALR(1) closure of an LR(0) kernel
315315
type Closure1Table() =
316316
let t = Dictionary<Item0,HashSet<TerminalIndex>>()
317317
member table.Add(a,b) =
@@ -648,7 +648,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec): CompiledSpec =
648648

649649
// Compute the "spontaneous" and "propagate" maps for each LR(0) kernelItem
650650
//
651-
// Input: The kernal K of a set of LR(0) items I and a grammar symbol X
651+
// Input: The kernel K of a set of LR(0) items I and a grammar symbol X
652652
//
653653
// Output: The lookaheads generated spontaneously by items in I for kernel items
654654
// in goto(I,X) and the items I from which lookaheads are propagated to kernel
@@ -661,7 +661,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec): CompiledSpec =
661661
//
662662
// PLAN TO OPTIMIZE THIS;
663663
// - Clarify and comment what's going on here
664-
// - verify if we really have to do these enormouos closure computations
664+
// - verify if we really have to do these enormous closure computations
665665
// - assess if it's possible to use the symbol we're looking for to help trim the jset
666666

667667
reportTime(); printf "computing lookahead relations..."; stdout.Flush();
@@ -741,7 +741,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec): CompiledSpec =
741741
// into the table, taking into account precedences etc. and reporting errors.
742742
let addResolvingPrecedence (arr: _[]) kernelIdx termIdx (precNew, actionNew) =
743743
// printf "DEBUG: state %d: adding action for %s, precNew = %a, actionNew = %a\n" kernelIdx (termTab.OfIndex termIdx) outputPrec precNew OutputAction actionNew;
744-
// We add in order of precedence - however the precedences may be the same, and we give warnings when rpecedence resolution is based on implicit file orderings
744+
// We add in order of precedence - however the precedences may be the same, and we give warnings when precedence resolution is based on implicit file orderings
745745

746746
let _, actionSoFar as itemSoFar = arr.[termIdx]
747747

0 commit comments

Comments
 (0)