Retrieves the "key" name component for the nameof(...) macro.
The key name component of global::Foo!int.Bar!T(x) (in C# notation global::Foo<int>.Bar<T>(x)) is Bar. This example tree has the structure ((((global::Foo)!int).Bar)!T)(x)).
Given a statement, this method attempts to decide if the immediately following statement (if any) is reachable.
The goal of this code is to avoid the dreaded compiler warning "Unreachable code detected". This is just a heuristic since we don't have access to proper reachability analysis. In fact, it's no doubt buggy.
NextTempName ( IMacroContextctx, LNodevalue ) : Symbol
NextTempName ( IMacroContextctx, stringprefix = "tmp_" ) : Symbol
Replace ( LNodestmt, LNode>.Pairpatterns, int &replacementCount ) : LNode
Replace ( VListstmts, LNode>.Pairpatterns, int &replacementCount ) : VList
Searches a list of expressions/statements for one or more patterns, and performs replacements.
Retrieves the "key" name component for the nameof(...) macro.
The key name component of global::Foo!int.Bar!T(x) (in C# notation global::Foo<int>.Bar<T>(x)) is Bar. This example tree has the structure ((((global::Foo)!int).Bar)!T)(x)).
Given a statement, this method attempts to decide if the immediately following statement (if any) is reachable.
The goal of this code is to avoid the dreaded compiler warning "Unreachable code detected". This is just a heuristic since we don't have access to proper reachability analysis. In fact, it's no doubt buggy.
publicstaticNextTempName ( IMacroContextctx, LNodevalue ) : Symbol
ctx
IMacroContext
value
LNode
Résultat
Symbol
NextTempName()
publicstaticméthode
publicstaticNextTempName ( IMacroContextctx, stringprefix = "tmp_" ) : Symbol
ctx
IMacroContext
prefix
string
Résultat
Symbol
Replace()
publicstaticméthode
publicstaticReplace ( LNodestmt, LNode>.Pairpatterns, int &replacementCount ) : LNode
stmt
LNode
patterns
LNode>.Pair
replacementCount
int
Résultat
LNode
Replace()
publicstaticméthode
Searches a list of expressions/statements for one or more patterns, and performs replacements.
LNodeExt.MatchesPattern is used for matching.
publicstaticReplace ( VListstmts, LNode>.Pairpatterns, int &replacementCount ) : VList
stmts
VList
A list of expressions/statements in which to search.
patterns
LNode>.Pair
Each pair consists of (A) something to search
/// for and (B) a replacement expression. Part A can use the substitution
/// operator with an identifier inside (e.g. $Foo) to "capture" any
/// subexpression, and part B can use the same substitution (e.g. $Foo)
/// to insert the captured subexpression(s) into the output.
replacementCount
int
Number of replacements that occurred.
Résultat
VList
ReplaceCaptures()
publicstaticméthode
Finds capture variables like $x and replaces them with values from captures (e.g. captures[(Symbol)"x"] for $x)