|
Converts the core of an operator name into a logical name. For example,
+ --> op_Addition
!% --> op_DereferencePercent
Only used on actual operator names
-
op
:
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.
-
opName
:
string
-
Returns:
string
|
|
-
arg0
:
string
-
Returns:
bool
|
|
-
Returns:
string
|
|
-
arg0
:
int
-
Returns:
string
|
|
The prefix of the names used for the fake namespace path added to all dynamic code entries in FSI.EXE
-
Returns:
string
|
|
-
arg0
:
string
-
Returns:
string list
|
|
Determines if the specified name is a valid name for an active pattern.
|A|_| --> true
|A|B| --> true
|A| --> true
| --> false
|| --> false
op_Addition --> false
TBD: needs unit testing
-
name
:
string
-
Returns:
bool
|
|
-
nm
:
string
-
Returns:
bool
|
|
The characters that are allowed to be the first character of an identifier.
-
c
:
char
-
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
-
name
:
string
-
Returns:
bool
|
|
The characters that are allowed to be in an identifier.
-
c
:
char
-
Returns:
bool
|
|
-
logicalName
:
string
-
Returns:
bool
|
|
Is the name a logical operator name, including unary, binary and ternary operators
op_UnaryPlus - yes
op_Addition - yes
op_Range - yes (?)
op_RangeStep - yes (?)
op_DynamicAssignment - yes
op_Quack - no
+ - no
ABC - no
ABC DEF - no
base - no
|A|_| - no
-
logicalName
:
string
-
Returns:
bool
|
|
-
logicalName
:
string
-
Returns:
bool
|
|
-
logicalName
:
string
-
Returns:
bool
|
|
Is this character a part of a long identifier?
-
c
:
char
-
Returns:
bool
|
|
Returns `true` if given string is an operator display name, e.g.
( |>> )
|>>
..
-
name
:
string
-
Returns:
bool
|
|
-
s
:
string
-
Returns:
bool
|
|
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``
-
name
:
string
-
Returns:
string
|
|
Try to chop "get_" or "set_" from a string
-
s
:
string
-
Returns:
string option
|