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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions buildtools/fsyacc/fsyaccast.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Symbols = Symbol list
//---------------------------------------------------------------------
// Output Raw Parser Spec AST

let StringOfSym sym = match sym with Terminal s -> "'" ^ s ^ "'" | NonTerminal s -> s
let StringOfSym sym = match sym with Terminal s -> String.Concat("'", s, "'") | NonTerminal s -> s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please do a final "62" full text search?
This file and the fslex files still have it, among others.

I have also not seen a removal of the message behind "62", which I found strange.. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed

let mlCompatWarning s m =
warning (UserCompilerMessage(FSComp.SR.mlCompatMessage s, 62, m))
let mlCompatError s m =
errorR (UserCompilerMessage(FSComp.SR.mlCompatError s, 62, m))

including fscomp texts


let OutputSym os sym = fprintf os "%s" (StringOfSym sym)

Expand Down Expand Up @@ -367,7 +367,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec): CompiledSpec =
stopWatch.Start()

// Augment the grammar
let fakeStartNonTerminals = spec.StartSymbols |> List.map(fun nt -> "_start"^nt)
let fakeStartNonTerminals = spec.StartSymbols |> List.map(fun nt -> String.Concat("_start", nt))
let nonTerminals = [email protected]
let endOfInputTerminal = "$$"
let dummyLookahead = "#"
Expand Down Expand Up @@ -480,7 +480,7 @@ let CompilerLalrParserSpec logf (spec : ProcessedParserSpec): CompiledSpec =
let IsStartItem item0 = fakeStartNonTerminalsSet.Contains(ntIdx_of_item0 item0)
let IsKernelItem item0 = (IsStartItem item0 || dotIdx_of_item0 item0 <> 0)

let StringOfSym sym = match sym with PTerminal s -> "'" ^ termTab.OfIndex s ^ "'" | PNonTerminal s -> ntTab.OfIndex s
let StringOfSym sym = match sym with PTerminal s -> String.Concat("'", termTab.OfIndex s, "'") | PNonTerminal s -> ntTab.OfIndex s

let OutputSym os sym = fprintf os "%s" (StringOfSym sym)

Expand Down
6 changes: 1 addition & 5 deletions src/Compiler/Checking/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,7 @@ let CheckILAttributesForUnseen (g: TcGlobals) cattrs _m =
let CheckFSharpAttributesForHidden g attribs =
not (isNil attribs) &&
(match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribs with
| Some(Attrib(_, _, [AttribStringArg _; AttribInt32Arg messageNumber],
ExtractAttribNamedArg "IsHidden" (AttribBoolArg v), _, _, _)) ->
// Message number 62 is for "ML Compatibility". Items labelled with this are visible in intellisense
// when mlCompatibility is set.
v && not (messageNumber = 62 && g.mlCompatibility)
| Some(Attrib(_, _, _, ExtractAttribNamedArg "IsHidden" (AttribBoolArg v), _, _, _)) -> v
| _ -> false)
||
(match TryFindFSharpAttribute g g.attrib_ComponentModelEditorBrowsableAttribute attribs with
Expand Down
34 changes: 2 additions & 32 deletions src/Compiler/Driver/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ let (++) x s = x @ [ s ]
// Some Globals
//--------------------------------------------------------------------------

let FSharpSigFileSuffixes = [ ".mli"; ".fsi" ]
let FSharpSigFileSuffixes = [ ".fsi" ]

let FSharpMLCompatFileSuffixes = [ ".mli"; ".ml" ]

let FSharpImplFileSuffixes = [ ".ml"; ".fs"; ".fsscript"; ".fsx" ]
let FSharpImplFileSuffixes = [ ".fs"; ".fsscript"; ".fsx" ]

let FSharpScriptFileSuffixes = [ ".fsscript"; ".fsx" ]

let FSharpIndentationAwareSyntaxFileSuffixes =
[ ".fs"; ".fsscript"; ".fsx"; ".fsi" ]

let FSharpExperimentalFeaturesEnabledAutomatically =
String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("FSHARP_EXPERIMENTAL_FEATURES"))
|> not
Expand Down Expand Up @@ -467,7 +462,6 @@ type TcConfigBuilder =
mutable implicitlyReferenceDotNetAssemblies: bool
mutable resolutionEnvironment: LegacyResolutionEnvironment
mutable implicitlyResolveAssemblies: bool
mutable indentationAwareSyntax: bool option
mutable conditionalDefines: string list
mutable loadedSources: (range * string * string) list
mutable compilerToolPaths: string list
Expand All @@ -482,7 +476,6 @@ type TcConfigBuilder =
mutable clearResultsCache: bool
mutable embedResources: string list
mutable diagnosticsOptions: FSharpDiagnosticOptions
mutable mlCompatibility: bool
mutable checkNullness: bool
mutable checkOverflow: bool
mutable showReferenceResolutions: bool
Expand Down Expand Up @@ -701,7 +694,6 @@ type TcConfigBuilder =
// These are all default values, many can be overridden using the command line switch
{
primaryAssembly = PrimaryAssembly.Mscorlib
indentationAwareSyntax = None
noFeedback = false
stackReserveSize = None
conditionalDefines = []
Expand All @@ -725,7 +717,6 @@ type TcConfigBuilder =
clearResultsCache = false
subsystemVersion = 4, 0 // per spec for 357994
useHighEntropyVA = false
mlCompatibility = false
checkNullness = false
checkOverflow = false
showReferenceResolutions = false
Expand Down Expand Up @@ -960,10 +951,6 @@ type TcConfigBuilder =
match GetWarningNumber(m, WarningDescription.String s, tcConfigB.langVersion, WarningNumberSource.CommandLineOption) with
| None -> ()
| Some n ->
// nowarn:62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus
if n = 62 then
tcConfigB.mlCompatibility <- true

tcConfigB.diagnosticsOptions <-
{ tcConfigB.diagnosticsOptions with
WarnOff = ListSet.insert (=) n tcConfigB.diagnosticsOptions.WarnOff
Expand All @@ -975,10 +962,6 @@ type TcConfigBuilder =
match GetWarningNumber(m, WarningDescription.String s, tcConfigB.langVersion, WarningNumberSource.CommandLineOption) with
| None -> ()
| Some n ->
// warnon 62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus
if n = 62 then
tcConfigB.mlCompatibility <- false

tcConfigB.diagnosticsOptions <-
{ tcConfigB.diagnosticsOptions with
WarnOn = ListSet.insert (=) n tcConfigB.diagnosticsOptions.WarnOn
Expand Down Expand Up @@ -1284,7 +1267,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
member _.implicitlyReferenceDotNetAssemblies = data.implicitlyReferenceDotNetAssemblies
member _.implicitlyResolveAssemblies = data.implicitlyResolveAssemblies
member _.resolutionEnvironment = data.resolutionEnvironment
member _.indentationAwareSyntax = data.indentationAwareSyntax
member _.conditionalDefines = data.conditionalDefines
member _.loadedSources = data.loadedSources
member _.compilerToolPaths = data.compilerToolPaths
Expand All @@ -1298,7 +1280,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
member _.clearResultsCache = data.clearResultsCache
member _.embedResources = data.embedResources
member _.diagnosticsOptions = data.diagnosticsOptions
member _.mlCompatibility = data.mlCompatibility
member _.checkNullness = data.checkNullness
member _.checkOverflow = data.checkOverflow
member _.showReferenceResolutions = data.showReferenceResolutions
Expand Down Expand Up @@ -1429,17 +1410,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
// This call can fail if no CLR is found (this is the path to mscorlib)
member _.GetTargetFrameworkDirectories() = targetFrameworkDirectories

member tcConfig.ComputeIndentationAwareSyntaxInitialStatus fileName =
use _unwindBuildPhase = UseBuildPhase BuildPhase.Parameter

let indentationAwareSyntaxOnByDefault =
List.exists (FileSystemUtils.checkSuffix fileName) FSharpIndentationAwareSyntaxFileSuffixes

if indentationAwareSyntaxOnByDefault then
(tcConfig.indentationAwareSyntax <> Some false)
else
(tcConfig.indentationAwareSyntax = Some true)

member tcConfig.GetAvailableLoadedSources() =
use _unwindBuildPhase = UseBuildPhase BuildPhase.Parameter

Expand Down
17 changes: 0 additions & 17 deletions src/Compiler/Driver/CompilerConfig.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ type TcConfigBuilder =

mutable implicitlyResolveAssemblies: bool

/// Set if the user has explicitly turned indentation-aware syntax on/off
mutable indentationAwareSyntax: bool option

mutable conditionalDefines: string list

/// Sources added into the build with #load
Expand Down Expand Up @@ -288,8 +285,6 @@ type TcConfigBuilder =

mutable diagnosticsOptions: FSharpDiagnosticOptions

mutable mlCompatibility: bool

mutable checkNullness: bool

mutable checkOverflow: bool
Expand Down Expand Up @@ -607,9 +602,6 @@ type TcConfig =

member implicitlyResolveAssemblies: bool

/// Set if the user has explicitly turned indentation-aware syntax on/off
member indentationAwareSyntax: bool option

member conditionalDefines: string list

member subsystemVersion: int * int
Expand All @@ -630,8 +622,6 @@ type TcConfig =

member diagnosticsOptions: FSharpDiagnosticOptions

member mlCompatibility: bool

member checkNullness: bool

member checkOverflow: bool
Expand Down Expand Up @@ -822,8 +812,6 @@ type TcConfig =

member strictIndentation: bool option

member ComputeIndentationAwareSyntaxInitialStatus: string -> bool

member GetTargetFrameworkDirectories: unit -> string list

/// Get the loaded sources that exist and issue a warning for the ones that don't
Expand Down Expand Up @@ -953,10 +941,5 @@ val FSharpImplFileSuffixes: string list
/// Script file suffixes
val FSharpScriptFileSuffixes: string list

/// File suffixes where #light is the default
val FSharpIndentationAwareSyntaxFileSuffixes: string list

val FSharpMLCompatFileSuffixes: string list

/// Indicates whether experimental features should be enabled automatically
val FSharpExperimentalFeaturesEnabledAutomatically: bool
1 change: 0 additions & 1 deletion src/Compiler/Driver/CompilerDiagnostics.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,6 @@ type Exception with
| Parser.TOKEN_HIGH_PRECEDENCE_BRACK_APP -> SR.GetString("Parser.TOKEN.HIGH.PRECEDENCE.BRACK.APP")
| Parser.TOKEN_BEGIN -> SR.GetString("Parser.TOKEN.BEGIN")
| Parser.TOKEN_END -> SR.GetString("Parser.TOKEN.END")
| Parser.TOKEN_HASH_LIGHT
| Parser.TOKEN_HASH_LINE
| Parser.TOKEN_HASH_IF
| Parser.TOKEN_HASH_ELSE
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Driver/CompilerImports.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,6 @@ and [<Sealed>] TcImports
ilGlobals,
fslibCcu,
tcConfig.implicitIncludeDir,
tcConfig.mlCompatibility,
tcConfig.isInteractive,
tcConfig.checkNullness,
tcConfig.useReflectionFreeCodeGen,
Expand Down
46 changes: 2 additions & 44 deletions src/Compiler/Driver/CompilerOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,17 +1129,6 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) =
let defineSymbol tcConfigB s =
tcConfigB.conditionalDefines <- s :: tcConfigB.conditionalDefines

let mlCompatibilityFlag (tcConfigB: TcConfigBuilder) =
CompilerOption(
"mlcompatibility",
tagNone,
OptionUnit(fun () ->
tcConfigB.mlCompatibility <- true
tcConfigB.TurnWarningOff(rangeCmdArgs, "62")),
None,
Some(FSComp.SR.optsMlcompatibility ())
)

let GetLanguageVersions () =
seq {
FSComp.SR.optsSupportedLangVersions ()
Expand Down Expand Up @@ -1192,8 +1181,6 @@ let languageFlags tcConfigB =

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

mlCompatibilityFlag tcConfigB

CompilerOption(
"strict-indentation",
tagNone,
Expand Down Expand Up @@ -1905,39 +1892,10 @@ let gnuStyleErrorsFlag tcConfigB =
None
)

let deprecatedFlagsBoth tcConfigB =
[
CompilerOption(
"light",
tagNone,
OptionUnit(fun () -> tcConfigB.indentationAwareSyntax <- Some true),
Some(DeprecatedCommandLineOptionNoDescription("--light", rangeCmdArgs)),
None
)

CompilerOption(
"indentation-syntax",
tagNone,
OptionUnit(fun () -> tcConfigB.indentationAwareSyntax <- Some true),
Some(DeprecatedCommandLineOptionNoDescription("--indentation-syntax", rangeCmdArgs)),
None
)

CompilerOption(
"no-indentation-syntax",
tagNone,
OptionUnit(fun () -> tcConfigB.indentationAwareSyntax <- Some false),
Some(DeprecatedCommandLineOptionNoDescription("--no-indentation-syntax", rangeCmdArgs)),
None
)
]

let deprecatedFlagsFsi tcConfigB =
[ noFrameworkFlag false tcConfigB; yield! deprecatedFlagsBoth tcConfigB ]
let deprecatedFlagsFsi tcConfigB = [ noFrameworkFlag false tcConfigB ]

let deprecatedFlagsFsc tcConfigB =
deprecatedFlagsBoth tcConfigB
@ [
[
cliRootFlag tcConfigB
CompilerOption(
"jit-optimize",
Expand Down
27 changes: 5 additions & 22 deletions src/Compiler/Driver/ParseAndCheckInputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ open FSharp.Compiler.CompilerDiagnostics
open FSharp.Compiler.CompilerImports
open FSharp.Compiler.Diagnostics
open FSharp.Compiler.DiagnosticsLogger
open FSharp.Compiler.Features
open FSharp.Compiler.IO
open FSharp.Compiler.LexerStore
open FSharp.Compiler.Lexhelp
Expand Down Expand Up @@ -55,9 +54,6 @@ let CanonicalizeFilename fileName =
let IsScript fileName =
FSharpScriptFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName)

let IsMLCompatFile fileName =
FSharpMLCompatFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName)

// Give a unique name to the different kinds of inputs. Used to correlate signature and implementation files
// QualFileNameOfModuleName - files with a single module declaration or an anonymous module
let QualFileNameOfModuleName m fileName modname =
Expand Down Expand Up @@ -123,7 +119,7 @@ let ComputeAnonModuleName check defaultNamespace fileName (m: range) =
pathToSynLid anonymousModuleNameRange (splitNamespace combined)

let FileRequiresModuleOrNamespaceDecl isLast isExe fileName =
not (isLast && isExe) && not (IsScript fileName || IsMLCompatFile fileName)
not (isLast && isExe) && not (IsScript fileName)

let PostParseModuleImpl (_i, defaultNamespace, isLastCompiland, fileName, impl) =
match impl with
Expand Down Expand Up @@ -461,23 +457,15 @@ let ParseInput
else
lexer

if FSharpMLCompatFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then
if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then
errorR (Error(FSComp.SR.buildInvalidSourceFileExtensionML fileName, rangeStartup))
else
mlCompatWarning (FSComp.SR.buildCompilingExtensionIsForML ()) rangeStartup

// Call the appropriate parser - for signature files or implementation files
if FSharpImplFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then
let impl = implementationFile lexer lexbuf
PostParseModuleImpls(defaultNamespace, fileName, isLastCompiland, impl, lexbuf, diagnosticOptions, Set identStore)
elif FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then
let intfs = signatureFile lexer lexbuf
PostParseModuleSpecs(defaultNamespace, fileName, isLastCompiland, intfs, lexbuf, diagnosticOptions, Set identStore)
else if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then
error (Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated fileName, rangeStartup))
else
error (Error(FSComp.SR.buildInvalidSourceFileExtension fileName, rangeStartup))
error (Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated fileName, rangeStartup))
finally
// OK, now commit the errors, since the ScopedPragmas will (hopefully) have been scraped
let filteringDiagnosticsLogger =
Expand Down Expand Up @@ -569,15 +557,10 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam
// Don't report whitespace from lexer
let skipWhitespaceTokens = true

// Set up the initial status for indentation-aware processing
let indentationSyntaxStatus =
IndentationAwareSyntaxStatus(tcConfig.ComputeIndentationAwareSyntaxInitialStatus fileName, true)

// Set up the initial lexer arguments
let lexargs =
mkLexargs (
tcConfig.conditionalDefines,
indentationSyntaxStatus,
lexResourceManager,
[],
diagnosticsLogger,
Expand All @@ -595,7 +578,6 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam
| TokenizeOption.Only ->
LexFilter
.LexFilter(
indentationSyntaxStatus,
tcConfig.compilingFSharpCore,
Lexer.token lexargs skipWhitespaceTokens,
lexbuf,
Expand All @@ -606,7 +588,6 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam
| _ ->
LexFilter
.LexFilter(
indentationSyntaxStatus,
tcConfig.compilingFSharpCore,
Lexer.token lexargs skipWhitespaceTokens,
lexbuf,
Expand Down Expand Up @@ -656,7 +637,9 @@ let checkInputFile (tcConfig: TcConfig) fileName =
if not (FileSystem.FileExistsShim fileName) then
error (Error(FSComp.SR.buildCouldNotFindSourceFile fileName, rangeStartup))
else
error (Error(FSComp.SR.buildInvalidSourceFileExtension (SanitizeFileName fileName tcConfig.implicitIncludeDir), rangeStartup))
error (
Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated (SanitizeFileName fileName tcConfig.implicitIncludeDir), rangeStartup)
)

let parseInputStreamAux
(tcConfig: TcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, retryLocked, stream: Stream)
Expand Down
Loading
Loading