Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb6cb5c

Browse files
authored
Merge pull requestfsharp#852 from dsyme/i16
integrate visualfsharp master
2 parents3ef0544 +8a7e2c1 commitcb6cb5c

File tree

43 files changed

+283
-265
lines changed

Some content is hidden

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

43 files changed

+283
-265
lines changed

‎build/targets/PackageVersions.props‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<!-- System.* packages-->
99
<SystemCollectionsImmutablePackageVersion>1.3.1</SystemCollectionsImmutablePackageVersion>
10+
<SystemRuntimeCachingPackageVersion>1.5.0</SystemRuntimeCachingPackageVersion>
1011

1112
<!-- Roslyn packages-->
1213
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>$(RoslynPackageVersion)</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>

‎src/FSharpSource.Settings.targets‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@
9999
<IntermediateOutputPathCondition="'$(PortableProfileBeingReferenced)' != ''">obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\</IntermediateOutputPath>
100100

101101
<!-- Frozen FSharp.Core package being built with this build-->
102-
<FSharpCore41TargetPackageVersion>4.1.19</FSharpCore41TargetPackageVersion>
103-
<FSharpCore41TargetMajorVersion>4.1</FSharpCore41TargetMajorVersion>
104-
<FSharpCoreLatestTargetPackageVersion>4.3.5</FSharpCoreLatestTargetPackageVersion>
105-
<FSharpCoreLatestTargetMajorVersion>4.3</FSharpCoreLatestTargetMajorVersion>
102+
<FSharpCoreTargetPackageVersion>4.3.5</FSharpCoreTargetPackageVersion>
103+
<FSharpCoreTargetMajorVersion>4.3</FSharpCoreTargetMajorVersion>
106104

107105
<!-- Always qualify the IntermediateOutputPath by the TargetDotnetProfile if any exists-->
108106
<IntermediateOutputPath>obj\$(Configuration)\$(TargetDotnetProfile)\</IntermediateOutputPath>

‎src/absil/il.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ type AssemblyRefData =
356356
letAssemblyRefUniqueStampGenerator=new UniqueStampGenerator<AssemblyRefData>()
357357

358358
letisMscorlib data=
359-
if System.String.Compare(data.assemRefName,"mscorlib")=0thentrue
360-
elsefalse
359+
data.assemRefName="mscorlib"
361360

362361
[<Sealed>]
363362
typeILAssemblyRef(data)=

‎src/absil/illib.fs‎

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -279,30 +279,11 @@ module List =
279279
|[]-> None
280280
| h::t->if f hthen Some(h,n)else findi(n+1) f t
281281

282-
letchop n l=
283-
if n= List.length lthen(l,[])else// avoids allocation unless necessary
284-
let recloop n l acc=
285-
if n<=0then(List.rev acc,l)else
286-
match lwith
287-
|[]-> failwith"List.chop: overchop"
288-
|(h::t)-> loop(n-1) t(h::acc)
289-
loop n l[]
290-
291-
lettake n l=
292-
if n= List.length lthen lelse
293-
let recloop acc n l=
294-
match lwith
295-
|[]-> List.rev acc
296-
| x::xs->if n<=0then List.rev accelse loop(x::acc)(n-1) xs
297-
298-
loop[] n l
299-
300282
let recdrop n l=
301283
match lwith
302284
|[]->[]
303285
|_::xs->if n=0then lelse drop(n-1) xs
304286

305-
306287
letsplitChoose select l=
307288
let recch acc1 acc2 l=
308289
match lwith
@@ -464,6 +445,13 @@ module ValueOption =
464445
let inlineofOption x=match xwith Some x-> ValueSome x| None-> ValueNone
465446
let inlinebind f x=match xwith ValueSome x-> f x| ValueNone-> ValueNone
466447

448+
typeStringwith
449+
member inlinex.StartsWithOrdinal(value)=
450+
x.StartsWith(value, StringComparison.Ordinal)
451+
452+
member inlinex.EndsWithOrdinal(value)=
453+
x.EndsWith(value, StringComparison.Ordinal)
454+
467455
moduleString=
468456
letindexNotFound()= raise(new KeyNotFoundException("An index for the character was not found in the string"))
469457

@@ -543,7 +531,7 @@ module String =
543531
let(|StartsWith|_|)pattern value=
544532
if String.IsNullOrWhiteSpace valuethen
545533
None
546-
elif value.StartsWithpatternthen
534+
elif value.StartsWithOrdinal(pattern)then
547535
Some()
548536
else None
549537

@@ -561,7 +549,7 @@ module String =
561549
whilenot(isNull!line)do
562550
yield!line
563551
line:= reader.ReadLine()
564-
if str.EndsWith("\n")then
552+
if str.EndsWithOrdinal("\n")then
565553
// last trailing space not returned
566554
// http://stackoverflow.com/questions/19365404/stringreader-omits-trailing-linebreak
567555
yield String.Empty

‎src/absil/ilreflect.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ let rec emitInstr cenv (modB : ModuleBuilder) emEnv (ilG:ILGenerator) instr =
12961296
ignore src
12971297
()
12981298
#else
1299-
if cenv.generatePdb&&not(src.Document.File.EndsWith("stdin", StringComparison.Ordinal))then
1299+
if cenv.generatePdb&&not(src.Document.File.EndsWithOrdinal("stdin"))then
13001300
letguid x=match xwith None-> Guid.Empty| Some g-> Guid(g:byte[])in
13011301
letsymDoc= modB.DefineDocumentAndLog(src.Document.File, guid src.Document.Language, guid src.Document.Vendor, guid src.Document.DocumentType)
13021302
ilG.MarkSequencePointAndLog(symDoc, src.Line, src.Column, src.EndLine, src.EndColumn)

‎src/fsharp/CompileOps.fs‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) =
695695
| ContextInfo.TupleInRecordFields->
696696
os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs)|> ignore
697697
os.Append(System.Environment.NewLine+ FSComp.SR.commaInsteadOfSemicolonInRecord())|> ignore
698-
|_when t2="bool"&& t1.EndsWith" ref"->
698+
|_when t2="bool"&& t1.EndsWithOrdinal(" ref")->
699699
os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs)|> ignore
700700
os.Append(System.Environment.NewLine+ FSComp.SR.derefInsteadOfNot())|> ignore
701701
|_-> os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs)|> ignore
@@ -1604,7 +1604,7 @@ let SanitizeFileName fileName implicitIncludeDir =
16041604
letcurrentDir= implicitIncludeDir
16051605

16061606
// if the file name is not rooted in the current directory, return the full path
1607-
ifnot(fullPath.StartsWith(currentDir))then
1607+
ifnot(fullPath.StartsWithOrdinal(currentDir))then
16081608
fullPath
16091609
// if the file name is rooted in the current directory, return the relative path
16101610
else
@@ -1796,7 +1796,7 @@ type private TypeInThisAssembly = class end
17961796
letGetDefaultSystemValueTupleReference()=
17971797
try
17981798
//let asm = typeof<System.ValueTuple<int, int>>.Assembly
1799-
//if asm.FullName.StartsWith"System.ValueTuple" then
1799+
//if asm.FullName.StartsWithOrdinal("System.ValueTuple") then
18001800
// Some asm.Location
18011801
//else
18021802
letlocation= Path.GetDirectoryName(typeof<TypeInThisAssembly>.Assembly.Location)
@@ -2025,7 +2025,7 @@ let GetWarningNumber(m, s:string) =
20252025
// therefore if we have warning id that starts with a numeric digit we convert it to Some (int32)
20262026
// anything else is ignored None
20272027
if Char.IsDigit(s.[0])then Some(int32 s)
2028-
elif s.StartsWith("FS", StringComparison.Ordinal)=truethen raise(new ArgumentException())
2028+
elif s.StartsWithOrdinal("FS")=truethen raise(new ArgumentException())
20292029
else None
20302030
with err->
20312031
warning(Error(FSComp.SR.buildInvalidWarningNumber(s), m))
@@ -3748,28 +3748,29 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list,
37483748
//--------------------------------------------------------------------------
37493749

37503750
letIsSignatureDataResource(r:ILResource)=
3751-
r.Name.StartsWithFSharpSignatureDataResourceName||
3752-
r.Name.StartsWithFSharpSignatureDataResourceName2
3751+
r.Name.StartsWithOrdinal(FSharpSignatureDataResourceName)||
3752+
r.Name.StartsWithOrdinal(FSharpSignatureDataResourceName2)
37533753

37543754
letIsOptimizationDataResource(r:ILResource)=
3755-
r.Name.StartsWithFSharpOptimizationDataResourceName||
3756-
r.Name.StartsWithFSharpOptimizationDataResourceName2
3755+
r.Name.StartsWithOrdinal(FSharpOptimizationDataResourceName)||
3756+
r.Name.StartsWithOrdinal(FSharpOptimizationDataResourceName2)
37573757

37583758
letGetSignatureDataResourceName(r:ILResource)=
3759-
if r.Name.StartsWithFSharpSignatureDataResourceNamethen
3759+
if r.Name.StartsWithOrdinal(FSharpSignatureDataResourceName)then
37603760
String.dropPrefix r.Name FSharpSignatureDataResourceName
3761-
elif r.Name.StartsWithFSharpSignatureDataResourceName2then
3761+
elif r.Name.StartsWithOrdinal(FSharpSignatureDataResourceName2)then
37623762
String.dropPrefix r.Name FSharpSignatureDataResourceName2
37633763
else failwith"GetSignatureDataResourceName"
37643764

37653765
letGetOptimizationDataResourceName(r:ILResource)=
3766-
if r.Name.StartsWithFSharpOptimizationDataResourceNamethen
3766+
if r.Name.StartsWithOrdinal(FSharpOptimizationDataResourceName)then
37673767
String.dropPrefix r.Name FSharpOptimizationDataResourceName
3768-
elif r.Name.StartsWithFSharpOptimizationDataResourceName2then
3768+
elif r.Name.StartsWithOrdinal(FSharpOptimizationDataResourceName2)then
37693769
String.dropPrefix r.Name FSharpOptimizationDataResourceName2
37703770
else failwith"GetOptimizationDataResourceName"
37713771

3772-
letIsReflectedDefinitionsResource(r:ILResource)= r.Name.StartsWith QuotationPickler.SerializedReflectedDefinitionsResourceNameBase
3772+
letIsReflectedDefinitionsResource(r:ILResource)=
3773+
r.Name.StartsWithOrdinal(QuotationPickler.SerializedReflectedDefinitionsResourceNameBase)
37733774

37743775
letMakeILResource rname bytes=
37753776
{ Name= rname

‎src/fsharp/CompileOptions.fs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module ResponseFile =
188188
letparseLine(l:string)=
189189
match lwith
190190
| swhen String.IsNullOrWhiteSpace(s)-> None
191-
| swhen l.StartsWith("#")-> Some(ResponseFileLine.Comment(s.TrimStart('#')))
191+
| swhen l.StartsWithOrdinal("#")-> Some(ResponseFileLine.Comment(s.TrimStart('#')))
192192
| s-> Some(ResponseFileLine.CompilerOptionSpec(s.Trim()))
193193

194194
try
@@ -224,7 +224,7 @@ let ParseCompilerOptions (collectOtherArgument : string -> unit, blocks: Compile
224224
if opt.Length=2|| isSlashOpt optthen
225225
opt<- opt.[1..]
226226
// else, it should be a non-abbreviated option starting with "--"
227-
elif opt.Length>3&& opt.StartsWith("--")then
227+
elif opt.Length>3&& opt.StartsWithOrdinal("--")then
228228
opt<- opt.[2..]
229229
else
230230
opt<-""
@@ -247,19 +247,19 @@ let ParseCompilerOptions (collectOtherArgument : string -> unit, blocks: Compile
247247

248248
letgetSwitchOpt(opt:string)=
249249
// if opt is a switch, strip the '+' or '-'
250-
if opt<>"--"&& opt.Length>1&&(opt.EndsWith("+",StringComparison.Ordinal)|| opt.EndsWith("-",StringComparison.Ordinal))then
250+
if opt<>"--"&& opt.Length>1&&(opt.EndsWithOrdinal("+")|| opt.EndsWithOrdinal("-"))then
251251
opt.[0.. opt.Length-2]
252252
else
253253
opt
254254

255255
letgetSwitch(s:string)=
256256
lets=(s.Split([|':'|])).[0]
257-
if s<>"--"&& s.EndsWith("-",StringComparison.Ordinal)then OptionSwitch.Offelse OptionSwitch.On
257+
if s<>"--"&& s.EndsWithOrdinal("-")then OptionSwitch.Offelse OptionSwitch.On
258258

259259
let recprocessArg args=
260260
match argswith
261261
|[]->()
262-
|((rsp: string):: t)when rsp.StartsWith("@")->
262+
|((rsp: string):: t)when rsp.StartsWithOrdinal("@")->
263263
letresponseFileOptions=
264264
letfullpath=
265265
try
@@ -555,7 +555,7 @@ let inputFileFlagsFsc tcConfigB = inputFileFlagsBoth tcConfigB
555555
//---------------------------------
556556

557557
leterrorsAndWarningsFlags(tcConfigB:TcConfigBuilder)=
558-
lettrimFS(s:string)=if s.StartsWith("FS", StringComparison.Ordinal)=truethen s.Substring(2)else s
558+
lettrimFS(s:string)=if s.StartsWithOrdinal("FS")=truethen s.Substring(2)else s
559559
lettrimFStoInt(s:string)=
560560
try
561561
Some(int32(trimFS s))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp