Ejemplo n.º 1
0
 // TODO 0 where is this used? I changed it and nothing broke
 public static Doc Print(ConstructorInitializerSyntax node)
 {
     return(Doc.Indent(
                Doc.HardLine,
                Token.Print(node.ColonToken, " "),
                Token.Print(node.ThisOrBaseKeyword),
                ArgumentList.Print(node.ArgumentList)
                ));
 }
 public static Doc Print(ImplicitObjectCreationExpressionSyntax node)
 {
     // TODO 1 more tests for this?
     return(Doc.Concat(
                Token.Print(node.NewKeyword),
                ArgumentList.Print(node.ArgumentList),
                node.Initializer != null ? Node.Print(node.Initializer) : Doc.Null
                ));
 }
Ejemplo n.º 3
0
 public static Doc Print(ImplicitObjectCreationExpressionSyntax node)
 {
     return(Doc.Concat(
                Token.Print(node.NewKeyword),
                ArgumentList.Print(node.ArgumentList),
                node.Initializer != null
             ? Doc.Concat(Doc.Line, Node.Print(node.Initializer))
             : Doc.Null
                ));
 }
 public static Doc Print(ObjectCreationExpressionSyntax node)
 {
     return(Doc.Group(
                Token.Print(node.NewKeyword, " "),
                Node.Print(node.Type),
                node.ArgumentList != null ? ArgumentList.Print(node.ArgumentList) : string.Empty,
                node.Initializer != null
             ? InitializerExpression.Print(node.Initializer)
             : string.Empty
                ));
 }
Ejemplo n.º 5
0
        private static Doc Print(ConstructorInitializerSyntax node, string?groupId)
        {
            var colonToken = Token.PrintWithSuffix(node.ColonToken, " ");

            return(Doc.Group(
                       Doc.Indent(groupId != null ? Doc.IfBreak(" ", Doc.Line, groupId) : Doc.Line),
                       groupId != null
                    ? Doc.IfBreak(Doc.Align(2, colonToken), Doc.Indent(colonToken), groupId)
                    : Doc.Indent(colonToken),
                       Token.Print(node.ThisOrBaseKeyword),
                       groupId != null
                    ? ArgumentList.Print(node.ArgumentList)
                    : Doc.Indent(ArgumentList.Print(node.ArgumentList))
                       ));
        }
Ejemplo n.º 6
0
 public static Doc Print(PrimaryConstructorBaseTypeSyntax node)
 {
     return(Doc.Concat(Node.Print(node.Type), ArgumentList.Print(node.ArgumentList)));
 }