v0.2.7-beta.12
Pre-release
Pre-release
Fixed
- Fixed
Minify
renaming variables that were being used incorrectly. - Fixed
Minify
not adding a leading_
for certain variable names. - Fixed
Minify
adding prefixes for variable names that were already renamed.
Changed
- [Breaking] The following were changed as a result of the move to
EqualsValuesClauseSyntax
:- Replaced
EqualsToken
andValues
inAssignmentStatementSyntax
byEqualsValues
; - Replaced
EqualsToken
andValues
inLocalVariableDeclarationStatementSyntax
byEqualsValues
.
- Replaced
- [Breaking]
SyntaxFactory
methods will now throw exceptions if the lists provided to them do not have the minimum amount of items required. - [Breaking]
NamingStrategy
was changed to receive a list ofIScope
s instead of a single one.
The received scopes are the scopes where the variable is accessed in. - [Breaking] The following strategies were changed as a result of the above:
NamingStrategies.Alphabetic
;NamingStrategies.Numeric
;NamingStrategies.ZeroWidth
.
Removed
- [Breaking] The following were removed as a result of the move to
EqualsValuesClauseSyntax
:AssignmentStatementSyntax.EqualsToken
;AssignmentStatementSyntax.Values
;AssignmentStatementSyntax.Update(SeparatedSyntaxList<PrefixExpressionSyntax> variables, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken)
;AssignmentStatementSyntax.AddValues(params ExpressionSyntax[] items)
;AssignmentStatementSyntax.WithEqualsToken(SyntaxToken equalsToken)
;AssignmentStatementSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values)
;LocalVariableDeclarationStatementSyntax.AddValues(params ExpressionSyntax[] items)
;LocalVariableDeclarationStatementSyntax.EqualsToken
;LocalVariableDeclarationStatementSyntax.Update(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken)
;LocalVariableDeclarationStatementSyntax.Values
;LocalVariableDeclarationStatementSyntax.WithEqualsToken(SyntaxToken equalsToken)
;LocalVariableDeclarationStatementSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values)
;SyntaxFactory.AssignmentStatement()
;SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken)
;SyntaxFactory.LocalVariableDeclarationStatement()
;SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names, SeparatedSyntaxList<ExpressionSyntax> values)
;SyntaxFactory.LocalVariableDeclarationStatement(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken)
.
- [Breaking] The following were removed as a result of the
MinCount
fix forSyntax.xml
:SyntaxFactory.GenericForStatement(StatementListSyntax? body = null)
.
Added
- The following were added as a result of the move to
EqualsValuesClauseSyntax
:SyntaxKind.EqualsValuesClause
;EqualsValuesClauseSyntax
;EqualsValuesClauseSyntax.EqualsToken
;EqualsValuesClauseSyntax.Values
;EqualsValuesClauseSyntax.Update(SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values)
;EqualsValuesClauseSyntax.WithEqualsToken(SyntaxToken equalsToken)
;EqualsValuesClauseSyntax.AddValues(params ExpressionSyntax[] items)
;EqualsValuesClauseSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values)
;EqualsValuesClauseSyntax.Accept(LuaSyntaxVisitor visitor)
;EqualsValuesClauseSyntax.Accept<TResult>(LuaSyntaxVisitor<TResult> visitor)
;AssignmentStatementSyntax.EqualsValues
;AssignmentStatementSyntax.Update(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues, SyntaxToken semicolonToken)
;AssignmentStatementSyntax.WithEqualsValues(EqualsValuesClauseSyntax equalsValues)
;LocalVariableDeclarationStatementSyntax.EqualsValues
;LocalVariableDeclarationStatementSyntax.Update(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues, SyntaxToken semicolonToken)
;LocalVariableDeclarationStatementSyntax.WithEqualsValues(Loretta.CodeAnalysis.Lua.Syntax.EqualsValuesClauseSyntax? equalsValues)
;SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues, SyntaxToken semicolonToken)
;SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues)
;SyntaxFactory.EqualsValuesClause(SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values)
;SyntaxFactory.EqualsValuesClause(SeparatedSyntaxList<ExpressionSyntax> values)
;SyntaxFactory.LocalVariableDeclarationStatement(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues, SyntaxToken semicolonToken)
;SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues)
;SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names)
;LuaSyntaxVisitor.VisitEqualsValuesClause(EqualsValuesClauseSyntax node)
;LuaSyntaxVisitor<TResult>.VisitEqualsValuesClause(EqualsValuesClauseSyntax node)
;LuaSyntaxWalker.VisitEqualsValuesClause(EqualsValuesClauseSyntax node)
;LuaSyntaxRewriter.VisitEqualsValuesClause(EqualsValuesClauseSyntax node)
.
- Added
SyntaxFacts.GetKeywordKind(ReadOnlySpan<char> span)
. - The following were added as a result of the
MinCount
fix forSyntax.xml
:SyntaxFactory.GenericForStatement(SeparatedSyntaxList<IdentifierNameSyntax> identifiers, SeparatedSyntaxList<ExpressionSyntax> expressions)
.
- Added
MinifyingUtils.CanRename
to check if a variable will be renamed by the minifier. - Added
MinifyingUtils.GetUnavailableNames
to get the list of variable names that can't be used for a given scope or list of scopes.
This is particularly useful for implementing your ownNamingStrategy
.