Class LuaExtensions
Extension methods for lua specific data.
Inheritance
System.Object
LuaExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Loretta.CodeAnalysis.Lua.dll
Syntax
public static class LuaExtensions
Methods
|
Improve this Doc
View Source
GetCompilationUnitRoot(SyntaxTree, CancellationToken)
Declaration
public static CompilationUnitSyntax GetCompilationUnitRoot(this SyntaxTree tree, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
SyntaxTree |
tree |
|
CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
Insert(SyntaxTokenList, Int32, SyntaxToken[])
Insert one or more tokens in the list at the specified index.
Declaration
public static SyntaxTokenList Insert(this SyntaxTokenList list, int index, params SyntaxToken[] items)
Parameters
Returns
|
Improve this Doc
View Source
IsKeyword(SyntaxToken)
Returns whether the provided SyntaxToken is a Lua keyword.
Declaration
public static bool IsKeyword(this SyntaxToken token)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsVerbatimStringLiteral(SyntaxToken)
Returns whether a SyntaxToken is a verbatim string literal.
Declaration
public static bool IsVerbatimStringLiteral(this SyntaxToken token)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Kind(SyntaxNode)
Declaration
public static SyntaxKind Kind(this SyntaxNode node)
Parameters
Returns
|
Improve this Doc
View Source
Kind(SyntaxNodeOrToken)
Declaration
public static SyntaxKind Kind(this SyntaxNodeOrToken nodeOrToken)
Parameters
Returns
|
Improve this Doc
View Source
Kind(SyntaxToken)
Declaration
public static SyntaxKind Kind(this SyntaxToken token)
Parameters
Returns
|
Improve this Doc
View Source
Kind(SyntaxTrivia)
Declaration
public static SyntaxKind Kind(this SyntaxTrivia trivia)
Parameters
Returns
|
Improve this Doc
View Source
ReplaceTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>)
Creates a new token with the specified old trivia replaced with computed new trivia.
Declaration
public static SyntaxToken ReplaceTrivia(this SyntaxToken token, IEnumerable<SyntaxTrivia> trivia, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> computeReplacementTrivia)
Parameters
Type |
Name |
Description |
SyntaxToken |
token |
|
IEnumerable<SyntaxTrivia> |
trivia |
The trivia to be replaced; descendants of the root token.
|
Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> |
computeReplacementTrivia |
A function that computes a replacement trivia for
the argument trivia. The first argument is the original trivia. The second argument is
the same trivia rewritten with replaced structure.
|
Returns
|
Improve this Doc
View Source
ReplaceTrivia(SyntaxToken, SyntaxTrivia, SyntaxTrivia)
Creates a new token with the specified old trivia replaced with a new trivia. The old trivia may appear in
the token's leading or trailing trivia.
Declaration
public static SyntaxToken ReplaceTrivia(this SyntaxToken token, SyntaxTrivia oldTrivia, SyntaxTrivia newTrivia)
Parameters
Type |
Name |
Description |
SyntaxToken |
token |
|
SyntaxTrivia |
oldTrivia |
The trivia to be replaced.
|
SyntaxTrivia |
newTrivia |
The new trivia to use in the new tree in place of the old
trivia.
|
Returns