public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create((object)"a {}"), new string[1] { "" })); }
public FmtToken Format() { var b = FmtToken.Concat( this.IsParams ? "params " : "", this.Name, ": ", this.Type ) .WithTokenNames("isParams", "name", "", "type"); if (this.HasDefaultValue) { string def; if (this.DefaultValue == null) { def = this.Type.IsReferenceType == true ? "null" : "default"; } else { def = this.DefaultValue.ToString(); } b = FmtToken.Concat(b, " = ", def).WithTokenNames(null, "hasDefaultValue", "defaultValue"); } return(b); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[9] { "MyType {f1 = ", F1, ", f2 = ", F2, ", f3 = ", F3, ", f4 = ", F4, "}" }), new string[9] { "", "f1", "", "f2", "", "f3", "", "f4", "" })); }
public override FmtToken Format(FmtToken directives) => FmtToken.Concat( directives, "{", FmtToken.Block(Fields.Select(f => FmtToken.Concat(f.Format(), ","))) .WithIntegerTokenMap(), "}" ).WithTokenNames(null, "", "core", "");
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create((object)"a {a = ", (object)A2, (object)"}"), new string[3] { "", "a", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create((object)"B {propB = ", (object)PropB, (object)"}"), new string[3] { "", "propB", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create((object)"a {h = ", (object)FmtToken.FormatArray(H), (object)"}"), new string[3] { "", "h", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create((object)"CustomValidatorTest {f1 = ", (object)F1, (object)"}"), new string[3] { "", "f1", "" })); }
public override FmtToken Format(FmtToken directives) => FmtToken.Concat( Implements.Length > 0 ? FmtToken.Concat(" implements ", FmtToken.Concat(Implements.Select(f => FmtToken.Concat(f, " "))).WithIntegerTokenMap()) : "", directives, "{", FmtToken.Block(Fields.Select(f => FmtToken.Concat(f, ","))) .WithIntegerTokenMap(), "}" ) .WithTokenNames("core.implements", null, "", "core.fields", "");
public FmtToken Format(string rootType) { if (Entities.Length >= 0 && Types.Any(t => t.Name == rootType)) { throw new InvalidOperationException($"Type with name '{rootType}' already exists in the schema so it can't be root type."); } return(FmtToken.Block( FmtToken.Block(Types).WithIntegerTokenMap(), Entities.Length == 0 && rootType != null ? "" : FmtToken.Concat("type ", rootType, "{", FmtToken.Block(Entities).WithIntegerTokenMap(), "}") ) .WithTokenNames( "types", "entities" )); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[5] { "A {propA = ", PropA, ", propAX = ", PropAX, "}" }), new string[5] { "", "propA", "", "propAX", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[5] { "a {h = ", H, ", H = ", H2, "}" }), new string[5] { "", "h", "", "H", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[5] { "Test123 {Field543 = ", FmtToken.FormatArray(Field543), ", abcSS = ", AbcSS, "}" }), new string[5] { "", "Field543", "", "abcSS", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[5] { "T {a = ", A, ", b = ", FmtToken.FormatArray(B), "}" }), new string[5] { "", "a", "", "b", "" })); }
public FmtToken Format() { return(FmtToken.Concat(ImmutableArray.Create(new object[15] { "Composite123 {StringF = ", StringF, ", NullableStringF = ", NullableStringF, ", NullableIntF = ", NullableIntF, ", IntF = ", IntF, ", FloatF = ", FloatF, ", NullListF = ", FmtToken.FormatArray(NullListF), ", ThisF = ", ThisF, "}" }), new string[15] { "", "StringF", "", "NullableStringF", "", "NullableIntF", "", "IntF", "", "FloatF", "", "NullListF", "", "ThisF", "" })); }
FmtToken FormatDirectives() => FmtToken.Concat(Directives.Select(d => FmtToken.Concat(" ", d.Format())));
public override FmtToken Format(FmtToken directives) => FmtToken.Concat( directives, "= ", FmtToken.Join(" | ", Options, FmtToken.IntegerTokenMap()) ).WithTokenNames(null, "", "core.options");
private FmtToken FormatDirectives() => FmtToken.Concat(Directives.Select(d => FmtToken.Concat(" ", d))) .WithIntegerTokenMap();
public FmtToken Format() => FmtToken.Concat(this.Type, "[" + new string(',', this.Dimensions - 1) + "]") .WithTokenNames(new [] { "type", "" });
public FmtToken Format() => FmtToken.Concat(Name, ": ", Type, FormatDirectives()) .WithTokenNames("name", "", "type", "directives");
public FmtToken Format() => Args.Count == 0 ? FmtToken.Concat("@", Name) : FmtToken.Concat("@", Name, "(", FormatArgs(), ")") .WithTokenNames("", "name", "", "args", "");
private FmtToken FormatArgs() => FmtToken.Join(", ", Args.Properties().Select(p => FmtToken.Concat(p.Name, ": ", FormatArg(p.Value))), FmtToken.IntegerTokenMap());
public override FmtToken Format() => FmtToken.Concat( ImmutableArray.Create <object>("[", Type, "]"), new [] { "", "type", "" } );
public FmtToken Format() => Parent == Global || Parent == null ? Name : FmtToken.Concat(Parent, ".", Name).WithTokenNames("parent", "", "name");
FmtToken FormatDirectives() => FmtToken.Concat(Directives.Select(d => FmtToken.Concat(d, " "))) .WithIntegerTokenMap() .Name("directives");
public FmtToken Format() => this.TypeArguments.IsEmpty ? FmtToken.Single(this.Type, "type") : FmtToken.Concat(this.Type, FmtToken.FormatArray(this.TypeArguments, "<", ">")) .WithTokenNames("type", "genericParameters");
public FmtToken Format() => FmtToken.Concat(Keyword(), " ", Name, " ", Core.Format(FormatDirectives())) .WithTokenNames("core", "", "name", "", null);
public FmtToken Format() => FmtToken.Concat(Name, "(id: ID): ", Type, "?", FormatDirectives());