Skip to content

v0.2.8

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Feb 21:05

Added

  • Added support for string length to the constant folder.
  • The following were added as a part of implementing local variable attributes:
    • Loretta.CodeAnalysis.Lua.Syntax.LocalDeclarationNameSyntax;
    • SyntaxKind.LocalDeclarationName;
    • SyntaxFactory.LocalDeclarationName;
    • LuaSyntaxVisitor.VisitLocalDeclarationName;
    • LuaSyntaxVisitor<TResult>.VisitLocalDeclarationName;
    • LuaSyntaxRewriter.VisitLocalDeclarationName;
    • Loretta.CodeAnalysis.Lua.Syntax.VariableAttributeSyntax;
    • SyntaxKind.VariableAttribute;
    • SyntaxFactory.VariableAttribute;
    • LuaSyntaxVisitor.VisitVariableAttribute;
    • LuaSyntaxVisitor<TResult>.VisitVariableAttribute;
    • LuaSyntaxRewriter.VisitVariableAttribute;
    • LuaSyntaxOptions.AcceptLocalVariableAttributes;
    • LuaSyntaxOptions.Lua54 preset.
  • Added SyntaxFactory.HashString for creating FiveM hash string literal tokens.
  • The following were added as part of implementing integers:
    • IntegerFormats;
    • LuaSyntaxOptions.AllWithIntegers;
    • LuaSyntaxOptions.BinaryIntegerFormat;
    • LuaSyntaxOptions.OctalIntegerFormat;
    • LuaSyntaxOptions.DecimalIntegerFormat;
    • LuaSyntaxOptions.HexIntegerFormat;
    • ObjectDisplay.FormatLiteral(long value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null);
    • IMPORTANT: SyntaxFactory.Literal(long value);
    • IMPORTANT: SyntaxFactory.Literal(string text, long value);
    • IMPORTANT: SyntaxFactory.Literal(SyntaxTriviaList leading, string text, long value, SyntaxTriviaList trailing).

Changed

  • Constant folder now attempts to preserve trivia around nodes that were folded.
  • [Breaking] The following were changed as a result of implementing local variable attributes:
    • LocalVariableDeclarationStatementSyntax.Names now returns a SeparatedSyntaxList<LocalDeclarationNameSyntax> instead of SeparatedSyntaxList<IdentifierNameSyntax>;
    • LocalVariableDeclarationStatementSyntax.Update now receives a SeparatedSyntaxList<LocalDeclarationNameSyntax> instead of SeparatedSyntaxList<IdentifierNameSyntax>;
    • LocalVariableDeclarationStatementSyntax.AddNames now receives a params LocalDeclarationNameSyntax[] instead of params IdentifierNameSyntax[];
    • LocalVariableDeclarationStatementSyntax.WithNames now receives a SeparatedSyntaxList<LocalDeclarationNameSyntax> instead of SeparatedSyntaxList<IdentifierNameSyntax>;
    • SyntaxFactory.LocalVariableDeclarationStatement overloads now receive a SeparatedSyntaxList<LocalDeclarationNameSyntax> instead of SeparatedSyntaxList<IdentifierNameSyntax>;
    • LuaSyntaxOptions constructor and With method now accept an acceptLocalVariableAttributes parameter.
  • [Breaking] The following were changed as a result of implementing integers:
    • The Lua 5.3 preset was changed to accept integers;
    • IMPORTANT: SyntaxToken.Value now can be a long when any of the *IntegerFormat settings are set to IntegerFormats.Int64;
    • LuaSyntaxOptions constructor and With method now accept 4 IntegerFormats for each number format (binary, octal, decimal and hexadecimal);
    • The constant folder was modified to support integers.