Exemple #1
0
 public ExpressionSyntax Transpile(IExpressionSyntax expression)
 {
     return(expression switch
     {
         JassCharacterLiteralExpressionSyntax characterLiteralExpression => Transpile(characterLiteralExpression),
         JassFourCCLiteralExpressionSyntax fourCCLiteralExpression => Transpile(fourCCLiteralExpression),
         JassHexadecimalLiteralExpressionSyntax hexadecimalLiteralExpression => Transpile(hexadecimalLiteralExpression),
         JassRealLiteralExpressionSyntax realLiteralExpression => Transpile(realLiteralExpression),
         JassOctalLiteralExpressionSyntax octalLiteralExpression => Transpile(octalLiteralExpression),
         JassDecimalLiteralExpressionSyntax decimalLiteralExpression => Transpile(decimalLiteralExpression),
         JassBooleanLiteralExpressionSyntax booleanLiteralExpression => Transpile(booleanLiteralExpression),
         JassStringLiteralExpressionSyntax stringLiteralExpression => Transpile(stringLiteralExpression),
         JassNullLiteralExpressionSyntax nullLiteralExpression => Transpile(nullLiteralExpression),
         JassFunctionReferenceExpressionSyntax functionReferenceExpression => Transpile(functionReferenceExpression),
         JassInvocationExpressionSyntax invocationExpression => Transpile(invocationExpression),
         JassArrayReferenceExpressionSyntax arrayReferenceExpression => Transpile(arrayReferenceExpression),
         JassVariableReferenceExpressionSyntax variableReferenceExpression => Transpile(variableReferenceExpression),
         JassParenthesizedExpressionSyntax parenthesizedExpression => Transpile(parenthesizedExpression),
         JassUnaryExpressionSyntax unaryExpression => Transpile(unaryExpression),
         JassBinaryExpressionSyntax binaryExpression => Transpile(binaryExpression),
     });
Exemple #2
0
        public LuaExpressionSyntax Transpile(JassNullLiteralExpressionSyntax nullLiteralExpression, out JassTypeSyntax type)
        {
            type = JassTypeSyntax.Handle;

            return(LuaIdentifierLiteralExpressionSyntax.Nil);
        }
 public void Render(JassNullLiteralExpressionSyntax nullLiteralExpression)
 {
     Write(JassKeyword.Null);
 }
Exemple #4
0
 public ExpressionSyntax Transpile(JassNullLiteralExpressionSyntax nullLiteralExpression)
 {
     return(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression));
 }