BoundNodeClassWriter.cs (52)
426select mostSpecific.Type + " " + ToCamelCase(field.Name));
494select ToCamelCase(field.Name) + " As " + field.Type);
572select mostSpecific.Type + " " + ToCamelCase(field.Name));
614select ToCamelCase(field.Name) + " As " + field.Type);
670bool useIsDefaultProperty = GetGenericType(field.Type) is "ImmutableArray" or "OneOrMany";
759return AllFields(node).Where(field => IsDerivedOrListOfDerived("BoundNode", field.Type));
769return AllFields(node).Where(field => TypeIsSymbol(field) || (IsImmutableArray(field.Type, out var elementType) && TypeIsSymbol(elementType)));
778if (_targetLang == TargetLanguage.CSharp && (f.Null.ToUpperInvariant() is ("ALLOW" or "ALWAYS")) && !f.Type.EndsWith('?') && !IsValueType(f.Type))
800if (f.Type.EndsWith('?'))
806else if (!IsValueType(f.Type) || GetGenericType(f.Type) == "ImmutableArray")
830WriteLine("public override {0}{1} {2} {{ get; }}", (IsNew(field) ? "new " : ""), field.Type, field.Name);
842WriteLine($"public new {field.Type} {field.Name} => base.{field.Name}{suppression};");
846WriteLine("public {0}{1} {2} {{ get; }}", (IsNew(field) ? "new " : ""), field.Type, field.Name);
852WriteLine("Private {0}ReadOnly _{2} As {1}", (IsNew(field) ? "Shadows " : ""), field.Type, field.Name);
853WriteLine("Public {0}ReadOnly Property {2} As {1}", (IsNew(field) ? "Shadows " : IsPropertyOverrides(field) ? "Overrides " : ""), field.Type, field.Name);
953Comma(AllSpecifiableFields(node), field => string.Format("{0} {1}", GetField(node, field.Name).Type, ToCamelCase(field.Name)));
987if (IsValueType(field.Type) && field.Type[^1] == '?')
990if (GetGenericType(field.Type) == "OneOrMany")
1002Comma(AllSpecifiableFields(node), field => string.Format("{1} As {0}", field.Type, ToCamelCase(field.Name)));
1032if (!IsValueType(field.Type))
1035if (GetGenericType(field.Type) == "OneOrMany")
1042private static bool TypeIsTypeSymbol(Field field) => field.Type.TrimEnd('?') == "TypeSymbol";
1044private static bool TypeIsSymbol(Field field) => TypeIsSymbol(field.Type);
1179var fields = AllFields(node).Where(f => IsDerivedOrListOfDerived("BoundNode", f.Type) && !SkipInVisitor(f));
1189WriteLine("this.Visit{1}(node.{0});", field.Name, IsNodeList(field.Type) ? "List" : "");
1209foreach (Field field in AllFields(node).Where(f => IsDerivedOrListOfDerived("BoundNode", f.Type) && !SkipInVisitor(f)))
1210WriteLine("Me.Visit{1}(node.{0})", field.Name, IsNodeList(field.Type) ? "List" : "");
1250if (IsDerivedType("BoundNode", field.Type))
1252else if (IsListOfDerived("BoundNode", field.Type))
1254if (IsImmutableArray(field.Type, out _) && FieldNullHandling(node, field.Name) == NullHandling.Disallow)
1323if (IsDerivedType("BoundNode", field.Type))
1325else if (IsListOfDerived("BoundNode", field.Type))
1387ParenList(AllSpecifiableFields(node), field => IsDerivedOrListOfDerived("BoundNode", field.Type) || TypeIsTypeSymbol(field) ? ToCamelCase(field.Name) : string.Format("node.{0}", field.Name));
1429ParenList(AllSpecifiableFields(node), field => IsDerivedOrListOfDerived("BoundNode", field.Type) || field.Type == "TypeSymbol" ? ToCamelCase(field.Name) : string.Format("node.{0}", field.Name));
1501WriteLine($"{field.Type} {ToCamelCase(field.Name)} = GetUpdatedSymbol(node, node.{field.Name});");
1506WriteLine($"{field.Type} {ToCamelCase(field.Name)} = GetUpdatedArray(node, node.{field.Name});");
1576else if (IsDerivedOrListOfDerived("BoundNode", field.Type))
1610return typeIsUpdated(f.Type);
1614=> IsImmutableArray(field.Type, out var elementType) && TypeIsSymbol(elementType) && typeIsUpdated(elementType);
1869WriteLine($"{field.Type} {ToCamelCase(field.Name)} = node.{field.Name};");
1871else if (IsNodeList(field.Type))
1873WriteLine($"{field.Type} {ToCamelCase(field.Name)} = this.VisitList(node.{field.Name});");
1877WriteLine($"{field.Type} {ToCamelCase(field.Name)} = ({field.Type})this.Visit(node.{field.Name});");
1885WriteLine("Dim {0} As {2} = node.{1}", ToCamelCase(field.Name), field.Name, field.Type);
1887else if (IsNodeList(field.Type))
1889WriteLine("Dim {0} As {2} = Me.VisitList(node.{1})", ToCamelCase(field.Name), field.Name, field.Type);
1893WriteLine("Dim {0} As {2} = DirectCast(Me.Visit(node.{1}), {2})", ToCamelCase(field.Name), field.Name, field.Type);