diff --git a/CLAUDE.md b/CLAUDE.md index 50f416ca77..54894f569f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -41,6 +41,7 @@ Any change that affects generated output **must** be covered by a JSON or JSON S - JSON inputs live in `test/inputs/json/`. `priority/` and `samples/` form the default input set; `misc/` is omitted under `QUICKTEST` and for languages with `skipMiscJSON`. Per-language `skipJSON` and `includeJSON` settings can further restrict inputs. - JSON Schema inputs live in `test/inputs/schema/`. A `*.schema` can have a same-basename `.json` sample and numbered `.N.json` samples. Numbered `.N.fail..json` files are expected failures for languages that declare that feature; `.N.fail.json` files apply regardless of features. An expected-failure sample must make the generated program exit nonzero. +- `test/inputs/json/priority/keywords.json`, `test/inputs/schema/keyword-enum.schema`, and `test/inputs/schema/keyword-unions.schema` are generated by `test/make-keyword-tests.sh` from `test/keywords.txt`. Never edit them directly: add the keyword to `test/keywords.txt`, optionally followed by a tab and a JSON value for the JSON sample, then regenerate. - New schema fixture tests should have at least one positive and one negative test case unless there is a compelling reason not to. - Per-language configuration—input filters, renderer options, and `features`—lives in `test/languages.ts`. - Fixtures and their filter names are registered in `test/fixtures.ts`; driver programs live in `test/fixtures//`. diff --git a/packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts b/packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts index fbbe95461c..fedb7c7371 100644 --- a/packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts +++ b/packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts @@ -40,6 +40,16 @@ import { noFollow, } from "./utils.js"; +const objectMemberNames = [ + "ToString", + "GetHashCode", + "Finalize", + "Equals", + "GetType", + "MemberwiseClone", + "ReferenceEquals", +]; + export class CSharpRenderer extends ConvenienceRenderer { public constructor( targetLanguage: TargetLanguage, @@ -73,13 +83,7 @@ export class CSharpRenderer extends ConvenienceRenderer { return { names: [ classNamed, - "ToString", - "GetHashCode", - "Finalize", - "Equals", - "GetType", - "MemberwiseClone", - "ReferenceEquals", + ...objectMemberNames, ...(this._csOptions.useRecords ? ["Clone", "EqualityContract", "PrintMembers"] : []), @@ -92,7 +96,10 @@ export class CSharpRenderer extends ConvenienceRenderer { _: UnionType, unionNamed: Name, ): ForbiddenWordsInfo { - return { names: [unionNamed], includeGlobalForbidden: true }; + return { + names: [unionNamed, ...objectMemberNames], + includeGlobalForbidden: true, + }; } protected makeNamedTypeNamer(): Namer { diff --git a/test/inputs/json/priority/keywords.json b/test/inputs/json/priority/keywords.json index b98721c9c8..46ff689bae 100644 --- a/test/inputs/json/priority/keywords.json +++ b/test/inputs/json/priority/keywords.json @@ -61,19 +61,19 @@ "CultureInfo": { "CultureInfo": 123 }, "date": { "date": 123 }, "date_parse_handling": { "date_parse_handling": 123 }, + "DateFormatter": { "DateFormatter": 123 }, "DateOnly": { "DateOnly": 123 }, "DateOnlyConverter": { "DateOnlyConverter": 123 }, + "dummy": 123 + }, + "obj2": { "DateTime": { "DateTime": "2001-02-03T04:05:06Z" }, - "DateFormatter": { "DateFormatter": 123 }, "DateTimeStyles": { "DateTimeStyles": 123 }, "debugger": { "debugger": 123 }, "decimal": { "decimal": 123 }, "declare": { "declare": 123 }, "decltype": { "decltype": 123 }, "decode_string": { "decode_string": 123 }, - "dummy": 123 - }, - "obj2": { "def": { "def": 123 }, "default": { "default": 123 }, "defer": { "defer": 123 }, @@ -89,11 +89,11 @@ "dynamic": { "dynamic": 123 }, "dynamic_cast": { "dynamic_cast": 123 }, "elif": { "elif": 123 }, - "equalityContract": { "equalityContract": 123 }, "else": { "else": 123 }, "encode_quick_type": { "encode_quick_type": 123 }, "enum": { "enum": 123 }, "EnumValues": { "EnumValues": ["ready", "done", "ready", "done", "ready", "done", "ready", "done", "ready", "done"] }, + "equalityContract": { "equalityContract": 123 }, "event": { "event": 123 }, "except": { "except": 123 }, "exception": { "exception": 123 }, @@ -131,6 +131,9 @@ "IMP": { "IMP": 123 }, "implements": { "implements": 123 }, "implicit": { "implicit": 123 }, + "dummy": 123 + }, + "obj3": { "import": { "import": 123 }, "in": { "in": 123 }, "indirect": { "indirect": 123 }, @@ -142,26 +145,26 @@ "int": { "int": 123 }, "interface": { "interface": 123 }, "internal": { "internal": 123 }, - "dummy": 123 - }, - "obj3": { + "IsoDateTimeOffsetConverter": { "IsoDateTimeOffsetConverter": 123 }, "iterable": { "iterable": 123 }, "is": { "is": 123 }, - "IsoDateTimeOffsetConverter": { "IsoDateTimeOffsetConverter": 123 }, "jdec": { "jdec": 123 }, "jenc": { "jenc": 123 }, "jpipe": { "jpipe": 123 }, "json": { "json": 123 }, - "JSONAny": { "JSONAny": null }, - "JSONCodingKey": { "JSONCodingKey": 123 }, - "JSONDecoder": { "JSONDecoder": 123 }, - "JSONEncoder": { "JSONEncoder": 123 }, - "JSONNull": { "JSONNull": 123 }, "json_converter": { "json_converter": 123 }, "json_serializer": { "json_serializer": 123 }, "json_token": { "json_token": 123 }, "json_writer": { "json_writer": 123 }, + "JSONAny": { "JSONAny": null }, + "JSONCodingKey": { "JSONCodingKey": 123 }, + "JSONDecoder": { "JSONDecoder": 123 }, + "JSONEncoder": { "JSONEncoder": 123 }, "JsonException": { "JsonException": 123 }, + "JsonGenerator": { "JsonGenerator": 123 }, + "JsonNode": { "JsonNode": 123 }, + "JSONNull": { "JSONNull": 123 }, + "JsonParser": { "JsonParser": 123 }, "JsonReader": { "JsonReader": 123 }, "JsonTokenType": { "JsonTokenType": 123 }, "lambda": { "lambda": 123 }, @@ -180,7 +183,6 @@ "native": { "native": 123 }, "new": { "new": 123 }, "newtonsoft": { "newtonsoft": 123 }, - "NSError": { "NSError": 123 }, "nil": { "nil": 123 }, "NO": { "NO": 123 }, "noexcept": { "noexcept": 123 }, @@ -192,20 +194,17 @@ "noSuchMethod": { "noSuchMethod": 123 }, "not": { "not": 123 }, "not_eq": { "not_eq": 123 }, + "NSError": { "NSError": 123 }, "NSString": { "NSString": 123 }, "NULL": { "NULL": 123 }, "null": { "null": 123 }, + "dummy": 123 + }, + "obj4": { "nullptr": { "nullptr": 123 }, "number": { "number": 123 }, "object": { "object": 123 }, - "JsonGenerator": { "JsonGenerator": 123 }, - "JsonNode": { "JsonNode": 123 }, - "JsonParser": { "JsonParser": 123 }, "ObjectMapper": { "ObjectMapper": 123 }, - "SerializerProvider": { "SerializerProvider": 123 }, - "SimpleModule": { "SimpleModule": 123 }, - "StdDeserializer": { "StdDeserializer": 123 }, - "StdSerializer": { "StdSerializer": 123 }, "of": { "of": 123 }, "oneway": { "oneway": 123 }, "open": { "open": 123 }, @@ -229,9 +228,6 @@ "protected": { "protected": 123 }, "Protocol": { "Protocol": 123 }, "protocol": { "protocol": 123 }, - "dummy": 123 - }, - "obj4": { "public": { "public": 123 }, "quicktype": { "quicktype": 123 }, "raise": { "raise": 123 }, @@ -251,23 +247,30 @@ "return": { "return": 123 }, "right": { "right": 123 }, "runtimeType": { "runtimeType": 123 }, - "sbyte": { "sbyte": 123 }, "s": { "s": 123 }, + "sbyte": { "sbyte": 123 }, "sealed": { "sealed": 123 }, "SEL": { "SEL": 123 }, "select": { "select": 123 }, "Self": { "Self": 123 }, "self": { "self": 123 }, "serialize": { "serialize": 123 }, + "SerializerProvider": { "SerializerProvider": 123 }, "set": { "set": 123 }, "short": { "short": 123 }, "signed": { "signed": 123 }, + "SimpleModule": { "SimpleModule": 123 }, "sizeof": { "sizeof": 123 }, "stackalloc": { "stackalloc": 123 }, "Standards": { "Standards": 123 }, "static": { "static": 123 }, "static_assert": { "static_assert": 123 }, + "dummy": 123 + }, + "obj5": { "static_cast": { "static_cast": 123 }, + "StdDeserializer": { "StdDeserializer": 123 }, + "StdSerializer": { "StdSerializer": 123 }, "strictfp": { "strictfp": 123 }, "string": { "string": 123 }, "struct": { "struct": 123 }, @@ -283,10 +286,10 @@ "thread_local": { "thread_local": 123 }, "throw": { "throw": 123 }, "throws": { "throws": 123 }, - "to_json": { "to_json": 123 }, - "top_level": { "top_level": 123 }, "TimeOnly": { "TimeOnly": 123 }, "TimeOnlyConverter": { "TimeOnlyConverter": 123 }, + "to_json": { "to_json": 123 }, + "top_level": { "top_level": 123 }, "toString": { "toString": 123 }, "transient": { "transient": 123 }, "True": { "True": 123 }, @@ -303,10 +306,6 @@ "ulong": { "ulong": 123 }, "unchecked": { "unchecked": 123 }, "undefined": { "undefined": 123 }, - "dummy": 123 - }, - "obj5": { - "UUID": { "UUID": 123 }, "union": { "union": 123 }, "unowned": { "unowned": 123 }, "unsafe": { "unsafe": 123 }, @@ -315,6 +314,7 @@ "using": { "using": 123 }, "Utf8JsonReader": { "Utf8JsonReader": 123 }, "Utf8JsonWriter": { "Utf8JsonWriter": 123 }, + "UUID": { "UUID": 123 }, "var": { "var": 123 }, "virtual": { "virtual": 123 }, "void": { "void": 123 }, diff --git a/test/inputs/schema/keyword-enum.schema b/test/inputs/schema/keyword-enum.schema index 80968e4fdc..1223854523 100644 --- a/test/inputs/schema/keyword-enum.schema +++ b/test/inputs/schema/keyword-enum.schema @@ -47,6 +47,7 @@ "checked", "class", "Class", + "clone", "co_await", "co_return", "co_yield", @@ -61,8 +62,14 @@ "convenience", "convert", "converter", + "CultureInfo", "date", "date_parse_handling", + "DateFormatter", + "DateOnly", + "DateOnlyConverter", + "DateTime", + "DateTimeStyles", "debugger", "decimal", "declare", @@ -86,6 +93,8 @@ "else", "encode_quick_type", "enum", + "EnumValues", + "equalityContract", "event", "except", "exception", @@ -105,6 +114,7 @@ "float", "for", "foreach", + "FormatException", "friend", "from", "from_json", @@ -115,6 +125,7 @@ "go", "goto", "guard", + "hashCode", "hasOwnProperty", "id", "if", @@ -132,6 +143,7 @@ "int", "interface", "internal", + "IsoDateTimeOffsetConverter", "iterable", "is", "jdec", @@ -142,6 +154,17 @@ "json_serializer", "json_token", "json_writer", + "JSONAny", + "JSONCodingKey", + "JSONDecoder", + "JSONEncoder", + "JsonException", + "JsonGenerator", + "JsonNode", + "JSONNull", + "JsonParser", + "JsonReader", + "JsonTokenType", "lambda", "lazy", "left", @@ -166,14 +189,17 @@ "None", "nonlocal", "nonmutating", + "noSuchMethod", "not", "not_eq", + "NSError", "NSString", "NULL", "null", "nullptr", "number", "object", + "ObjectMapper", "of", "oneway", "open", @@ -192,6 +218,7 @@ "prefix", "print", "printf", + "printMembers", "private", "protected", "Protocol", @@ -202,6 +229,7 @@ "range", "readonly", "ref", + "RegExp", "register", "reinterpret_cast", "repeat", @@ -213,6 +241,8 @@ "rethrows", "return", "right", + "runtimeType", + "s", "sbyte", "sealed", "SEL", @@ -220,14 +250,19 @@ "Self", "self", "serialize", + "SerializerProvider", "set", "short", "signed", + "SimpleModule", "sizeof", "stackalloc", + "Standards", "static", "static_assert", "static_cast", + "StdDeserializer", + "StdSerializer", "strictfp", "string", "struct", @@ -243,8 +278,11 @@ "thread_local", "throw", "throws", + "TimeOnly", + "TimeOnlyConverter", "to_json", "top_level", + "toString", "transient", "True", "true", @@ -266,6 +304,9 @@ "unsigned", "ushort", "using", + "Utf8JsonReader", + "Utf8JsonWriter", + "UUID", "var", "virtual", "void", diff --git a/test/inputs/schema/keyword-unions.schema b/test/inputs/schema/keyword-unions.schema index f729f51448..b0292bfe18 100644 --- a/test/inputs/schema/keyword-unions.schema +++ b/test/inputs/schema/keyword-unions.schema @@ -302,6 +302,13 @@ ], "title": "union_Class" }, + "clone": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "clone" } + ], + "title": "union_clone" + }, "co_await": { "oneOf": [ { "type": "number" }, @@ -400,6 +407,13 @@ ], "title": "union_converter" }, + "CultureInfo": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "CultureInfo" } + ], + "title": "union_CultureInfo" + }, "date": { "oneOf": [ { "type": "number" }, @@ -414,6 +428,41 @@ ], "title": "union_date_parse_handling" }, + "DateFormatter": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "DateFormatter" } + ], + "title": "union_DateFormatter" + }, + "DateOnly": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "DateOnly" } + ], + "title": "union_DateOnly" + }, + "DateOnlyConverter": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "DateOnlyConverter" } + ], + "title": "union_DateOnlyConverter" + }, + "DateTime": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "DateTime" } + ], + "title": "union_DateTime" + }, + "DateTimeStyles": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "DateTimeStyles" } + ], + "title": "union_DateTimeStyles" + }, "debugger": { "oneOf": [ { "type": "number" }, @@ -575,6 +624,20 @@ ], "title": "union_enum" }, + "EnumValues": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "EnumValues" } + ], + "title": "union_EnumValues" + }, + "equalityContract": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "equalityContract" } + ], + "title": "union_equalityContract" + }, "event": { "oneOf": [ { "type": "number" }, @@ -708,6 +771,13 @@ ], "title": "union_foreach" }, + "FormatException": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "FormatException" } + ], + "title": "union_FormatException" + }, "friend": { "oneOf": [ { "type": "number" }, @@ -778,6 +848,13 @@ ], "title": "union_guard" }, + "hashCode": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "hashCode" } + ], + "title": "union_hashCode" + }, "hasOwnProperty": { "oneOf": [ { "type": "number" }, @@ -897,6 +974,13 @@ ], "title": "union_internal" }, + "IsoDateTimeOffsetConverter": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "IsoDateTimeOffsetConverter" } + ], + "title": "union_IsoDateTimeOffsetConverter" + }, "iterable": { "oneOf": [ { "type": "number" }, @@ -967,6 +1051,83 @@ ], "title": "union_json_writer" }, + "JSONAny": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JSONAny" } + ], + "title": "union_JSONAny" + }, + "JSONCodingKey": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JSONCodingKey" } + ], + "title": "union_JSONCodingKey" + }, + "JSONDecoder": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JSONDecoder" } + ], + "title": "union_JSONDecoder" + }, + "JSONEncoder": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JSONEncoder" } + ], + "title": "union_JSONEncoder" + }, + "JsonException": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonException" } + ], + "title": "union_JsonException" + }, + "JsonGenerator": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonGenerator" } + ], + "title": "union_JsonGenerator" + }, + "JsonNode": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonNode" } + ], + "title": "union_JsonNode" + }, + "JSONNull": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JSONNull" } + ], + "title": "union_JSONNull" + }, + "JsonParser": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonParser" } + ], + "title": "union_JsonParser" + }, + "JsonReader": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonReader" } + ], + "title": "union_JsonReader" + }, + "JsonTokenType": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "JsonTokenType" } + ], + "title": "union_JsonTokenType" + }, "lambda": { "oneOf": [ { "type": "number" }, @@ -1135,6 +1296,13 @@ ], "title": "union_nonmutating" }, + "noSuchMethod": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "noSuchMethod" } + ], + "title": "union_noSuchMethod" + }, "not": { "oneOf": [ { "type": "number" }, @@ -1149,6 +1317,13 @@ ], "title": "union_not_eq" }, + "NSError": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "NSError" } + ], + "title": "union_NSError" + }, "NSString": { "oneOf": [ { "type": "number" }, @@ -1191,6 +1366,13 @@ ], "title": "union_object" }, + "ObjectMapper": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "ObjectMapper" } + ], + "title": "union_ObjectMapper" + }, "of": { "oneOf": [ { "type": "number" }, @@ -1317,6 +1499,13 @@ ], "title": "union_printf" }, + "printMembers": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "printMembers" } + ], + "title": "union_printMembers" + }, "private": { "oneOf": [ { "type": "number" }, @@ -1387,6 +1576,13 @@ ], "title": "union_ref" }, + "RegExp": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "RegExp" } + ], + "title": "union_RegExp" + }, "register": { "oneOf": [ { "type": "number" }, @@ -1464,6 +1660,20 @@ ], "title": "union_right" }, + "runtimeType": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "runtimeType" } + ], + "title": "union_runtimeType" + }, + "s": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "s" } + ], + "title": "union_s" + }, "sbyte": { "oneOf": [ { "type": "number" }, @@ -1513,6 +1723,13 @@ ], "title": "union_serialize" }, + "SerializerProvider": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "SerializerProvider" } + ], + "title": "union_SerializerProvider" + }, "set": { "oneOf": [ { "type": "number" }, @@ -1534,6 +1751,13 @@ ], "title": "union_signed" }, + "SimpleModule": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "SimpleModule" } + ], + "title": "union_SimpleModule" + }, "sizeof": { "oneOf": [ { "type": "number" }, @@ -1548,6 +1772,13 @@ ], "title": "union_stackalloc" }, + "Standards": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "Standards" } + ], + "title": "union_Standards" + }, "static": { "oneOf": [ { "type": "number" }, @@ -1569,6 +1800,20 @@ ], "title": "union_static_cast" }, + "StdDeserializer": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "StdDeserializer" } + ], + "title": "union_StdDeserializer" + }, + "StdSerializer": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "StdSerializer" } + ], + "title": "union_StdSerializer" + }, "strictfp": { "oneOf": [ { "type": "number" }, @@ -1674,6 +1919,20 @@ ], "title": "union_throws" }, + "TimeOnly": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "TimeOnly" } + ], + "title": "union_TimeOnly" + }, + "TimeOnlyConverter": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "TimeOnlyConverter" } + ], + "title": "union_TimeOnlyConverter" + }, "to_json": { "oneOf": [ { "type": "number" }, @@ -1688,6 +1947,13 @@ ], "title": "union_top_level" }, + "toString": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "toString" } + ], + "title": "union_toString" + }, "transient": { "oneOf": [ { "type": "number" }, @@ -1835,6 +2101,27 @@ ], "title": "union_using" }, + "Utf8JsonReader": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "Utf8JsonReader" } + ], + "title": "union_Utf8JsonReader" + }, + "Utf8JsonWriter": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "Utf8JsonWriter" } + ], + "title": "union_Utf8JsonWriter" + }, + "UUID": { + "oneOf": [ + { "type": "number" }, + { "type": "object", "additionalProperties": false, "title": "UUID" } + ], + "title": "union_UUID" + }, "var": { "oneOf": [ { "type": "number" }, diff --git a/test/keywords.py b/test/keywords.py index fb88a0fc53..afe6dddec4 100755 --- a/test/keywords.py +++ b/test/keywords.py @@ -9,14 +9,17 @@ def chunks(l, n): yield l[i:i + n] with open('keywords.txt') as f: - keywords = f.read().splitlines() + entries = [(l.split('\t', 1) + ['123'])[:2] for l in f.read().splitlines()] + +keywords = [name for (name, _) in entries] +values = dict(entries) def generate_classes(): print('{') for (i, l) in enumerate(chunks(keywords, 64)): print(' "obj%d": {' % (i + 1)) for kw in l: - print(' "%s": { "%s": 123 },' % (kw, kw)) + print(' "%s": { "%s": %s },' % (kw, kw, values[kw])) print(' "dummy": 123') print(' },') print(' "dummy": 123') diff --git a/test/keywords.txt b/test/keywords.txt index 60e674f7e7..59705c41b5 100644 --- a/test/keywords.txt +++ b/test/keywords.txt @@ -41,6 +41,7 @@ char32_t checked class Class +clone co_await co_return co_yield @@ -55,8 +56,14 @@ continue convenience convert converter +CultureInfo date date_parse_handling +DateFormatter +DateOnly +DateOnlyConverter +DateTime "2001-02-03T04:05:06Z" +DateTimeStyles debugger decimal declare @@ -80,6 +87,8 @@ elif else encode_quick_type enum +EnumValues ["ready", "done", "ready", "done", "ready", "done", "ready", "done", "ready", "done"] +equalityContract event except exception @@ -99,6 +108,7 @@ fixed float for foreach +FormatException friend from from_json @@ -109,6 +119,7 @@ global go goto guard +hashCode hasOwnProperty id if @@ -126,6 +137,7 @@ instanceof int interface internal +IsoDateTimeOffsetConverter iterable is jdec @@ -136,6 +148,17 @@ json_converter json_serializer json_token json_writer +JSONAny null +JSONCodingKey +JSONDecoder +JSONEncoder +JsonException +JsonGenerator +JsonNode +JSONNull +JsonParser +JsonReader +JsonTokenType lambda lazy left @@ -160,14 +183,17 @@ none None nonlocal nonmutating +noSuchMethod not not_eq +NSError NSString NULL null nullptr number object +ObjectMapper of oneway open @@ -186,6 +212,7 @@ precedence prefix print printf +printMembers private protected Protocol @@ -196,6 +223,7 @@ raise range readonly ref +RegExp "550e8400-e29b-41d4-a716-446655440000" register reinterpret_cast repeat @@ -207,6 +235,8 @@ retain rethrows return right +runtimeType +s sbyte sealed SEL @@ -214,14 +244,19 @@ select Self self serialize +SerializerProvider set short signed +SimpleModule sizeof stackalloc +Standards static static_assert static_cast +StdDeserializer +StdSerializer strictfp string struct @@ -237,8 +272,11 @@ this thread_local throw throws +TimeOnly +TimeOnlyConverter to_json top_level +toString transient True true @@ -260,6 +298,9 @@ unsafe unsigned ushort using +Utf8JsonReader +Utf8JsonWriter +UUID var virtual void