Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,78 +339,6 @@ stages:
ArtifactType: Container
parallel: true

- job: WindowsStrictIndentation
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(_WindowsMachineQueueName)
timeoutInMinutes: 120
steps:
- checkout: self
clean: true

- script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation+
env:
DOTNET_DbgEnableMiniDump: 1
DOTNET_DbgMiniDumpType: 2 # 1=mini, 2=heap, 3=triage, 4=full. Heap dumps include managed object data for debugging.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
displayName: Build

- task: PublishBuildArtifacts@1
displayName: Publish Build BinLog
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.slnx.binlog'
ArtifactName: 'Windows Release build binlogs'
ArtifactType: Container
parallel: true
- task: PublishBuildArtifacts@1
displayName: Publish Dumps
condition: failed()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release'
ArtifactName: 'Windows Release WindowsStrictIndentation process dumps'
ArtifactType: Container
parallel: true

- job: WindowsNoStrictIndentation
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(_WindowsMachineQueueName)
timeoutInMinutes: 120
steps:
- checkout: self
clean: true

- script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation-
env:
DOTNET_DbgEnableMiniDump: 1
DOTNET_DbgMiniDumpType: 2 # 1=mini, 2=heap, 3=triage, 4=full. Heap dumps include managed object data for debugging.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
displayName: Build

- task: PublishBuildArtifacts@1
displayName: Publish Build BinLog
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.slnx.binlog'
ArtifactName: 'Windows Release build binlogs'
ArtifactType: Container
parallel: true
- task: PublishBuildArtifacts@1
displayName: Publish Dumps
condition: failed()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release'
ArtifactName: 'Windows Release WindowsNoStrictIndentation process dumps'
ArtifactType: Container
parallel: true

# Windows With Compressed Metadata
- job: WindowsCompressedMetadata
variables:
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@

### Breaking Changes
* Optimizer: don't inline named functions in debug builds ([PR #19548](https://github.com/dotnet/fsharp/pull/19548)
* LexFilter: drop non-strict mode ([PR #20106](https://github.com/dotnet/fsharp/pull/20106))
4 changes: 0 additions & 4 deletions src/Compiler/Driver/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,6 @@ type TcConfigBuilder =
/// If true - every expression in quotations will be augmented with full debug info (fileName, location in file)
mutable emitDebugInfoInQuotations: bool

mutable strictIndentation: bool option

mutable alwaysInline: bool option

mutable exename: string option
Expand Down Expand Up @@ -854,7 +852,6 @@ type TcConfigBuilder =
}
dumpSignatureData = false
realsig = false
strictIndentation = None
alwaysInline = None
compilationMode = TcGlobals.CompilationMode.Unset
}
Expand Down Expand Up @@ -1255,7 +1252,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
member _.bufferWidth = data.bufferWidth
member _.fsiMultiAssemblyEmit = data.fsiMultiAssemblyEmit
member _.FxResolver = data.FxResolver
member _.strictIndentation = data.strictIndentation

member _.alwaysInline =
data.alwaysInline
Expand Down
4 changes: 0 additions & 4 deletions src/Compiler/Driver/CompilerConfig.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,6 @@ type TcConfigBuilder =

mutable emitDebugInfoInQuotations: bool

mutable strictIndentation: bool option

mutable alwaysInline: bool option

mutable exename: string option
Expand Down Expand Up @@ -814,8 +812,6 @@ type TcConfig =

member FxResolver: FxResolver

member strictIndentation: bool option

member alwaysInline: bool

member GetTargetFrameworkDirectories: unit -> string list
Expand Down
8 changes: 0 additions & 8 deletions src/Compiler/Driver/CompilerOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,14 +1200,6 @@ let languageFlags tcConfigB =

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

CompilerOption(
"strict-indentation",
tagNone,
OptionSwitch(fun switch -> tcConfigB.strictIndentation <- Some(switch = OptionSwitch.On)),
None,
Some(FSComp.SR.optsStrictIndentation (formatOptionSwitch (Option.defaultValue false tcConfigB.strictIndentation)))
)

CompilerOption(
"always-inline",
tagNone,
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/Driver/ParseAndCheckInputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ let parseInputStreamAux

// Set up the LexBuffer for the file
let lexbuf =
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, reader)
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, reader)

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

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

// Set up the LexBuffer for the file
let lexbuf =
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, reader)
UnicodeLexing.StreamReaderAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, reader)

// Parse the file drawing tokens from the lexbuf
ParseOneInputLexbuf(tcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger)
Expand Down
3 changes: 1 addition & 2 deletions src/Compiler/Driver/ScriptClosure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ open FSharp.Compiler.CompilerConfig
open FSharp.Compiler.CompilerDiagnostics
open FSharp.Compiler.CompilerImports
open FSharp.Compiler.DependencyManager
open FSharp.Compiler.Diagnostics
open FSharp.Compiler.DiagnosticsLogger
open FSharp.Compiler.IO
open FSharp.Compiler.CodeAnalysis
Expand Down Expand Up @@ -135,7 +134,7 @@ module ScriptPreprocessClosure =
let tcConfig = TcConfig.Create(tcConfigB, false)

let lexbuf =
UnicodeLexing.SourceTextAsLexbuf(true, tcConfig.langVersion, tcConfig.strictIndentation, sourceText)
UnicodeLexing.SourceTextAsLexbuf(true, tcConfig.langVersion, sourceText)

// The root compiland is last in the list of compilands.
let isLastCompiland = (IsScript fileName, tcConfig.target.IsExe)
Expand Down
4 changes: 1 addition & 3 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ lexhlpIdentifierReserved,"The identifier '%s' is reserved for future use by F#"
1118,optFailedToInlineValue,"Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline'"
1119,optRecursiveValValue,"Recursive ValValue %s"
lexfltIncorrentIndentationOfIn,"The indentation of this 'in' token is incorrect with respect to the corresponding 'let'"
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."
lexfltTokenIsOffsideOfContextStartedEarlier,"Unexpected syntax or possible incorrect indentation: this token is offside of context started at position %s. Try indenting this further."
lexfltSeparatorTokensOfPatternMatchMisaligned,"The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation."
lexfltInvalidNestedTypeDefinition,"Nested type definitions are not allowed. Types must be defined at module or namespace level."
lexfltInvalidNestedModule,"Modules cannot be nested inside types. Define modules at module or namespace level."
Expand Down Expand Up @@ -1560,7 +1560,6 @@ optsGetLangVersions,"Display the allowed values for language version."
optsSetLangVersion,"Specify language version such as 'latest' or 'preview'."
optsDisableLanguageFeature,"Disable a specific language feature by name."
optsSupportedLangVersions,"Supported language versions:"
optsStrictIndentation,"Override indentation rules implied by the language version (%s by default)"
optsAlwaysInline,"Always inline 'inline' functions"
nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format."
nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed."
Expand Down Expand Up @@ -1606,7 +1605,6 @@ featureNestedCopyAndUpdate,"Nested record field copy-and-update"
featureExtendedStringInterpolation,"Extended string interpolation similar to C# raw string literals."
featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names."
featureImprovedImpliedArgumentNames,"Improved implied argument names"
featureStrictIndentation,"Raises errors on incorrect indentation, allows better recovery and analysis during editing"
featureConstraintIntersectionOnFlexibleTypes,"Constraint intersection on flexible types"
featureChkNotTailRecursive,"Raises warnings if a member or function has the 'TailCall' attribute, but is not being used in a tail recursive way."
featureWhileBang,"'while!' expression"
Expand Down
3 changes: 0 additions & 3 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type LanguageFeature =
| WildCardInForLoop
| RelaxWhitespace
| RelaxWhitespace2
| StrictIndentation
| NameOf
| ImplicitYield
| OpenTypeDeclaration
Expand Down Expand Up @@ -215,7 +214,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
LanguageFeature.DiagnosticForObjInference, languageVersion80
LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80
LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80
LanguageFeature.StrictIndentation, languageVersion80
LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80
LanguageFeature.WhileBang, languageVersion80
LanguageFeature.ExtendedFixedBindings, languageVersion80
Expand Down Expand Up @@ -423,7 +421,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
| LanguageFeature.DiagnosticForObjInference -> FSComp.SR.featureInformationalObjInferenceDiagnostic ()

| LanguageFeature.StaticLetInRecordsDusEmptyTypes -> FSComp.SR.featureStaticLetInRecordsDusEmptyTypes ()
| LanguageFeature.StrictIndentation -> FSComp.SR.featureStrictIndentation ()
| LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes ()
| LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive ()
| LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop ()
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type LanguageFeature =
| WildCardInForLoop
| RelaxWhitespace
| RelaxWhitespace2
| StrictIndentation
| NameOf
| ImplicitYield
| OpenTypeDeclaration
Expand Down
26 changes: 10 additions & 16 deletions src/Compiler/Facilities/prim-lexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ type internal Position =

type internal LexBufferFiller<'Char> = LexBuffer<'Char> -> unit

and [<Sealed>] internal LexBuffer<'Char>
(filler: LexBufferFiller<'Char>, reportLibraryOnlyFeatures: bool, langVersion: LanguageVersion, strictIndentation: bool option) =
and [<Sealed>] internal LexBuffer<'Char>(filler: LexBufferFiller<'Char>, reportLibraryOnlyFeatures: bool, langVersion: LanguageVersion) =
let context = Dictionary<string, obj>(1)
let mutable buffer = [||]
/// number of valid characters beyond bufferScanStart.
Expand Down Expand Up @@ -344,14 +343,10 @@ and [<Sealed>] internal LexBuffer<'Char>

member _.SupportsFeature featureId = langVersion.SupportsFeature featureId

member _.StrictIndentation = strictIndentation

member _.CheckLanguageFeatureAndRecover featureId range =
FSharp.Compiler.DiagnosticsLogger.checkLanguageFeatureAndRecover langVersion featureId range

static member FromFunction
(reportLibraryOnlyFeatures, langVersion, strictIndentation, f: 'Char[] * int * int -> int)
: LexBuffer<'Char> =
static member FromFunction(reportLibraryOnlyFeatures, langVersion, f: 'Char[] * int * int -> int) : LexBuffer<'Char> =
let extension = Array.zeroCreate 4096

let filler (lexBuffer: LexBuffer<'Char>) =
Expand All @@ -360,35 +355,34 @@ and [<Sealed>] internal LexBuffer<'Char>
Array.blit extension 0 lexBuffer.Buffer lexBuffer.BufferScanPos n
lexBuffer.BufferMaxScanLength <- lexBuffer.BufferScanLength + n

new LexBuffer<'Char>(filler, reportLibraryOnlyFeatures, langVersion, strictIndentation)
new LexBuffer<'Char>(filler, reportLibraryOnlyFeatures, langVersion)

// Important: This method takes ownership of the array
static member FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, strictIndentation, buffer: 'Char[]) : LexBuffer<'Char> =
static member FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, buffer: 'Char[]) : LexBuffer<'Char> =
let lexBuffer =
new LexBuffer<'Char>((fun _ -> ()), reportLibraryOnlyFeatures, langVersion, strictIndentation)
new LexBuffer<'Char>((fun _ -> ()), reportLibraryOnlyFeatures, langVersion)

lexBuffer.Buffer <- buffer
lexBuffer.BufferMaxScanLength <- buffer.Length
lexBuffer

// Important: this method does copy the array
static member FromArray(reportLibraryOnlyFeatures, langVersion, strictIndentation, s: 'Char[]) : LexBuffer<'Char> =
static member FromArray(reportLibraryOnlyFeatures, langVersion, s: 'Char[]) : LexBuffer<'Char> =
let buffer = Array.copy s

LexBuffer<'Char>.FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, strictIndentation, buffer)
LexBuffer<'Char>.FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, buffer)

// Important: This method takes ownership of the array
static member FromChars(reportLibraryOnlyFeatures, langVersion, strictIndentation, arr: char[]) =
LexBuffer.FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, strictIndentation, arr)
static member FromChars(reportLibraryOnlyFeatures, langVersion, arr: char[]) =
LexBuffer.FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, arr)

static member FromSourceText(reportLibraryOnlyFeatures, langVersion, strictIndentation, sourceText: ISourceText) =
static member FromSourceText(reportLibraryOnlyFeatures, langVersion, sourceText: ISourceText) =
let mutable currentSourceIndex = 0

LexBuffer<char>
.FromFunction(
reportLibraryOnlyFeatures,
langVersion,
strictIndentation,
fun (chars, start, length) ->
let lengthToCopy =
if currentSourceIndex + length <= sourceText.Length then
Expand Down
14 changes: 3 additions & 11 deletions src/Compiler/Facilities/prim-lexing.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -146,29 +146,21 @@ type internal LexBuffer<'Char> =
/// True if the specified language feature is supported.
member SupportsFeature: LanguageFeature -> bool

member StrictIndentation: bool option

/// Logs a recoverable error if a language feature is unsupported, at the specified range.
member CheckLanguageFeatureAndRecover: LanguageFeature -> range -> unit

/// Create a lex buffer suitable for Unicode lexing that reads characters from the given array.
/// Important: does take ownership of the array.
static member FromChars:
reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * strictIndentation: bool option * char[] ->
LexBuffer<char>
static member FromChars: reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * char[] -> LexBuffer<char>

/// Create a lex buffer that reads character or byte inputs by using the given function.
static member FromFunction:
reportLibraryOnlyFeatures: bool *
langVersion: LanguageVersion *
strictIndentation: bool option *
('Char[] * int * int -> int) ->
reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * ('Char[] * int * int -> int) ->
LexBuffer<'Char>

/// Create a lex buffer backed by source text.
static member FromSourceText:
reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * strictIndentation: bool option * ISourceText ->
LexBuffer<char>
reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * ISourceText -> LexBuffer<char>

/// The type of tables for an unicode lexer generated by <c>fslex.exe</c>.
[<Sealed>]
Expand Down
Loading
Loading