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

Commitec46b97

Browse files
authored
Code cleanup: regularize naming of "typ" --> "ty" (#5096)
* typ --> ty* typ --> ty* typ --> ty* comments* comments* Update ConstraintSolver.fs
1 parent4a052ae commitec46b97

Some content is hidden

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

42 files changed

+1700
-1689
lines changed

‎src/absil/il.fs‎

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,33 +2323,33 @@ let mkILMethRef (tref, callconv, nm, gparams, args, rty) =
23232323
mrefArgs=args
23242324
mrefReturn=rty}
23252325

2326-
letmkILMethSpecForMethRefInTy(mref,typ,minst)=
2326+
letmkILMethSpecForMethRefInTy(mref,ty,minst)=
23272327
{ mspecMethodRef=mref
2328-
mspecDeclaringType=typ
2328+
mspecDeclaringType=ty
23292329
mspecMethodInst=minst}
23302330

23312331
letmkILMethSpec(mref,vc,tinst,minst)= mkILMethSpecForMethRefInTy(mref, mkILNamedTy vc mref.DeclaringTypeRef tinst, minst)
23322332

23332333
letmkILMethSpecInTypeRef(tref,vc,cc,nm,args,rty,tinst,minst)=
23342334
mkILMethSpec(mkILMethRef( tref, cc, nm, List.length minst, args, rty), vc, tinst, minst)
23352335

2336-
letmkILMethSpecInTy(typ:ILType,cc,nm,args,rty,minst:ILGenericArgs)=
2337-
mkILMethSpecForMethRefInTy(mkILMethRef(typ.TypeRef, cc, nm, minst.Length, args, rty),typ, minst)
2336+
letmkILMethSpecInTy(ty:ILType,cc,nm,args,rty,minst:ILGenericArgs)=
2337+
mkILMethSpecForMethRefInTy(mkILMethRef(ty.TypeRef, cc, nm, minst.Length, args, rty),ty, minst)
23382338

2339-
letmkILNonGenericMethSpecInTy(typ,cc,nm,args,rty)=
2340-
mkILMethSpecInTy(typ, cc, nm, args, rty,[])
2339+
letmkILNonGenericMethSpecInTy(ty,cc,nm,args,rty)=
2340+
mkILMethSpecInTy(ty, cc, nm, args, rty,[])
23412341

2342-
letmkILInstanceMethSpecInTy(typ:ILType,nm,args,rty,minst)=
2343-
mkILMethSpecInTy(typ, ILCallingConv.Instance, nm, args, rty, minst)
2342+
letmkILInstanceMethSpecInTy(ty:ILType,nm,args,rty,minst)=
2343+
mkILMethSpecInTy(ty, ILCallingConv.Instance, nm, args, rty, minst)
23442344

2345-
letmkILNonGenericInstanceMethSpecInTy(typ:ILType,nm,args,rty)=
2346-
mkILInstanceMethSpecInTy(typ, nm, args, rty,[])
2345+
letmkILNonGenericInstanceMethSpecInTy(ty:ILType,nm,args,rty)=
2346+
mkILInstanceMethSpecInTy(ty, nm, args, rty,[])
23472347

2348-
letmkILStaticMethSpecInTy(typ,nm,args,rty,minst)=
2349-
mkILMethSpecInTy(typ, ILCallingConv.Static, nm, args, rty, minst)
2348+
letmkILStaticMethSpecInTy(ty,nm,args,rty,minst)=
2349+
mkILMethSpecInTy(ty, ILCallingConv.Static, nm, args, rty, minst)
23502350

2351-
letmkILNonGenericStaticMethSpecInTy(typ,nm,args,rty)=
2352-
mkILStaticMethSpecInTy(typ, nm, args, rty,[])
2351+
letmkILNonGenericStaticMethSpecInTy(ty,nm,args,rty)=
2352+
mkILStaticMethSpecInTy(ty, nm, args, rty,[])
23532353

23542354
letmkILCtorMethSpec(tref,args,cinst)=
23552355
mkILMethSpecInTypeRef(tref, AsObject, ILCallingConv.Instance,".ctor", args, ILType.Void, cinst,[])
@@ -2368,8 +2368,8 @@ let mkILFieldRef(tref, nm, ty) = { DeclaringTypeRef=tref; Name=nm; Type=ty}
23682368

23692369
letmkILFieldSpec(tref,ty)={ FieldRef= tref; DeclaringType=ty}
23702370

2371-
letmkILFieldSpecInTy(typ:ILType,nm,fty)=
2372-
mkILFieldSpec(mkILFieldRef(typ.TypeRef, nm, fty),typ)
2371+
letmkILFieldSpecInTy(ty:ILType,nm,fty)=
2372+
mkILFieldSpec(mkILFieldRef(ty.TypeRef, nm, fty),ty)
23732373

23742374

23752375
letandTailness x y=
@@ -2686,22 +2686,22 @@ let rec rescopeILTypeSpec scoref (tspec1:ILTypeSpec) =
26862686
lettinst2= rescopeILTypes scoref tinst1
26872687
ILTypeSpec.Create(tref2, tinst2)
26882688

2689-
andrescopeILType scoreftyp=
2690-
matchtypwith
2689+
andrescopeILType scorefty=
2690+
matchtywith
26912691
| ILType.Ptr t-> ILType.Ptr(rescopeILType scoref t)
26922692
| ILType.FunctionPointer t-> ILType.FunctionPointer(rescopeILCallSig scoref t)
26932693
| ILType.Byref t-> ILType.Byref(rescopeILType scoref t)
26942694
| ILType.Boxed cr1->
26952695
letcr2= rescopeILTypeSpec scoref cr1
2696-
if cr1=== cr2thentypelse
2696+
if cr1=== cr2thentyelse
26972697
mkILBoxedType cr2
26982698
| ILType.Array(s, ety1)->
26992699
letety2= rescopeILType scoref ety1
2700-
if ety1=== ety2thentypelse
2700+
if ety1=== ety2thentyelse
27012701
ILType.Array(s, ety2)
27022702
| ILType.Value cr1->
27032703
letcr2= rescopeILTypeSpec scoref cr1
2704-
if cr1=== cr2thentypelse
2704+
if cr1=== cr2thentyelse
27052705
ILType.Value cr2
27062706
| ILType.Modified(b, tref, ty)-> ILType.Modified(b, rescopeILTypeRef scoref tref, rescopeILType scoref ty)
27072707
| x-> x
@@ -2733,8 +2733,8 @@ let rescopeILFieldRef scoref x =
27332733
let recinstILTypeSpecAux numFree inst(tspec:ILTypeSpec)=
27342734
ILTypeSpec.Create(tspec.TypeRef, instILGenericArgsAux numFree inst tspec.GenericArgs)
27352735

2736-
andinstILTypeAux numFree(inst:ILGenericArgs)typ=
2737-
matchtypwith
2736+
andinstILTypeAux numFree(inst:ILGenericArgs)ty=
2737+
matchtywith
27382738
| ILType.Ptr t-> ILType.Ptr(instILTypeAux numFree inst t)
27392739
| ILType.FunctionPointer t-> ILType.FunctionPointer(instILCallSigAux numFree inst t)
27402740
| ILType.Array(a, t)-> ILType.Array(a, instILTypeAux numFree inst t)
@@ -2744,7 +2744,7 @@ and instILTypeAux numFree (inst:ILGenericArgs) typ =
27442744
| ILType.TypeVar v->
27452745
letv= int v
27462746
lettop= inst.Length
2747-
if v< numFreethentypelse
2747+
if v< numFreethentyelse
27482748
if v- numFree>= topthen
27492749
ILType.TypeVar(uint16(v- top))
27502750
else
@@ -2833,10 +2833,10 @@ let mkILCtor (access, args, impl) =
28332833
// Do-nothing ctor, just pass on to monomorphic superclass
28342834
// --------------------------------------------------------------------
28352835

2836-
letmkCallBaseConstructor(typ,args:ILType list)=
2836+
letmkCallBaseConstructor(ty,args:ILType list)=
28372837
[ mkLdarg0]@
28382838
List.mapi(fun i _-> mkLdarg(uint16(i+1))) args@
2839-
[ mkNormalCall(mkILCtorMethSpecForTy(typ,[]))]
2839+
[ mkNormalCall(mkILCtorMethSpecForTy(ty,[]))]
28402840

28412841
letmkNormalStfld fspec= I_stfld(Aligned, Nonvolatile, fspec)
28422842
letmkNormalStsfld fspec= I_stsfld(Nonvolatile, fspec)
@@ -2889,8 +2889,8 @@ let mkILClassCtor impl =
28892889
// (i.e. overrides by name/signature)
28902890
// --------------------------------------------------------------------
28912891

2892-
letmk_ospec(typ:ILType,callconv,nm,genparams,formal_args,formal_ret)=
2893-
OverridesSpec(mkILMethRef(typ.TypeRef, callconv, nm, genparams, formal_args, formal_ret),typ)
2892+
letmk_ospec(ty:ILType,callconv,nm,genparams,formal_args,formal_ret)=
2893+
OverridesSpec(mkILMethRef(ty.TypeRef, callconv, nm, genparams, formal_args, formal_ret),ty)
28942894

28952895
letmkILGenericVirtualMethod(nm,access,genparams,actual_args,actual_ret,impl)=
28962896
ILMethodDef(name=nm,
@@ -3082,7 +3082,7 @@ let emptyILMethodImpls = mkILMethodImpls []
30823082
// them in fields. preblock is how to call the superclass constructor....
30833083
// --------------------------------------------------------------------
30843084

3085-
letmkILStorageCtorWithParamNames(tag,preblock,typ,extraParams,flds,access)=
3085+
letmkILStorageCtorWithParamNames(tag,preblock,ty,extraParams,flds,access)=
30863086
mkILCtor(access,
30873087
(flds|> List.map(fun(pnm,_,ty)-> mkILParamNamed(pnm, ty)))@ extraParams,
30883088
mkMethodBody
@@ -3091,29 +3091,29 @@ let mkILStorageCtorWithParamNames(tag, preblock, typ, extraParams, flds, access)
30913091
begin
30923092
(match tagwith Some x->[I_seqpoint x]| None->[])@
30933093
preblock@
3094-
List.concat(List.mapi(fun n(_pnm,nm,ty)->
3094+
List.concat(List.mapi(fun n(_pnm,nm,fieldTy)->
30953095
[ mkLdarg0
30963096
mkLdarg(uint16(n+1))
3097-
mkNormalStfld(mkILFieldSpecInTy(typ, nm,ty))
3097+
mkNormalStfld(mkILFieldSpecInTy(ty, nm,fieldTy))
30983098
]) flds)
30993099
end, tag))
31003100

3101-
letmkILSimpleStorageCtorWithParamNames(tag,base_tspec,typ,extraParams,flds,access)=
3101+
letmkILSimpleStorageCtorWithParamNames(tag,baseTySpec,ty,extraParams,flds,access)=
31023102
letpreblock=
3103-
matchbase_tspecwith
3103+
matchbaseTySpecwith
31043104
None->[]
31053105
| Some tspec->
31063106
([ mkLdarg0
31073107
mkNormalCall(mkILCtorMethSpecForTy(mkILBoxedType tspec,[]))])
3108-
mkILStorageCtorWithParamNames(tag, preblock,typ, extraParams, flds, access)
3108+
mkILStorageCtorWithParamNames(tag, preblock,ty, extraParams, flds, access)
31093109

31103110
letaddParamNames flds=
31113111
flds|> List.map(fun(nm,ty)->(nm, nm, ty))
31123112

3113-
letmkILSimpleStorageCtor(tag,base_tspec,typ,extraParams,flds,access)=
3114-
mkILSimpleStorageCtorWithParamNames(tag,base_tspec, typ, extraParams, addParamNames flds, access)
3113+
letmkILSimpleStorageCtor(tag,baseTySpec,ty,extraParams,flds,access)=
3114+
mkILSimpleStorageCtorWithParamNames(tag,baseTySpec, ty, extraParams, addParamNames flds, access)
31153115

3116-
letmkILStorageCtor(tag,preblock,typ,flds,access)= mkILStorageCtorWithParamNames(tag, preblock,typ,[], addParamNames flds, access)
3116+
letmkILStorageCtor(tag,preblock,ty,flds,access)= mkILStorageCtorWithParamNames(tag, preblock,ty,[], addParamNames flds, access)
31173117

31183118

31193119
letmkILGenericClass(nm,access,genparams,extends,impl,methods,fields,nestedTypes,props,events,attrs,init)=
@@ -3237,9 +3237,9 @@ let mkILDelegateMethods (access) (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IA
32373237
one"EndInvoke"[mkILParamNamed("result", iltyp_IAsyncResult)] rty]
32383238

32393239

3240-
letmkCtorMethSpecForDelegate(ilg:ILGlobals)(typ:ILType,useUIntPtr)=
3241-
letscoref=typ.TypeRef.Scope
3242-
mkILInstanceMethSpecInTy(typ,".ctor",[rescopeILType scoref ilg.typ_Object; rescopeILType scoref(if useUIntPtrthen ilg.typ_UIntPtrelse ilg.typ_IntPtr)], ILType.Void, emptyILGenericArgsList)
3240+
letmkCtorMethSpecForDelegate(ilg:ILGlobals)(ty:ILType,useUIntPtr)=
3241+
letscoref=ty.TypeRef.Scope
3242+
mkILInstanceMethSpecInTy(ty,".ctor",[rescopeILType scoref ilg.typ_Object; rescopeILType scoref(if useUIntPtrthen ilg.typ_UIntPtrelse ilg.typ_IntPtr)], ILType.Void, emptyILGenericArgsList)
32433243

32443244
typeILEnumInfo=
32453245
{ enumValues:(string* ILFieldInit) list
@@ -3594,8 +3594,8 @@ let mkPermissionSet (ilg: ILGlobals) (action, attributes: list<(ILTypeRef * (str
35943594
yield! encodeCustomAttrString tref.QualifiedName
35953595
letbytes=
35963596
[|yield! z_unsigned_int props.Length
3597-
for(nm,typ, value)in propsdo
3598-
yield! encodeCustomAttrNamedArg ilg(nm,typ,true, value)|]
3597+
for(nm,ty, value)in propsdo
3598+
yield! encodeCustomAttrNamedArg ilg(nm,ty,true, value)|]
35993599
yield! z_unsigned_int bytes.Length
36003600
yield! bytes|]
36013601

@@ -3898,17 +3898,17 @@ let rec refs_of_typ s x =
38983898
| ILType.Value tr| ILType.Boxed tr-> refs_of_tspec s tr
38993899
| ILType.FunctionPointer mref-> refs_of_callsig s mref
39003900

3901-
andrefs_of_inst s i=refs_of_typs s i
3901+
andrefs_of_inst s i=refs_of_tys s i
39023902
andrefs_of_tspec s(x:ILTypeSpec)= refs_of_tref s x.TypeRef; refs_of_inst s x.GenericArgs
3903-
andrefs_of_callsig s csig=refs_of_typs s csig.ArgTypes; refs_of_typ s csig.ReturnType
3904-
andrefs_of_genparam s x=refs_of_typs s x.Constraints
3903+
andrefs_of_callsig s csig=refs_of_tys s csig.ArgTypes; refs_of_typ s csig.ReturnType
3904+
andrefs_of_genparam s x=refs_of_tys s x.Constraints
39053905
andrefs_of_genparams s b= List.iter(refs_of_genparam s) b
39063906

39073907
andrefs_of_dloc s ts= refs_of_tref s ts
39083908

39093909
andrefs_of_mref s(x:ILMethodRef)=
39103910
refs_of_dloc s x.DeclaringTypeRef
3911-
refs_of_typs s x.mrefArgs
3911+
refs_of_tys s x.mrefArgs
39123912
refs_of_typ s x.mrefReturn
39133913

39143914
andrefs_of_fref s x= refs_of_tref s x.DeclaringTypeRef; refs_of_typ s x.Type
@@ -3922,7 +3922,7 @@ and refs_of_fspec s x =
39223922
refs_of_fref s x.FieldRef
39233923
refs_of_typ s x.DeclaringType
39243924

3925-
andrefs_of_typs s l= List.iter(refs_of_typ s) l
3925+
andrefs_of_tys s l= List.iter(refs_of_typ s) l
39263926

39273927
andrefs_of_token s x=
39283928
match xwith
@@ -3933,7 +3933,7 @@ and refs_of_token s x =
39333933
andrefs_of_custom_attr s x= refs_of_mspec s x.Method
39343934

39353935
andrefs_of_custom_attrs s(cas:ILAttributes)= List.iter(refs_of_custom_attr s) cas.AsList
3936-
andrefs_of_varargs s tyso= Option.iter(refs_of_typs s) tyso
3936+
andrefs_of_varargs s tyso= Option.iter(refs_of_tys s) tyso
39373937
andrefs_of_instr s x=
39383938
match xwith
39393939
| I_call(_, mr, varargs)| I_newobj(mr, varargs)| I_callvirt(_, mr, varargs)->
@@ -4011,7 +4011,7 @@ and refs_of_property_def s (pd: ILPropertyDef) =
40114011
Option.iter(refs_of_mref s) pd.SetMethod
40124012
Option.iter(refs_of_mref s) pd.GetMethod
40134013
refs_of_typ s pd.PropertyType
4014-
refs_of_typs s pd.Args
4014+
refs_of_tys s pd.Args
40154015
refs_of_custom_attrs s pd.CustomAttrs
40164016

40174017
andrefs_of_properties s(x:ILPropertyDefs)= List.iter(refs_of_property_def s) x.AsList
@@ -4033,7 +4033,7 @@ and refs_of_tdef_kind _s _k = ()
40334033
andrefs_of_tdef s(td:ILTypeDef)=
40344034
refs_of_types s td.NestedTypes
40354035
refs_of_genparams s td.GenericParams
4036-
refs_of_typs s td.Implements
4036+
refs_of_tys s td.Implements
40374037
Option.iter(refs_of_typ s) td.Extends
40384038
refs_of_mdefs s td.Methods
40394039
refs_of_fields s td.Fields.AsList
@@ -4133,8 +4133,8 @@ let rec unscopeILTypeSpec (tspec:ILTypeSpec) =
41334133
lettref= unscopeILTypeRef tref
41344134
ILTypeSpec.Create(tref, unscopeILTypes tinst)
41354135

4136-
andunscopeILTypetyp=
4137-
matchtypwith
4136+
andunscopeILTypety=
4137+
matchtywith
41384138
| ILType.Ptr t-> ILType.Ptr(unscopeILType t)
41394139
| ILType.FunctionPointer t-> ILType.FunctionPointer(unscopeILCallSig t)
41404140
| ILType.Byref t-> ILType.Byref(unscopeILType t)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp