Пример #1
0
        private static void WriteRemoteNameExpression(BoundObjectAccessExpression node, IndentedTextWriter writer)
        {
            writer.WriteIdentifier(node.Variable.Name);
            writer.WriteKeyword(SyntaxKind.AccessToken);
            writer.WriteIdentifier(node.TypeCall != null ? node.TypeCall.Function.Name : (node.Function != null ? node.Function.Name : node.Property.Name));


            if (node.AccessType == ObjectAccessExpression.AccessType.Call)
            {
                writer.WritePunctuation(SyntaxKind.OpenParenthesisToken);

                var isFirst = true;
                foreach (var argument in node.Arguments)
                {
                    if (isFirst)
                    {
                        isFirst = false;
                    }
                    else
                    {
                        writer.WritePunctuation(SyntaxKind.CommaToken);
                        writer.WriteSpace();
                    }

                    argument.WriteTo(writer);
                }

                writer.WritePunctuation(SyntaxKind.CloseParenthesisToken);
            }
            else if (node.AccessType == ObjectAccessExpression.AccessType.Set)
            {
                writer.WriteKeyword(SyntaxKind.AssignToken);
                writer.WriteNestedExpression(0, node.Value);
            }
        }
Пример #2
0
 private BoundExpression RewriteRemoteNameExpression(BoundObjectAccessExpression node)
 {
     return(node);
 }