Exemple #1
0
 public virtual void Visit(StructSyntax pNode)
 {
     foreach (var f in pNode.Fields)
     {
         f.Accept(this);
     }
     pNode.Initializer?.Accept(this);
 }
Exemple #2
0
        public virtual SyntaxNode Visit(StructSyntax pNode)
        {
            List <FieldDeclarationSyntax> fields = new List <FieldDeclarationSyntax>(pNode.Fields.Count);

            foreach (var f in pNode.Fields)
            {
                fields.Add(f.Accept <FieldDeclarationSyntax>(this));
            }
            return(SyntaxFactory.Struct(pNode.Name, pNode.Prefix, pNode.TypeArgs, fields, pNode.Initializer?.Accept <BlockSyntax>(this)).WithAttributes(pNode));
        }