Class LuaExtensions
Extension methods for lua specific data.
Inheritance
Inherited Members
Namespace: Loretta.CodeAnalysis
Assembly: Loretta.CodeAnalysis.Lua.dll
Syntax
public static class LuaExtensions
Methods
| Improve this Doc View SourceAny(SyntaxTokenList, SyntaxKind)
Tests whether a list contains a token of a particular kind.
Declaration
public static bool Any(this SyntaxTokenList list, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTokenList | list | |
SyntaxKind | kind | The SyntaxKind to test for. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the list contains a token which matches |
Any(SyntaxTriviaList, SyntaxKind)
True if the list has at least one trivia of the specified kind.
Declaration
public static bool Any(this SyntaxTriviaList list, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTriviaList | list | |
SyntaxKind | kind |
Returns
Type | Description |
---|---|
System.Boolean |
Any<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)
True if the list has at least one node of the specified kind.
Declaration
public static bool Any<TNode>(this SeparatedSyntaxList<TNode> list, SyntaxKind kind)
where TNode : SyntaxNode
Parameters
Type | Name | Description |
---|---|---|
SeparatedSyntaxList<TNode> | list | |
SyntaxKind | kind |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
TNode |
Any<TNode>(SyntaxList<TNode>, SyntaxKind)
True if the list has at least one node of the specified kind.
Declaration
public static bool Any<TNode>(this SyntaxList<TNode> list, SyntaxKind kind)
where TNode : SyntaxNode
Parameters
Type | Name | Description |
---|---|---|
SyntaxList<TNode> | list | |
SyntaxKind | kind |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
TNode |
IndexOf(SyntaxTokenList, SyntaxKind)
Returns the index of the first token of a specified kind in the token list.
Declaration
public static int IndexOf(this SyntaxTokenList list, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTokenList | list | Token list. |
SyntaxKind | kind | The SyntaxKind to find. |
Returns
Type | Description |
---|---|
System.Int32 | Returns non-negative index if the list contains a token which matches |
IndexOf(SyntaxTriviaList, SyntaxKind)
Returns the index of the first trivia of a specified kind in the trivia list.
Declaration
public static int IndexOf(this SyntaxTriviaList list, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTriviaList | list | Trivia list. |
SyntaxKind | kind | The SyntaxKind to find. |
Returns
Type | Description |
---|---|
System.Int32 | Returns non-negative index if the list contains a trivia which matches |
IndexOf<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)
Returns the index of the first node of a specified kind in the node list.
Declaration
public static int IndexOf<TNode>(this SeparatedSyntaxList<TNode> list, SyntaxKind kind)
where TNode : SyntaxNode
Parameters
Type | Name | Description |
---|---|---|
SeparatedSyntaxList<TNode> | list | Node list. |
SyntaxKind | kind | The SyntaxKind to find. |
Returns
Type | Description |
---|---|
System.Int32 | Returns non-negative index if the list contains a node which matches |
Type Parameters
Name | Description |
---|---|
TNode |
IndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)
Returns the index of the first node of a specified kind in the node list.
Declaration
public static int IndexOf<TNode>(this SyntaxList<TNode> list, SyntaxKind kind)
where TNode : SyntaxNode
Parameters
Type | Name | Description |
---|---|---|
SyntaxList<TNode> | list | Node list. |
SyntaxKind | kind | The SyntaxKind to find. |
Returns
Type | Description |
---|---|
System.Int32 | Returns non-negative index if the list contains a node which matches |
Type Parameters
Name | Description |
---|---|
TNode |
IsKind(SyntaxNode, SyntaxKind)
Determines if SyntaxNode is of a specified kind.
Declaration
public static bool IsKind(this SyntaxNode node, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNode | node | The source node. |
SyntaxKind | kind | The syntax kind to test for. |
Returns
Type | Description |
---|---|
System.Boolean | true if the node is of the specified kind; otherwise, false. |
IsKind(SyntaxNodeOrToken, SyntaxKind)
Determines if SyntaxNodeOrToken is of a specified kind.
Declaration
public static bool IsKind(this SyntaxNodeOrToken nodeOrToken, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrToken | The source node or token. |
SyntaxKind | kind | The syntax kind to test for. |
Returns
Type | Description |
---|---|
System.Boolean | true if the node or token is of the specified kind; otherwise, false. |
IsKind(SyntaxToken, SyntaxKind)
Determines if SyntaxToken is of a specified kind.
Declaration
public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxToken | token | The source token. |
SyntaxKind | kind | The syntax kind to test for. |
Returns
Type | Description |
---|---|
System.Boolean | true if the token is of the specified kind; otherwise, false. |
IsKind(SyntaxTrivia, SyntaxKind)
Determines if SyntaxTrivia is of a specified kind.
Declaration
public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTrivia | trivia | The source trivia. |
SyntaxKind | kind | The syntax kind to test for. |
Returns
Type | Description |
---|---|
System.Boolean | true if the trivia is of the specified kind; otherwise, false. |