Skip to content

Commit

Permalink
Minor cleanup (replace hats, add spaces) (#6278)
Browse files Browse the repository at this point in the history
* Replace hats

* Add spaces
  • Loading branch information
ncave authored and KevinRansom committed Feb 25, 2019
1 parent df4cf22 commit 6122d6a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/absil/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ let splitTypeNameRight nm =
/// This is used to store event, property and field maps.
type LazyOrderedMultiMap<'Key, 'Data when 'Key : equality>(keyf : 'Data -> 'Key, lazyItems : Lazy<'Data list>) =

let quickMap=
let quickMap =
lazyItems |> lazyMap (fun entries ->
let t = new Dictionary<_, _>(entries.Length, HashIdentity.Structural)
do entries |> List.iter (fun y ->
Expand Down
2 changes: 1 addition & 1 deletion src/absil/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx =
Locale= readStringHeapOption ctxt localeIdx
CustomAttrsStored = ctxt.customAttrsReader_Assembly
MetadataIndex = idx
AssemblyLongevity=
AssemblyLongevity =
let masked = flags &&& 0x000e
if masked = 0x0000 then ILAssemblyLongevity.Unspecified
elif masked = 0x0002 then ILAssemblyLongevity.Library
Expand Down
2 changes: 1 addition & 1 deletion src/absil/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ let emEnv0 =
emEntryPts = []
delayedFieldInits = [] }

let envBindTypeRef emEnv (tref:ILTypeRef) (typT, typB, typeDef)=
let envBindTypeRef emEnv (tref:ILTypeRef) (typT, typB, typeDef) =
match typT with
| null -> failwithf "binding null type in envBindTypeRef: %s\n" tref.Name;
| _ -> {emEnv with emTypMap = Zmap.add tref (typT, typB, typeDef, None) emEnv.emTypMap}
Expand Down
2 changes: 1 addition & 1 deletion src/absil/ilwritepdb.fs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ let pdbGetPdbDebugInfo (embeddedPDBChunk:BinaryChunk) (uncompressedLength:int64)
iddChunk = embeddedPDBChunk;
}

let pdbGetDebugInfo (mvid:byte[]) (timestamp:int32) (filepath:string) (cvChunk:BinaryChunk) (embeddedPDBChunk:BinaryChunk option) (uncompressedLength:int64) (stream:MemoryStream option)=
let pdbGetDebugInfo (mvid:byte[]) (timestamp:int32) (filepath:string) (cvChunk:BinaryChunk) (embeddedPDBChunk:BinaryChunk option) (uncompressedLength:int64) (stream:MemoryStream option) =
match stream, embeddedPDBChunk with
| None, _ | _, None -> [| pdbGetCvDebugInfo mvid timestamp filepath cvChunk |]
| Some s, Some chunk -> [| pdbGetCvDebugInfo mvid timestamp filepath cvChunk; pdbGetPdbDebugInfo chunk uncompressedLength s; |]
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/AugmentWithHashCompare.fs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ let getAugmentationAttribs g (tycon:Tycon) =
TryFindFSharpBoolAttribute g g.attrib_CustomComparisonAttribute tycon.Attribs,
TryFindFSharpBoolAttribute g g.attrib_StructuralComparisonAttribute tycon.Attribs

let CheckAugmentationAttribs isImplementation g amap (tycon:Tycon)=
let CheckAugmentationAttribs isImplementation g amap (tycon:Tycon) =
let m = tycon.Range
let attribs = getAugmentationAttribs g tycon
match attribs with
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/CheckFormatStrings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type FormatInfoRegister =
mutable addZeros : bool
mutable precision : bool}

let newInfo ()=
let newInfo () =
{ leftJustify = false
numPrefixIfPos = None
addZeros = false
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/LexFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer,
| IEEE32(v) -> delayMergedToken(IEEE32(if plus then v else -v))
| IEEE64(v) -> delayMergedToken(IEEE64(if plus then v else -v))
| DECIMAL(v) -> delayMergedToken(DECIMAL(if plus then v else System.Decimal.op_UnaryNegation v))
| BIGNUM(v,s) -> delayMergedToken(BIGNUM((if plus then v else "-"^v),s))
| BIGNUM(v,s) -> delayMergedToken(BIGNUM((if plus then v else "-" + v),s))
| _ -> noMerge()
else
noMerge()
Expand Down
18 changes: 9 additions & 9 deletions src/fsharp/TastOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4648,7 +4648,7 @@ let underlyingTypeOfEnumTy (g: TcGlobals) ty =
let tycon = (tcrefOfAppTy g ty).Deref
match tycon.GetFieldByName "value__" with
| Some rf -> rf.FormalType
| None -> error(InternalError("no 'value__' field found for enumeration type "^tycon.LogicalName, tycon.Range))
| None -> error(InternalError("no 'value__' field found for enumeration type " + tycon.LogicalName, tycon.Range))


// CLEANUP NOTE: Get rid of this mutation.
Expand Down Expand Up @@ -5137,7 +5137,7 @@ and renameTycon tyenv x =
let res = tyenv.tyconRefRemap.[mkLocalTyconRef x]
res
with :? KeyNotFoundException ->
errorR(InternalError("couldn't remap internal tycon "^showL(DebugPrint.tyconL x), x.Range));
errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL x), x.Range));
mkLocalTyconRef x
tcref.Deref

Expand Down Expand Up @@ -5179,7 +5179,7 @@ and copyAndRemapAndBindTyconsAndVals g compgen tmenv tycons vs =
let res = tmenvinner.tyconRefRemap.[mkLocalTyconRef tycon]
res
with :? KeyNotFoundException ->
errorR(InternalError("couldn't remap internal tycon "^showL(DebugPrint.tyconL tycon), tycon.Range));
errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL tycon), tycon.Range));
mkLocalTyconRef tycon
tcref.Deref

Expand Down Expand Up @@ -5683,7 +5683,7 @@ let rec simplifyTrivialMatch spBind exprm matchm ty tree (targets : _[]) =
if n >= targets.Length then failwith "simplifyTrivialMatch: target out of range";
// REVIEW: should we use _spTarget here?
let (TTarget(vs, rhs, _spTarget)) = targets.[n]
if vs.Length <> es.Length then failwith ("simplifyTrivialMatch: invalid argument, n = "^string n^", List.length targets = "^string targets.Length);
if vs.Length <> es.Length then failwith ("simplifyTrivialMatch: invalid argument, n = " + string n + ", List.length targets = " + string targets.Length);
// These are non-sticky - any sequence point for 'rhs' goes on 'rhs' _after_ the bindings have been made
mkInvisibleLetsFromBindings rhs.Range vs es rhs
| _ ->
Expand Down Expand Up @@ -6812,7 +6812,7 @@ let AdjustArityOfLambdaBody g arity (vs:Val list) body =
if (untupledTys.Length <> arity) then failwith "length untupledTys <> arity";
let dummyvs, dummyes =
untupledTys
|> List.mapi (fun i ty -> mkCompGenLocal v.Range (v.LogicalName ^"_"^string i) ty)
|> List.mapi (fun i ty -> mkCompGenLocal v.Range (v.LogicalName + "_" + string i) ty)
|> List.unzip
// These are non-sticky - any sequence point for 'body' goes on 'body' _after_ the binding has been made
let body = mkInvisibleLet v.Range v (mkRefTupled g v.Range dummyes untupledTys) body
Expand Down Expand Up @@ -7035,7 +7035,7 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex
argtysl |> List.mapi (fun i argtys ->
argtys |> List.mapi (fun j (_, argInfo) ->
match argInfo.Name with
| None -> CompilerGeneratedName ("arg" + string i ^string j)
| None -> CompilerGeneratedName ("arg" + string i + string j)
| Some id -> id.idText))
| _ ->
[]
Expand Down Expand Up @@ -7165,11 +7165,11 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex

assert (inpArgTys.Length = actualArgTys.Length)

let inpsAsVars, inpsAsExprs = inpArgTys |> List.mapi (fun j ty -> mkCompGenLocal appm ("arg"^string i^string j) ty) |> List.unzip
let inpsAsVars, inpsAsExprs = inpArgTys |> List.mapi (fun j ty -> mkCompGenLocal appm ("arg" + string i + string j) ty) |> List.unzip
let inpsAsActualArg = CoerceDetupled inpArgTys inpsAsExprs actualArgTys
let inpCloVarType = (mkFunTy (mkRefTupledTy g actualArgTys) cloVar.Type)
let newResTy = mkFunTy inpArgTy resTy
let inpCloVar, inpCloVarAsExpr = mkCompGenLocal appm ("clo"^string i) inpCloVarType
let inpCloVar, inpCloVarAsExpr = mkCompGenLocal appm ("clo" + string i) inpCloVarType
let newRes =
// For the final arg we can skip introducing the dummy variable
if i = N - 1 then
Expand Down Expand Up @@ -7209,7 +7209,7 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex
let niceNames =
match niceNames with
| nms when nms.Length = inpArgTys.Length -> nms
| [nm] -> inpArgTys |> List.mapi (fun i _ -> (nm^string i))
| [nm] -> inpArgTys |> List.mapi (fun i _ -> (nm + string i))
| nms -> nms
match suppliedArg with
| Some arg ->
Expand Down
2 changes: 1 addition & 1 deletion src/utils/prim-lexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ namespace Internal.Utilities.Text.Lexing
static member FromChars (arr:char[]) = LexBuffer.FromArrayNoCopy arr

module GenericImplFragments =
let startInterpret(lexBuffer:LexBuffer<char>)=
let startInterpret(lexBuffer:LexBuffer<char>) =
lexBuffer.BufferScanStart <- lexBuffer.BufferScanStart + lexBuffer.LexemeLength;
lexBuffer.BufferMaxScanLength <- lexBuffer.BufferMaxScanLength - lexBuffer.LexemeLength;
lexBuffer.BufferScanLength <- 0;
Expand Down

0 comments on commit 6122d6a

Please sign in to comment.