PrettyNaming Module
Some general F# utilities for mangling / unmangling / manipulating names. Anything to do with special names of identifiers and other lexical rules
Types and nested modules
Type/Module | Description |
Functions and values
Function or value | Description |
Full Usage:
ActivePatternInfoOfValName nm m
Parameters:
string
m : range
Returns: ActivePatternInfo option
|
|
Full Usage:
ChopPropertyName s
Parameters:
string
Returns: string
|
|
Full Usage:
CompileOpName op
Parameters:
string
Returns: string
|
|
Full Usage:
CompilerGeneratedName nm
Parameters:
string
Returns: string
|
|
Full Usage:
CompilerGeneratedNameSuffix basicName suffix
Parameters:
string
suffix : string
Returns: string
|
|
Full Usage:
ComputeMangledNameWithoutDefaultArgValues (nm, staticArgs, defaultArgValues)
Parameters:
string
staticArgs : 'a[]
defaultArgValues : (string * string option)[]
Returns: string
|
|
|
|
Full Usage:
ConvertLogicalNameToDisplayName name
Parameters:
string
Returns: string
|
|
Full Usage:
ConvertValLogicalNameToDisplayName isBaseVal name
Parameters:
bool
name : string
Returns: string
|
Take a core display name for a value (e.g. op_Addition or PropertyName) and convert it to display text Foo --> Foo + --> ``+`` op_Addition --> (+) op_Multiply --> ( * ) op_DereferencePercent --> (!%) A-B --> ``A-B`` |A|_| --> (|A|_|) let --> ``let`` type --> ``type`` params --> ``params`` base --> base or --> or mod --> mod
|
Full Usage:
ConvertValLogicalNameToDisplayNameCore opName
Parameters:
string
Returns: string
|
Converts the logical name for and operator back into the core of a display name. For example: Foo --> Foo + --> + op_Addition --> + op_DereferencePercent --> !% A-B --> A-B |A|_| --> |A|_| base --> base regardless of IsBaseVal Used on names of all kinds TODO: We should assess uses of this function. In any cases it is used it probably indicates that text is being generated which: 1. does not contain double-backticks for non-identifiers 2. does not put parentheses arounf operators or active pattern names If the text is immediately in quotes, this is generally ok, e.g. error FS0038: '+' is bound twice in this pattern error FS0038: '|A|_|' is bound twice in this pattern error FS0038: 'a a' is bound twice in this pattern If not, the it is likely this should be replaced by ConvertValLogicalNameToDisplayName.
|
Full Usage:
DecodeGenericTypeName mangledName
Parameters:
string
Returns: NameArityPair
|
|
Full Usage:
DecodeGenericTypeNameWithPos pos mangledName
Parameters:
int
mangledName : string
Returns: NameArityPair
|
|
Full Usage:
DemangleGenericTypeName mangledName
Parameters:
string
Returns: string
|
|
Full Usage:
DemangleGenericTypeNameWithPos pos mangledName
Parameters:
int
mangledName : string
Returns: string
|
|
Full Usage:
DemangleProvidedTypeName typeLogicalName
Parameters:
string
Returns: string * (string * string)[]
|
|
Full Usage:
DoesIdentifierNeedBackticks arg1
Parameters:
string
Returns: bool
|
|
Full Usage:
ExtraWitnessMethodName nm
Parameters:
string
Returns: string
|
|
Full Usage:
FSharpModuleSuffix
Returns: string
|
|
Full Usage:
FSharpOptimizationCompressedDataResourceName
Returns: string
|
|
Full Usage:
FSharpOptimizationDataResourceName
Returns: string
|
|
Full Usage:
FSharpOptimizationDataResourceName2
Returns: string
|
|
Full Usage:
FSharpSignatureCompressedDataResourceName
Returns: string
|
|
Full Usage:
FSharpSignatureDataResourceName
Returns: string
|
|
Full Usage:
FSharpSignatureDataResourceName2
Returns: string
|
|
Full Usage:
FSharpSignatureDataResourceName2
Returns: string
|
|
Full Usage:
FormatAndOtherOverloadsString arg1
Parameters:
int
Returns: string
|
|
Full Usage:
FsiDynamicModulePrefix
Returns: string
|
|
Full Usage:
GetBasicNameOfPossibleCompilerGeneratedName name
Parameters:
string
Returns: string
|
|
Full Usage:
GetLongNameFromString arg1
Parameters:
string
Returns: string list
|
|
Full Usage:
IllegalCharactersInTypeAndNamespaceNames
Returns: char[]
|
|
Full Usage:
IsActivePatternName name
Parameters:
string
Returns: bool
|
|
Full Usage:
IsCompilerGeneratedName nm
Parameters:
string
Returns: bool
|
|
Full Usage:
IsIdentifierFirstCharacter c
Parameters:
char
Returns: bool
|
|
Full Usage:
IsIdentifierName name
Parameters:
string
Returns: bool
|
Is the name a valid F# identifier, primarily used internally in PrettyNaming.fs for determining if an identifier needs backticks. In general do not use this routine. It is only used in one quick fix, for determining if it is valid to add "_" in front of an identifier. A --> true A' --> true _A --> true A0 --> true |A|B| --> false op_Addition --> true + --> false let --> false base --> false TBD: needs unit testing
|
Full Usage:
IsIdentifierPartCharacter c
Parameters:
char
Returns: bool
|
|
Full Usage:
IsLogicalInfixOpName logicalName
Parameters:
string
Returns: bool
|
|
Full Usage:
IsLogicalOpName logicalName
Parameters:
string
Returns: bool
|
|
Full Usage:
IsLogicalPrefixOperator logicalName
Parameters:
string
Returns: bool
|
|
Full Usage:
IsLogicalTernaryOperator logicalName
Parameters:
string
Returns: bool
|
|
Full Usage:
IsLongIdentifierPartCharacter c
Parameters:
char
Returns: bool
|
|
Full Usage:
IsOperatorDisplayName name
Parameters:
string
Returns: bool
|
|
Full Usage:
IsPunctuation s
Parameters:
string
Returns: bool
|
|
Full Usage:
IsValidPrefixOperatorDefinitionName s
Parameters:
string
Returns: bool
|
|
Full Usage:
IsValidPrefixOperatorUse s
Parameters:
string
Returns: bool
|
|
Full Usage:
MangleProvidedTypeName (typeLogicalName, nonDefaultArgs)
Parameters:
string
nonDefaultArgs : (string * string)[]
Returns: string
|
|
Full Usage:
MangledGlobalName
Returns: string
|
|
Full Usage:
NormalizeIdentifierBackticks name
Parameters:
string
Returns: string
|
Adds double backticks if necessary to make a valid identifier, e.g. op_Addition --> op_Addition + --> ``+`` (this is not op_Addition) |>> --> ``|>>`` (this is not an op_) A-B --> ``A-B`` AB --> AB |A|_| --> |A|_| this is an active pattern name, needs parens not backticks Removes double backticks if not necessary to make a valid identifier, e.g. ``A`` --> A ``A-B`` --> ``A-B``
|
Full Usage:
SplitNamesForILPath s
Parameters:
string
Returns: string list
|
|
Full Usage:
TryChopPropertyName s
Parameters:
string
Returns: string option
|
|
Full Usage:
TryDemangleGenericNameAndPos n
Parameters:
string
Returns: int voption
|
|
Full Usage:
isTildeOnlyString s
Parameters:
string
Returns: bool
|
|
Full Usage:
keywordsWithDescription
Returns: (string * string) list
|
|
Full Usage:
mkExceptionFieldName
Returns: int -> string
|
|
Full Usage:
mkUnionCaseFieldName
Returns: int -> int -> string
|
|
Full Usage:
opNameCons
Returns: string
|
|
Full Usage:
opNameEquals
Returns: string
|
|
Full Usage:
opNameEqualsNullable
Returns: string
|
|
Full Usage:
opNameNil
Returns: string
|
|
Full Usage:
opNameNullableEquals
Returns: string
|
|
Full Usage:
opNameNullableEqualsNullable
Returns: string
|
|
Full Usage:
opNamePrefix
Returns: string
|
|
Full Usage:
outArgCompilerGeneratedName
Returns: string
|
|
Full Usage:
parenGet
Returns: string
|
|
Full Usage:
parenSet
Returns: string
|
|
Full Usage:
qmark
Returns: string
|
|
Full Usage:
qmarkSet
Returns: string
|
|
Full Usage:
stackVarPrefix
Returns: string
|
|
Full Usage:
suffixForTupleElementAssignmentTarget
Returns: string
|
|
Full Usage:
suffixForVariablesThatMayNotBeEliminated
Returns: string
|
|
Full Usage:
unassignedTyparName
Returns: string
|
|
Active patterns
Active pattern | Description |
Full Usage:
(|Control|Equality|Relational|Indexer|FixedTypes|Other|) opName
Parameters:
string
Returns: Choice<unit, unit, unit, unit, unit, unit>
|
|