179 references to Name
CSharpSyntaxGenerator (179)
AbstractFileWriter.cs (2)
385}).Single(f => f.Name == field.Name);
SignatureWriter.cs (3)
72_writer.WriteLine(" public abstract {0}{1} {2} {{ get; }}", "", field.Type, field.Name); 91_writer.WriteLine(" public {0}{1}{2} {3} {{ get; }}", "", "", field.Type, field.Name); 97_writer.WriteLine(" public {0}{1}{2} {3} {{ get; }}", "", "", field.Type, field.Name);
SourceWriter.cs (160)
127WriteLine($"public abstract {(IsNew(field) ? "new " : "")}CoreSyntax.{field.Type} {field.Name} {{ get; }}"); 131WriteLine($"public abstract {(IsNew(field) ? "new " : "")}{(GetFieldType(field, green: true))} {field.Name} {{ get; }}"); 141WriteLine($"public abstract {(IsNew(field) ? "new " : "")}{field.Type} {field.Name} {{ get; }}"); 159WriteLine($"internal readonly {type} {CamelCase(field.Name)};"); 164WriteLine($"internal readonly {field.Type} {CamelCase(field.Name)};"); 212WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.Name} => new {type}(this.{CamelCase(field.Name)});"); 217WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.Name} => new {type}(new CoreSyntax.SyntaxList<CSharpSyntaxNode>(this.{CamelCase(field.Name)}));"); 222WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.Name} => new {type}(this.{CamelCase(field.Name)});"); 226WriteLine($"public {OverrideOrNewModifier(field)}{(GetFieldType(field, green: true))} {field.Name} => this.{CamelCase(field.Name)};"); 233WriteLine($"public {OverrideOrNewModifier(field)}{field.Type} {field.Name} => this.{CamelCase(field.Name)};"); 248WriteLine($"=> index == 0 ? this.{CamelCase(nodeFields[0].Name)} : null;"); 260WriteLine($"{i} => this.{CamelCase(field.Name)},"); 283Write($", {(GetFieldType(field, green: true))} {CamelCase(field.Name)}"); 288Write($", {field.Type} {CamelCase(field.Name)}"); 306WriteLine($"if ({CamelCase(field.Name)} != null)"); 308WriteLine($"this.AdjustFlagsAndWidth({CamelCase(field.Name)});"); 309WriteLine($"this.{CamelCase(field.Name)} = {CamelCase(field.Name)};"); 314WriteLine($"this.AdjustFlagsAndWidth({CamelCase(field.Name)});"); 315WriteLine($"this.{CamelCase(field.Name)} = {CamelCase(field.Name)};"); 321WriteLine($"this.{CamelCase(field.Name)} = {CamelCase(field.Name)};"); 332node.Fields.Select(f => $"this.{CamelCase(f.Name)}"), 345node.Fields.Select(f => $"this.{CamelCase(f.Name)}"), 391return $"{type} {CamelCase(f.Name)}"; 404Write($"{CamelCase(field.Name)} != this.{field.Name}"); 415node.Fields.Select(f => CamelCase(f.Name)))); 460return $"VisitList(node.{f.Name})"; 462return $"({f.Type})Visit(node.{f.Name})"; 464return $"node.{f.Name}"; 539var pname = CamelCase(field.Name); 543WriteLine($"if ({CamelCase(field.Name)} == null) throw new ArgumentNullException(nameof({CamelCase(field.Name)}));"); 549WriteLine($"if ({CamelCase(field.Name)} != null)"); 664return $"{type} {CamelCase(f.Name)}"; 674? $"{CamelCase(f.Name)}.Node" 675: CamelCase(f.Name)), 677valueFields.Select(f => CamelCase(f.Name)), 723WriteLine($"{"public"} abstract {(IsNew(field) ? "new " : "")}{fieldType} {field.Name} {{ get; }}"); 724WriteLine($"public {node.Name} With{field.Name}({fieldType} {CamelCase(field.Name)}) => With{field.Name}Core({CamelCase(field.Name)});"); 725WriteLine($"internal abstract {node.Name} With{field.Name}Core({fieldType} {CamelCase(field.Name)});"); 731WriteLine($"public {node.Name} Add{field.Name}(params {argType}[] items) => Add{field.Name}Core(items);"); 732WriteLine($"internal abstract {node.Name} Add{field.Name}Core(params {argType}[] items);"); 746WriteLine($"public {node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items) => Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(items);"); 747WriteLine($"internal abstract {node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(params {argType}[] items);"); 759WriteLine($"{"public"} abstract {(IsNew(field) ? "new " : "")}{field.Type} {field.Name} {{ get; }}"); 773WriteLine($"public new {node.Name} With{baseField.Name}({GetRedFieldType(baseField)} {CamelCase(baseField.Name)}) => ({node.Name})With{baseField.Name}Core({CamelCase(baseField.Name)});"); 782WriteLine($"public new {node.Name} Add{baseField.Name}(params {argType}[] items) => ({node.Name})Add{baseField.Name}Core(items);"); 797WriteLine($"public new {baseType.Name} Add{StripPost(baseField.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items) => Add{StripPost(baseField.Name, "Opt")}{referencedNodeField.Name}Core(items);"); 834WriteLine($"private SyntaxNode? {CamelCase(field.Name)};"); 839WriteLine($"private {type} {CamelCase(field.Name)};"); 859Write($"public {OverrideOrNewModifier(field)}{GetRedPropertyType(field)} {field.Name}"); 866WriteLine($"var slot = ((Syntax.InternalSyntax.{node.Name})this.Green).{CamelCase(field.Name)};"); 873WriteLine($" => new SyntaxToken(this, ((InternalSyntax.{node.Name})this.Green).{CamelCase(field.Name)}, {GetChildPosition(i)}, {GetChildIndex(i)});"); 879WriteLine($"public {OverrideOrNewModifier(field)}SyntaxTokenList {field.Name}"); 891Write($"public {OverrideOrNewModifier(field)}{GetRedPropertyType(field)} {field.Name}"); 895WriteLine($" => new {field.Type}(GetRed(ref this.{CamelCase(field.Name)}, {i}));"); 904WriteLine($"var red = GetRed(ref this.{CamelCase(field.Name)}, {i});"); 918WriteLine($" => GetRedAtZero(ref this.{CamelCase(field.Name)}){suffix};"); 922WriteLine($" => GetRed(ref this.{CamelCase(field.Name)}, {i}){suffix};"); 932WriteLine($"{"public"} {OverrideOrNewModifier(field)}{field.Type} {field.Name} => ((InternalSyntax.{node.Name})this.Green).{field.Name};"); 950? $"GetRedAtZero(ref this.{CamelCase(field.Name)})" 951: $"GetRed(ref this.{CamelCase(field.Name)}, {index})"; 967WriteLine($"{index} => GetRedAtZero(ref this.{CamelCase(field.Name)}){suffix},"); 971WriteLine($"{index} => GetRed(ref this.{CamelCase(field.Name)}, {index}){suffix},"); 995WriteLine($" => index == {index} ? this.{CamelCase(field.Name)} : null;"); 1005WriteLine($"{index} => this.{CamelCase(field.Name)},"); 1083node.Fields.Select(f => $"{GetRedPropertyType(f)} {CamelCase(f.Name)}"))); 1095Write($"{CamelCase(field.Name)} != this.{field.Name}"); 1106node.Fields.Select(f => CamelCase(f.Name)))); 1132var (baseType, baseField) = GetHighestBaseTypeWithField(node, field.Name); 1135Write($"internal override {baseType.Name} With{field.Name}Core({GetRedPropertyType(baseField)} {CamelCase(field.Name)}) => With{field.Name}({CamelCase(field.Name)}"); 1138Write($" ?? throw new ArgumentNullException(nameof({CamelCase(field.Name)}))"); 1147$"public{(isNew ? " new " : " ")}{node.Name} With{StripPost(field.Name, "Opt")}({type} {CamelCase(field.Name)})" + 1152f == field ? CamelCase(f.Name) : $"this.{f.Name}"))); 1164var field = fields.FirstOrDefault(f => f.Name == name); 1238var (baseType, baseField) = GetHighestBaseTypeWithField(node, field.Name); 1242WriteLine($"internal override {baseType.Name} Add{field.Name}Core(params {baseArgType}[] items) => Add{field.Name}(items);"); 1247WriteLine($"public{(isNew ? " new " : " ")}{node.Name} Add{field.Name}(params {argType}[] items) => With{StripPost(field.Name, "Opt")}(this.{field.Name}.AddRange(items));"); 1257var (baseType, _) = GetHighestBaseTypeWithField(node, field.Name); 1260WriteLine($"internal override {baseType.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(params {argType}[] items) => Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(items);"); 1266Write($"public{(isNew ? " new " : " ")}{node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items)"); 1273var varName = StripPost(CamelCase(field.Name), "Opt"); 1274WriteLine($"var {varName} = this.{field.Name} ?? SyntaxFactory.{factoryName}();"); 1275WriteLine($"return With{StripPost(field.Name, "Opt")}({varName}.With{StripPost(referencedNodeField.Name, "Opt")}({varName}.{referencedNodeField.Name}.AddRange(items)));"); 1280WriteLine($" => With{StripPost(field.Name, "Opt")}(this.{field.Name}.With{StripPost(referencedNodeField.Name, "Opt")}(this.{field.Name}.{referencedNodeField.Name}.AddRange(items)));"); 1312return $"VisitList(node.{f.Name})"; 1314return $"VisitToken(node.{f.Name})"; 1316return $"({(GetFieldType(f, green: false))})Visit(node.{f.Name})"; 1318return $"({(GetFieldType(f, green: false))})Visit(node.{f.Name}) ?? throw new ArgumentNullException(\"{CamelCase(f.Name)}\")"; 1321return $"node.{f.Name}"; 1447var pname = CamelCase(field.Name); 1479WriteLine($"if ({CamelCase(field.Name)} == null) throw new ArgumentNullException(nameof({CamelCase(field.Name)}));"); 1491return $"(Syntax.InternalSyntax.SyntaxToken?){CamelCase(f.Name)}.Node"; 1494return $"(Syntax.InternalSyntax.SyntaxToken){CamelCase(f.Name)}.Node!"; 1497return $"{CamelCase(f.Name)}.Node.ToGreenList<Syntax.InternalSyntax.SyntaxToken>()"; 1499return $"{CamelCase(f.Name)}.Node.ToGreenList<Syntax.InternalSyntax.{GetElementType(f.Type)}>()"; 1501return $"{CamelCase(f.Name)}.Node.ToGreenSeparatedList<Syntax.InternalSyntax.{GetElementType(f.Type)}>()"; 1503return $"{CamelCase(f.Name)}.Node.ToGreenList<Syntax.InternalSyntax.CSharpSyntaxNode>()"; 1505return $"{CamelCase(f.Name)} == null ? null : (Syntax.InternalSyntax.{f.Type}){CamelCase(f.Name)}.Green"; 1507return $"(Syntax.InternalSyntax.{f.Type}){CamelCase(f.Name)}.Green"; 1510valueFields.Select(f => CamelCase(f.Name)))); 1520nd.Fields.Select(f => $"{this.GetRedPropertyType(f)} {CamelCase(f.Name)}"))); 1550return $"SyntaxFactory.Token(Get{StripPost(nd.Name, "Syntax")}{StripPost(field.Name, "Opt")}Kind(kind))"; 1568WriteLine($"private static SyntaxKind Get{StripPost(nd.Name, "Syntax")}{StripPost(field.Name, "Opt")}Kind(SyntaxKind kind)"); 1613f => $"{GetRedPropertyType(f)} {CamelCase(f.Name)}"))); 1620? CamelCase(f.Name) 1651return f.Name is "AttributeLists" or "Modifiers"; 1710return $"{type} {CamelCase(f.Name)}"; 1717return $"{type} {CamelCase(f.Name)} = default"; 1733return $"{GetStringConverterMethod(f)}({CamelCase(f.Name)})"; 1735return CamelCase(f.Name); 1740return CamelCase(f.Name); 1742return $"{CamelCase(f.Name)} ?? {GetDefaultValue(nd, f)}";
TestWriter.cs (14)
158Write($"{syntaxFactory}.Identifier(\"{field.Name}\")"); 179Write($"{syntaxFactory}.IdentifierName({syntaxFactory}.Identifier(\"{field.Name}\"))"); 251WriteLine($"Assert.Equal(SyntaxKind.None, node.{field.Name}.Kind());"); 255WriteLine($"Assert.Null(node.{field.Name});"); 263WriteLine($"Assert.Equal(SyntaxKind.{kind}, node.{field.Name}.Kind());"); 267WriteLine($"Assert.Equal(SyntaxKind.{kind}, node.{field.Name}.Kind);"); 274WriteLine($"Assert.NotEqual(default, node.{field.Name});"); 281WriteLine($"Assert.Equal(default, node.{field.Name});"); 285WriteLine($"Assert.NotNull(node.{field.Name});"); 291withStat += $".With{field.Name}(node.{field.Name})"; 297WriteLine($"Assert.Equal(new {field.Type}(), node.{field.Name});"); 300withStat += $".With{field.Name}(node.{field.Name})";