Class SyntaxExtensions
Extension methods for the Lua syntax.
Inheritance
Inherited Members
Namespace: Loretta.CodeAnalysis.Lua
Assembly: Loretta.CodeAnalysis.Lua.dll
Syntax
public static class SyntaxExtensions
Methods
| Improve this Doc View SourceNormalizeWhitespace(SyntaxToken, String, Boolean)
Creates a new syntax token with all whitespace and end of line trivia replaced with regularly formatted trivia.
Declaration
public static SyntaxToken NormalizeWhitespace(this SyntaxToken token, string indentation, bool elasticTrivia)
Parameters
Type | Name | Description |
---|---|---|
SyntaxToken | token | The token to normalize. |
System.String | indentation | A sequence of whitespace characters that defines a single level of indentation. |
System.Boolean | elasticTrivia | If true the replaced trivia is elastic trivia. |
Returns
Type | Description |
---|---|
SyntaxToken |
NormalizeWhitespace(SyntaxToken, String, String, Boolean)
Creates a new syntax token with all whitespace and end of line trivia replaced with regularly formatted trivia.
Declaration
public static SyntaxToken NormalizeWhitespace(this SyntaxToken token, string indentation = " ", string eol = "\r\n", bool elasticTrivia = false)
Parameters
Type | Name | Description |
---|---|---|
SyntaxToken | token | The token to normalize. |
System.String | indentation | An optional sequence of whitespace characters that defines a single level of indentation. |
System.String | eol | An optional sequence of whitespace characters used for end of line. |
System.Boolean | elasticTrivia | If true the replaced trivia is elastic trivia. |
Returns
Type | Description |
---|---|
SyntaxToken |
NormalizeWhitespace(SyntaxTriviaList, String, Boolean)
Creates a new syntax trivia list with all whitespace and end of line trivia replaced with regularly formatted trivia.
Declaration
public static SyntaxTriviaList NormalizeWhitespace(this SyntaxTriviaList list, string indentation, bool elasticTrivia)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTriviaList | list | The trivia list to normalize. |
System.String | indentation | A sequence of whitespace characters that defines a single level of indentation. |
System.Boolean | elasticTrivia | If true the replaced trivia is elastic trivia. |
Returns
Type | Description |
---|---|
SyntaxTriviaList |
NormalizeWhitespace(SyntaxTriviaList, String, String, Boolean)
Creates a new syntax trivia list with all whitespace and end of line trivia replaced with regularly formatted trivia.
Declaration
public static SyntaxTriviaList NormalizeWhitespace(this SyntaxTriviaList list, string indentation = " ", string eol = "\r\n", bool elasticTrivia = false)
Parameters
Type | Name | Description |
---|---|---|
SyntaxTriviaList | list | The trivia list to normalize. |
System.String | indentation | An optional sequence of whitespace characters that defines a single level of indentation. |
System.String | eol | An optional sequence of whitespace characters used for end of line. |
System.Boolean | elasticTrivia | If true the replaced trivia is elastic trivia. |
Returns
Type | Description |
---|---|
SyntaxTriviaList |
ToSyntaxTriviaList(IEnumerable<SyntaxTrivia>)
Creates a SyntaxTriviaList from an
Declaration
public static SyntaxTriviaList ToSyntaxTriviaList(this IEnumerable<SyntaxTrivia> sequence)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<SyntaxTrivia> | sequence |
Returns
Type | Description |
---|---|
SyntaxTriviaList |