Skip to content
Open
Show file tree
Hide file tree
Changes from 18 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
10 changes: 3 additions & 7 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3789,14 +3789,12 @@ let buildApp (cenv: cenv) expr resultTy arg m =

// Special rule for building applications of the 'x && y' operator
| ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [x0], _)), _
when valRefEq g vref g.and_vref
|| valRefEq g vref g.and2_vref ->
when valRefEq g vref g.and2_vref ->
MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg), resultTy

// Special rule for building applications of the 'x || y' operator
| ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [x0], _)), _
when valRefEq g vref g.or_vref
|| valRefEq g vref g.or2_vref ->
when valRefEq g vref g.or2_vref ->
MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ), resultTy

// Special rule for building applications of the 'reraise' operator
Expand Down Expand Up @@ -8608,9 +8606,7 @@ and TcApplicationThen (cenv: cenv) (overallTy: OverallTy) env tpenv mExprAndArg
match leftExpr with
| ApplicableExpr(expr=Expr.Val (vref, _, _))
| ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [_], _))
when valRefEq g vref g.and_vref
|| valRefEq g vref g.and2_vref
|| valRefEq g vref g.or_vref
when valRefEq g vref g.and2_vref
|| valRefEq g vref g.or2_vref -> { env with eIsControlFlow = true }
| _ -> env

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
56 changes: 2 additions & 54 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 @@ -1887,15 +1874,6 @@ let compilingFsLibNoBigIntFlag =
None
)

let mlKeywordsFlag =
CompilerOption(
"ml-keywords",
tagNone,
OptionUnit(fun () -> ()),
Some(DeprecatedCommandLineOptionNoDescription("--ml-keywords", rangeCmdArgs)),
None
)

let gnuStyleErrorsFlag tcConfigB =
CompilerOption(
"gnu-style-errors",
Expand All @@ -1905,39 +1883,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 Expand Up @@ -2124,7 +2073,6 @@ let deprecatedFlagsFsc tcConfigB =
None
)

mlKeywordsFlag
gnuStyleErrorsFlag tcConfigB
]

Expand Down
Loading
Loading