Skip to content

Commit ea778bb

Browse files
authored
LexFilter: drop non-strict mode (#20106)
1 parent 3cc7755 commit ea778bb

173 files changed

Lines changed: 153 additions & 724 deletions

File tree

Some content is hidden

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

‎azure-pipelines-PR.yml‎

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -339,78 +339,6 @@ stages:
339339
ArtifactType: Container
340340
parallel: true
341341

342-
- job: WindowsStrictIndentation
343-
pool:
344-
name: $(DncEngPublicBuildPool)
345-
demands: ImageOverride -equals $(_WindowsMachineQueueName)
346-
timeoutInMinutes: 120
347-
steps:
348-
- checkout: self
349-
clean: true
350-
351-
- script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation+
352-
env:
353-
DOTNET_DbgEnableMiniDump: 1
354-
DOTNET_DbgMiniDumpType: 2 # 1=mini, 2=heap, 3=triage, 4=full. Heap dumps include managed object data for debugging.
355-
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
356-
NativeToolsOnMachine: true
357-
displayName: Build
358-
359-
- task: PublishBuildArtifacts@1
360-
displayName: Publish Build BinLog
361-
condition: always()
362-
continueOnError: true
363-
inputs:
364-
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.slnx.binlog'
365-
ArtifactName: 'Windows Release build binlogs'
366-
ArtifactType: Container
367-
parallel: true
368-
- task: PublishBuildArtifacts@1
369-
displayName: Publish Dumps
370-
condition: failed()
371-
continueOnError: true
372-
inputs:
373-
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release'
374-
ArtifactName: 'Windows Release WindowsStrictIndentation process dumps'
375-
ArtifactType: Container
376-
parallel: true
377-
378-
- job: WindowsNoStrictIndentation
379-
pool:
380-
name: $(DncEngPublicBuildPool)
381-
demands: ImageOverride -equals $(_WindowsMachineQueueName)
382-
timeoutInMinutes: 120
383-
steps:
384-
- checkout: self
385-
clean: true
386-
387-
- script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation-
388-
env:
389-
DOTNET_DbgEnableMiniDump: 1
390-
DOTNET_DbgMiniDumpType: 2 # 1=mini, 2=heap, 3=triage, 4=full. Heap dumps include managed object data for debugging.
391-
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
392-
NativeToolsOnMachine: true
393-
displayName: Build
394-
395-
- task: PublishBuildArtifacts@1
396-
displayName: Publish Build BinLog
397-
condition: always()
398-
continueOnError: true
399-
inputs:
400-
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.slnx.binlog'
401-
ArtifactName: 'Windows Release build binlogs'
402-
ArtifactType: Container
403-
parallel: true
404-
- task: PublishBuildArtifacts@1
405-
displayName: Publish Dumps
406-
condition: failed()
407-
continueOnError: true
408-
inputs:
409-
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release'
410-
ArtifactName: 'Windows Release WindowsNoStrictIndentation process dumps'
411-
ArtifactType: Container
412-
parallel: true
413-
414342
# Windows With Compressed Metadata
415343
- job: WindowsCompressedMetadata
416344
variables:

‎docs/release-notes/.FSharp.Compiler.Service/11.0.100.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,4 @@
165165

166166
* `FSharp.Compiler.Syntax.SynInterpolatedStringPart.FillExpr` now carries a `SynInterpolationFormatting` value (separating .NET alignment/format from printf specifiers) instead of an `Ident option`. ([PR #19971](https://github.com/dotnet/fsharp/pull/19971))
167167
* Optimizer: don't inline named functions in debug builds ([PR #19548](https://github.com/dotnet/fsharp/pull/19548)
168+
* LexFilter: drop non-strict mode ([PR #20106](https://github.com/dotnet/fsharp/pull/20106))

‎src/Compiler/Driver/CompilerConfig.fs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,6 @@ type TcConfigBuilder =
598598
/// If true - every expression in quotations will be augmented with full debug info (fileName, location in file)
599599
mutable emitDebugInfoInQuotations: bool
600600

601-
mutable strictIndentation: bool option
602-
603601
mutable alwaysInline: bool option
604602

605603
mutable exename: string option
@@ -854,7 +852,6 @@ type TcConfigBuilder =
854852
}
855853
dumpSignatureData = false
856854
realsig = false
857-
strictIndentation = None
858855
alwaysInline = None
859856
compilationMode = TcGlobals.CompilationMode.Unset
860857
}
@@ -1255,7 +1252,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
12551252
member _.bufferWidth = data.bufferWidth
12561253
member _.fsiMultiAssemblyEmit = data.fsiMultiAssemblyEmit
12571254
member _.FxResolver = data.FxResolver
1258-
member _.strictIndentation = data.strictIndentation
12591255

12601256
member _.alwaysInline =
12611257
data.alwaysInline

‎src/Compiler/Driver/CompilerConfig.fsi‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,6 @@ type TcConfigBuilder =
470470

471471
mutable emitDebugInfoInQuotations: bool
472472

473-
mutable strictIndentation: bool option
474-
475473
mutable alwaysInline: bool option
476474

477475
mutable exename: string option
@@ -814,8 +812,6 @@ type TcConfig =
814812

815813
member FxResolver: FxResolver
816814

817-
member strictIndentation: bool option
818-
819815
member alwaysInline: bool
820816

821817
member GetTargetFrameworkDirectories: unit -> string list

‎src/Compiler/Driver/CompilerOptions.fs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,14 +1200,6 @@ let languageFlags tcConfigB =
12001200

12011201
CompilerOption("define", tagString, OptionString(defineSymbol tcConfigB), None, Some(FSComp.SR.optsDefine ()))
12021202

1203-
CompilerOption(
1204-
"strict-indentation",
1205-
tagNone,
1206-
OptionSwitch(fun switch -> tcConfigB.strictIndentation <- Some(switch = OptionSwitch.On)),
1207-
None,
1208-
Some(FSComp.SR.optsStrictIndentation (formatOptionSwitch (Option.defaultValue false tcConfigB.strictIndentation)))
1209-
)
1210-
12111203
CompilerOption(
12121204
"always-inline",
12131205
tagNone,

‎src/Compiler/Driver/ParseAndCheckInputs.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ let parseInputStreamAux
648648

649649
// Set up the LexBuffer for the file
650650
let lexbuf =
651-
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, reader)
651+
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, reader)
652652

653653
// Parse the file drawing tokens from the lexbuf
654654
ParseOneInputLexbuf(tcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger)
@@ -658,7 +658,7 @@ let parseInputSourceTextAux
658658
=
659659
// Set up the LexBuffer for the file
660660
let lexbuf =
661-
UnicodeLexing.SourceTextAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, sourceText)
661+
UnicodeLexing.SourceTextAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, sourceText)
662662

663663
// Parse the file drawing tokens from the lexbuf
664664
ParseOneInputLexbuf(tcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger)
@@ -670,7 +670,7 @@ let parseInputFileAux (tcConfig: TcConfig, lexResourceManager, fileName, isLastC
670670

671671
// Set up the LexBuffer for the file
672672
let lexbuf =
673-
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, reader)
673+
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, reader)
674674

675675
// Parse the file drawing tokens from the lexbuf
676676
ParseOneInputLexbuf(tcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger)

‎src/Compiler/Driver/ScriptClosure.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ open FSharp.Compiler.CompilerConfig
1515
open FSharp.Compiler.CompilerDiagnostics
1616
open FSharp.Compiler.CompilerImports
1717
open FSharp.Compiler.DependencyManager
18-
open FSharp.Compiler.Diagnostics
1918
open FSharp.Compiler.DiagnosticsLogger
2019
open FSharp.Compiler.IO
2120
open FSharp.Compiler.CodeAnalysis
@@ -135,7 +134,7 @@ module ScriptPreprocessClosure =
135134
let tcConfig = TcConfig.Create(tcConfigB, false)
136135

137136
let lexbuf =
138-
UnicodeLexing.SourceTextAsLexbuf(true, tcConfig.langVersion, tcConfig.strictIndentation, sourceText)
137+
UnicodeLexing.SourceTextAsLexbuf(true, tcConfig.langVersion, sourceText)
139138

140139
// The root compiland is last in the list of compilands.
141140
let isLastCompiland = (IsScript fileName, tcConfig.target.IsExe)

‎src/Compiler/FSComp.txt‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ lexhlpIdentifierReserved,"The identifier '%s' is reserved for future use by F#"
999999
1118,optFailedToInlineValue,"Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline'"
10001000
1119,optRecursiveValValue,"Recursive ValValue %s"
10011001
lexfltIncorrentIndentationOfIn,"The indentation of this 'in' token is incorrect with respect to the corresponding 'let'"
1002-
lexfltTokenIsOffsideOfContextStartedEarlier,"Unexpected syntax or possible incorrect indentation: this token is offside of context started at position %s. Try indenting this further.\nTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."
1002+
lexfltTokenIsOffsideOfContextStartedEarlier,"Unexpected syntax or possible incorrect indentation: this token is offside of context started at position %s. Try indenting this further."
10031003
lexfltSeparatorTokensOfPatternMatchMisaligned,"The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation."
10041004
lexfltInvalidNestedTypeDefinition,"Nested type definitions are not allowed. Types must be defined at module or namespace level."
10051005
lexfltInvalidNestedModule,"Modules cannot be nested inside types. Define modules at module or namespace level."
@@ -1560,7 +1560,6 @@ optsGetLangVersions,"Display the allowed values for language version."
15601560
optsSetLangVersion,"Specify language version such as 'latest' or 'preview'."
15611561
optsDisableLanguageFeature,"Disable a specific language feature by name."
15621562
optsSupportedLangVersions,"Supported language versions:"
1563-
optsStrictIndentation,"Override indentation rules implied by the language version (%s by default)"
15641563
optsAlwaysInline,"Always inline 'inline' functions"
15651564
nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format."
15661565
nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed."
@@ -1606,7 +1605,6 @@ featureNestedCopyAndUpdate,"Nested record field copy-and-update"
16061605
featureExtendedStringInterpolation,"Extended string interpolation similar to C# raw string literals."
16071606
featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names."
16081607
featureImprovedImpliedArgumentNames,"Improved implied argument names"
1609-
featureStrictIndentation,"Raises errors on incorrect indentation, allows better recovery and analysis during editing"
16101608
featureConstraintIntersectionOnFlexibleTypes,"Constraint intersection on flexible types"
16111609
featureChkNotTailRecursive,"Raises warnings if a member or function has the 'TailCall' attribute, but is not being used in a tail recursive way."
16121610
featureWhileBang,"'while!' expression"

‎src/Compiler/Facilities/LanguageFeatures.fs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type LanguageFeature =
2020
| WildCardInForLoop
2121
| RelaxWhitespace
2222
| RelaxWhitespace2
23-
| StrictIndentation
2423
| NameOf
2524
| ImplicitYield
2625
| OpenTypeDeclaration
@@ -216,7 +215,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
216215
LanguageFeature.DiagnosticForObjInference, languageVersion80
217216
LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80
218217
LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80
219-
LanguageFeature.StrictIndentation, languageVersion80
220218
LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80
221219
LanguageFeature.WhileBang, languageVersion80
222220
LanguageFeature.ExtendedFixedBindings, languageVersion80
@@ -425,7 +423,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
425423
| LanguageFeature.DiagnosticForObjInference -> FSComp.SR.featureInformationalObjInferenceDiagnostic ()
426424

427425
| LanguageFeature.StaticLetInRecordsDusEmptyTypes -> FSComp.SR.featureStaticLetInRecordsDusEmptyTypes ()
428-
| LanguageFeature.StrictIndentation -> FSComp.SR.featureStrictIndentation ()
429426
| LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes ()
430427
| LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive ()
431428
| LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop ()

‎src/Compiler/Facilities/LanguageFeatures.fsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ type LanguageFeature =
1010
| WildCardInForLoop
1111
| RelaxWhitespace
1212
| RelaxWhitespace2
13-
| StrictIndentation
1413
| NameOf
1514
| ImplicitYield
1615
| OpenTypeDeclaration

0 commit comments

Comments
 (0)