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

Commitb589922

Browse files
committed
Rollback cleanup. (changeset 1289633)
1 parentee4e7cb commitb589922

File tree

6 files changed

+927
-1541
lines changed

6 files changed

+927
-1541
lines changed

‎src/fsharp/ast.fs‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,17 +2097,14 @@ let rhs2 (parseState: IParseState) i j =
20972097
letrhs parseState i= rhs2 parseState i i
20982098

20992099
typeIParseStatewith
2100-
2101-
/// Get the generator used for compiler-generated argument names.
2102-
memberx.SynArgNameGenerator=
2100+
memberx.GetSynArgNameGenerator()=
21032101
letkey="SynArgNameGenerator"
21042102
letbls= x.LexBuffer.BufferLocalStore
21052103
ifnot(bls.ContainsKey key)then
21062104
bls.[key]<- box(SynArgNameGenerator())
21072105
bls.[key]:?> SynArgNameGenerator
21082106

2109-
/// Reset the generator used for compiler-generated argument names.
2110-
memberx.ResetSynArgNameGenerator()= x.SynArgNameGenerator.Reset()
2107+
memberx.ResetSynArgNameGenerator()= x.GetSynArgNameGenerator().Reset()
21112108

21122109

21132110
/// XmlDoc F# lexer/parser state, held in the BufferLocalStore for the lexer.

‎src/fsharp/build.fs‎

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ let OutputPhasedErrorR (os:System.Text.StringBuilder) (err:PhasedError) =
10011001
| Parser.NONTERM_implementationFile|Parser.NONTERM_fileNamespaceImpl|Parser.NONTERM_fileNamespaceImpls-> Some()
10021002
|_-> None
10031003
let(|NONTERM_Category_Definition|_|)=function
1004-
| Parser.NONTERM_fileModuleImpl|Parser.NONTERM_moduleDefn|Parser.NONTERM_interactiveDefns
1004+
| Parser.NONTERM_fileModuleImpl|Parser.NONTERM_moduleDefn|Parser.NONTERM_interactiveModuleDefns
10051005
|Parser.NONTERM_moduleDefns|Parser.NONTERM_moduleDefnsOrExpr-> Some()
10061006
|_-> None
10071007

@@ -3767,25 +3767,19 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
37673767
tcGlobals<- Some g
37683768

37693769
#if EXTENSIONTYPING
3770-
memberprivatetcImports.InjectProvidedNamespaceOrTypeIntoEntity
3771-
(typeProviderEnvironment,
3772-
tcConfig:TcConfig,
3773-
m,entity:Entity,
3774-
injectedNamspace,remainingNamespace,
3775-
provider,
3776-
st:Tainted<ProvidedType>option)=
3770+
memberprivatetcImports.InjectProvidedNamespaceOrTypeIntoEntity typeProviderEnvironment(tcConfig:TcConfig)m(entity:Entity)(injectedNamspace,remainingNamespace)provider(st:Tainted<ProvidedType>option)=
37773771
match remainingNamespacewith
37783772
| next::rest->
37793773
// Inject the namespace entity
37803774
match entity.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(next)with
37813775
| Some childEntity->
3782-
tcImports.InjectProvidedNamespaceOrTypeIntoEntity(typeProviderEnvironment, tcConfig, m, childEntity,next::injectedNamspace,rest, provider, st)
3776+
tcImports.InjectProvidedNamespaceOrTypeIntoEntity typeProviderEnvironment tcConfig m childEntity(next::injectedNamspace,rest) provider st
37833777
| None->
37843778
// Build up the artificial namespace if there is not a real one.
37853779
letcpath= CompPath(ILScopeRef.Local, injectedNamspace|> List.rev|> List.map(fun n->(n,ModuleOrNamespaceKind.Namespace)))
37863780
letnewNamespace= NewModuleOrNamespace(Some cpath) taccessPublic(ident(next,rangeStartup)) XmlDoc.Empty[](notlazy(NewEmptyModuleOrNamespaceType Namespace))
37873781
entity.ModuleOrNamespaceType.AddModuleOrNamespaceByMutation(newNamespace)
3788-
tcImports.InjectProvidedNamespaceOrTypeIntoEntity(typeProviderEnvironment, tcConfig, m, newNamespace,next::injectedNamspace,rest, provider, st)
3782+
tcImports.InjectProvidedNamespaceOrTypeIntoEntity typeProviderEnvironment tcConfig m newNamespace(next::injectedNamspace,rest) provider st
37893783
|[]->
37903784
match stwith
37913785
| Some st->
@@ -3814,46 +3808,46 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
38143808

38153809
|_-> failwith"Unexpected representation in namespace entity referred to by a type provider"
38163810

3817-
membertcImports.ImportTypeProviderExtensions
3818-
(tpApprovals:ApprovalIO.TypeProviderApprovalStatus list,
3819-
displayPSTypeProviderSecurityDialogBlockingUI,
3820-
tcConfig:TcConfig,
3821-
fileNameOfRuntimeAssembly,
3822-
ilScopeRefOfRuntimeAssembly,
3823-
runtimeAssemblyAttributes:ILAttribute list,
3824-
entityToInjectInto,invalidateCcu:Event<_>,m)=
3825-
3826-
letstartingErrorCount= CompileThreadStatic.ErrorLogger.ErrorCount
3811+
membertcImports.ImportTypeProviderExtensions(tpApprovalsRef:ApprovalIO.TypeProviderApprovalStatus list ref,
3812+
displayPSTypeProviderSecurityDialogBlockingUI,
3813+
tcConfig:TcConfig,
3814+
fileNameOfRuntimeAssembly,
3815+
ilScopeRefOfRuntimeAssembly,
3816+
moduleAttributes:ILAttribute list,
3817+
mspec,
3818+
invalidateCcu:Event<_>,
3819+
m)=
3820+
3821+
lettypeProviderEnvironment:ExtensionTyping.ResolutionEnvironment=
3822+
{ resolutionFolder= tcConfig.implicitIncludeDir
3823+
outputFile= tcConfig.outputFile
3824+
showResolutionMessages= tcConfig.showExtensionTypeMessages
3825+
referencedAssemblies=[|for rin resolutions.GetAssemblyResolutions()-> r.resolvedPath|]
3826+
temporaryFolder= Path.GetTempPath()
3827+
}
38273828

38283829
// Find assembly level TypeProviderAssemblyAttributes. These will point to the assemblies that
38293830
// have class which implement ITypeProvider and which have TypeProviderAttribute on them.
3831+
letstartingErrorCount= CompileThreadStatic.ErrorLogger.ErrorCount
38303832
letproviderAssemblies=
3831-
runtimeAssemblyAttributes
3833+
moduleAttributes
38323834
|> List.choose(TryDecodeTypeProviderAssemblyAttr(defaultArg ilGlobalsOpt EcmaILGlobals))
38333835
// If no design-time assembly is specified, use the runtime assembly
38343836
|> List.map(functionnull-> Path.GetFileNameWithoutExtension fileNameOfRuntimeAssembly| s-> s)
38353837
|> Set.ofList
38363838

38373839
if providerAssemblies.Count>0then
38383840

3839-
// Find the SystemRuntimeAssemblyVersion value to report in the TypeProviderConfig.
3840-
letsystemRuntimeAssemblyVersion=
3841+
letsystemRuntimeAssemblyVersion:System.Version=
38413842
letprimaryAssemblyRef= tcConfig.PrimaryAssemblyDllReference()
38423843
letresolution= tcConfig.ResolveLibWithDirectories CcuLoadFailureAction.RaiseError primaryAssemblyRef|> Option.get
38433844
// MSDN: this method causes the file to be opened and closed, but the assembly is not added to this domain
38443845
letname= System.Reflection.AssemblyName.GetAssemblyName(resolution.resolvedPath)
38453846
name.Version
38463847

3847-
lettypeProviderEnvironment=
3848-
{ resolutionFolder= tcConfig.implicitIncludeDir
3849-
outputFile= tcConfig.outputFile
3850-
showResolutionMessages= tcConfig.showExtensionTypeMessages
3851-
referencedAssemblies=[|for rin resolutions.GetAssemblyResolutions()-> r.resolvedPath|]
3852-
temporaryFolder= Path.GetTempPath()}
3853-
38543848
letproviders=
38553849
[for assemblyNamein providerAssembliesdo
3856-
yield ExtensionTyping.GetTypeProvidersOfAssembly(displayPSTypeProviderSecurityDialogBlockingUI, tcConfig.validateTypeProviders,tpApprovals,
3850+
yield ExtensionTyping.GetTypeProvidersOfAssembly(displayPSTypeProviderSecurityDialogBlockingUI, tcConfig.validateTypeProviders,tpApprovalsRef,
38573851
fileNameOfRuntimeAssembly, ilScopeRefOfRuntimeAssembly, assemblyName, typeProviderEnvironment,
38583852
tcConfig.isInvalidationSupported, tcConfig.isInteractive, tcImports.SystemRuntimeContainsType, systemRuntimeAssemblyVersion, m)]
38593853
letwasApproved= providers|> List.forall(fun(ok,_)-> ok)
@@ -3887,8 +3881,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
38873881
// Inject an entity for the namespace, or if one already exists, then record this as a provider
38883882
// for that namespace.
38893883
let recloop(providedNamespace:Tainted<IProvidedNamespace>)=
3890-
letpath= ExtensionTyping.GetProvidedNamespaceAsPath(m,provider,providedNamespace.PUntaint((fun r-> r.NamespaceName), m))
3891-
tcImports.InjectProvidedNamespaceOrTypeIntoEntity(typeProviderEnvironment, tcConfig, m, entityToInjectInto,[],path, provider, None)
3884+
letpath= ExtensionTyping.GetPartsOfDotNetNamespace(m,provider,providedNamespace.PUntaint((fun r-> r.NamespaceName), m))
3885+
tcImports.InjectProvidedNamespaceOrTypeIntoEntitytypeProviderEnvironment tcConfig m mspec([],path) provider None
38923886

38933887
// Inject entities for the types returned by provider.GetTypes().
38943888
//
@@ -3898,7 +3892,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
38983892
lettys= providedNamespace.PApplyArray((fun provider-> provider.GetTypes()),"GetTypes", m)
38993893
letptys=[|for tyin tys-> ty.PApply((fun ty-> ty|> ProvidedType.CreateNoContext), m)|]
39003894
for stin ptysdo
3901-
tcImports.InjectProvidedNamespaceOrTypeIntoEntity(typeProviderEnvironment, tcConfig, m, entityToInjectInto,[],path, provider,Some st)
3895+
tcImports.InjectProvidedNamespaceOrTypeIntoEntity typeProviderEnvironment tcConfig m mspec([],path) provider(Some st)
39023896

39033897
for providedNestedNamespacein providedNamespace.PApplyArray((fun provider-> provider.GetNestedNamespaces()),"GetNestedNamespaces", m)do
39043898
loop providedNestedNamespace
@@ -3929,7 +3923,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
39293923
// Compact Framework binaries must use this. However it is not
39303924
// clear when else it is required, e.g. for Mono.
39313925

3932-
membertcImports.PrepareToImportReferencedIlDlltpApprovals m filename displayPSTypeProviderSecurityDialogBlockingUI(dllinfo:ImportedBinary)=
3926+
membertcImports.PrepareToImportReferencedIlDlltpApprovalsRef m filename displayPSTypeProviderSecurityDialogBlockingUI(dllinfo:ImportedBinary)=
39333927
CheckDisposed()
39343928
lettcConfig= tcConfigP.Get()
39353929
tcConfig.CheckFSharpBinary(filename,dllinfo.ILAssemblyRefs,m)
@@ -3961,12 +3955,12 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
39613955
tcImports.RegisterCcu(ccuinfo);
39623956
letphase2()=
39633957
#if EXTENSIONTYPING
3964-
ccuinfo.TypeProviders<- tcImports.ImportTypeProviderExtensions(tpApprovals, displayPSTypeProviderSecurityDialogBlockingUI, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
3958+
ccuinfo.TypeProviders<- tcImports.ImportTypeProviderExtensions(tpApprovalsRef, displayPSTypeProviderSecurityDialogBlockingUI, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
39653959
#endif
39663960
[ResolvedImportedAssembly(ccuinfo)]
39673961
phase2
39683962

3969-
membertcImports.PrepareToImportReferencedFSharpDlltpApprovals m filename displayPSTypeProviderSecurityDialogBlockingUI(dllinfo:ImportedBinary)=
3963+
membertcImports.PrepareToImportReferencedFSharpDlltpApprovalsRef m filename displayPSTypeProviderSecurityDialogBlockingUI(dllinfo:ImportedBinary)=
39703964
CheckDisposed()
39713965
lettcConfig= tcConfigP.Get()
39723966
tcConfig.CheckFSharpBinary(filename,dllinfo.ILAssemblyRefs,m)
@@ -4086,7 +4080,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40864080
ILScopeRef= ilScopeRef}
40874081
letphase2()=
40884082
#if EXTENSIONTYPING
4089-
ccuinfo.TypeProviders<- tcImports.ImportTypeProviderExtensions(tpApprovals, displayPSTypeProviderSecurityDialogBlockingUI, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
4083+
ccuinfo.TypeProviders<- tcImports.ImportTypeProviderExtensions(tpApprovalsRef, displayPSTypeProviderSecurityDialogBlockingUI, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
40904084
#else
40914085
()
40924086
#endif
@@ -4105,7 +4099,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
41054099
phase2
41064100

41074101

4108-
membertcImports.RegisterAndPrepareToImportReferencedDlltpApprovals displayPSTypeProviderSecurityDialogBlockingUI(r:AssemblyResolution):_*(unit-> AvailableImportedAssembly list)=
4102+
membertcImports.RegisterAndPrepareToImportReferencedDlltpApprovalsRef displayPSTypeProviderSecurityDialogBlockingUI(r:AssemblyResolution):_*(unit-> AvailableImportedAssembly list)=
41094103
CheckDisposed()
41104104
letm= r.originalReference.Range
41114105
letfilename= r.resolvedPath
@@ -4134,28 +4128,28 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
41344128
if(List.exists IsSignatureDataVersionAttr attrs)then
41354129
ifnot(List.exists(IsMatchingSignatureDataVersionAttr ilg(IL.parseILVersion Internal.Utilities.FSharpEnvironment.FSharpBinaryMetadataFormatRevision)) attrs)then
41364130
errorR(Error(FSComp.SR.buildDifferentVersionMustRecompile(filename),m))
4137-
tcImports.PrepareToImportReferencedIlDlltpApprovals m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
4131+
tcImports.PrepareToImportReferencedIlDlltpApprovalsRef m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
41384132
else
41394133
try
4140-
tcImports.PrepareToImportReferencedFSharpDlltpApprovals m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
4134+
tcImports.PrepareToImportReferencedFSharpDlltpApprovalsRef m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
41414135
with e-> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message),m))
41424136
else
4143-
tcImports.PrepareToImportReferencedIlDlltpApprovals m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
4137+
tcImports.PrepareToImportReferencedIlDlltpApprovalsRef m filename displayPSTypeProviderSecurityDialogBlockingUI dllinfo
41444138
dllinfo,phase2
41454139

41464140
membertcImports.RegisterAndImportReferencedAssemblies(displayPSTypeProviderSecurityDialogBlockingUI,nms:AssemblyResolution list)=
41474141
CheckDisposed()
41484142

41494143
#if EXTENSIONTYPING
4150-
lettpApprovals= ExtensionTyping.ApprovalIO.ReadApprovalsFile(None)
4144+
lettpApprovalsRef=ref(ExtensionTyping.ApprovalIO.readApprovalsFile(None))
41514145
#else
4152-
lettpApprovals=[]
4146+
lettpApprovalsRef=ref([])
41534147
#endif
41544148
letdllinfos,phase2s=
41554149
nms|> List.map
41564150
(fun nm->
41574151
try
4158-
tcImports.RegisterAndPrepareToImportReferencedDlltpApprovals displayPSTypeProviderSecurityDialogBlockingUI nm
4152+
tcImports.RegisterAndPrepareToImportReferencedDlltpApprovalsRef displayPSTypeProviderSecurityDialogBlockingUI nm
41594153
with e->
41604154
error(Error(FSComp.SR.buildProblemReadingAssembly(nm.fusionName, e.Message),nm.originalReference.Range)))
41614155
|> List.unzip

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp