typia 13.0.0-dev.20260430 → 13.0.0-dev.20260502-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/executable/TypiaGenerateWizard.js +55 -8
- package/lib/executable/TypiaGenerateWizard.js.map +1 -1
- package/lib/executable/TypiaGenerateWizard2.mjs +55 -8
- package/lib/executable/TypiaGenerateWizard2.mjs.map +1 -1
- package/lib/executable/generate/ttsc.js.map +1 -1
- package/lib/executable/setup/PluginConfigurator.js.map +1 -1
- package/lib/internal/_randomInteger.js.map +1 -1
- package/lib/internal/_validateReport.js.map +1 -1
- package/lib/transform.d.ts +2 -13
- package/lib/transform.js +4 -11
- package/lib/transform.js.map +1 -1
- package/lib/transform2.mjs +6 -14
- package/lib/transform2.mjs.map +1 -1
- package/native/adapter/adapter.go +128 -128
- package/native/adapter/cleanup.go +155 -172
- package/native/adapter/imports.go +80 -80
- package/native/adapter/visit.go +142 -142
- package/native/cmd/ttsc-typia/build.go +223 -223
- package/native/cmd/ttsc-typia/main.go +57 -57
- package/native/cmd/ttsc-typia/transform.go +421 -254
- package/native/cmd/ttsc-typia/transform_test.go +40 -0
- package/native/core/context/IProgrammerProps.go +7 -7
- package/native/core/context/ITransformOptions.go +5 -5
- package/native/core/context/ITypiaContext.go +13 -13
- package/native/core/context/TransformerError.go +81 -81
- package/native/core/factories/CommentFactory.go +9 -9
- package/native/core/factories/ExpressionFactory.go +254 -254
- package/native/core/factories/FormatCheatSheet.go +23 -23
- package/native/core/factories/IdentifierFactory.go +130 -130
- package/native/core/factories/JsonMetadataFactory.go +129 -129
- package/native/core/factories/LiteralFactory.go +195 -182
- package/native/core/factories/MetadataCommentTagFactory.go +379 -379
- package/native/core/factories/MetadataFactory.go +462 -462
- package/native/core/factories/MetadataTypeTagFactory.go +498 -498
- package/native/core/factories/MetadataTypeTagSchemaFactory.go +102 -102
- package/native/core/factories/NumericRangeFactory.go +84 -84
- package/native/core/factories/ProtobufFactory.go +933 -933
- package/native/core/factories/StatementFactory.go +72 -72
- package/native/core/factories/TemplateFactory.go +57 -57
- package/native/core/factories/TypeFactory.go +125 -125
- package/native/core/factories/ValueFactory.go +12 -12
- package/native/core/factories/internal/metadata/IMetadataIteratorProps.go +35 -35
- package/native/core/factories/internal/metadata/MetadataHelper.go +176 -176
- package/native/core/factories/internal/metadata/emend_metadata_atomics.go +69 -69
- package/native/core/factories/internal/metadata/emplace_metadata_alias.go +27 -27
- package/native/core/factories/internal/metadata/emplace_metadata_array_type.go +33 -33
- package/native/core/factories/internal/metadata/emplace_metadata_object.go +209 -209
- package/native/core/factories/internal/metadata/emplace_metadata_tuple.go +50 -50
- package/native/core/factories/internal/metadata/explore_metadata.go +29 -29
- package/native/core/factories/internal/metadata/iterate_metadata.go +46 -46
- package/native/core/factories/internal/metadata/iterate_metadata_alias.go +25 -25
- package/native/core/factories/internal/metadata/iterate_metadata_array.go +65 -65
- package/native/core/factories/internal/metadata/iterate_metadata_atomic.go +49 -49
- package/native/core/factories/internal/metadata/iterate_metadata_coalesce.go +22 -22
- package/native/core/factories/internal/metadata/iterate_metadata_collection.go +228 -228
- package/native/core/factories/internal/metadata/iterate_metadata_comment_tags.go +12 -12
- package/native/core/factories/internal/metadata/iterate_metadata_constant.go +71 -71
- package/native/core/factories/internal/metadata/iterate_metadata_escape.go +48 -48
- package/native/core/factories/internal/metadata/iterate_metadata_function.go +82 -82
- package/native/core/factories/internal/metadata/iterate_metadata_intersection.go +319 -319
- package/native/core/factories/internal/metadata/iterate_metadata_map.go +51 -51
- package/native/core/factories/internal/metadata/iterate_metadata_native.go +85 -85
- package/native/core/factories/internal/metadata/iterate_metadata_object.go +27 -27
- package/native/core/factories/internal/metadata/iterate_metadata_set.go +37 -37
- package/native/core/factories/internal/metadata/iterate_metadata_sort.go +137 -137
- package/native/core/factories/internal/metadata/iterate_metadata_template.go +33 -33
- package/native/core/factories/internal/metadata/iterate_metadata_tuple.go +16 -16
- package/native/core/factories/internal/metadata/iterate_metadata_union.go +18 -18
- package/native/core/programmers/AssertProgrammer.go +389 -389
- package/native/core/programmers/ImportProgrammer.go +196 -196
- package/native/core/programmers/IsProgrammer.go +293 -293
- package/native/core/programmers/RandomProgrammer.go +1094 -1094
- package/native/core/programmers/ValidateProgrammer.go +369 -369
- package/native/core/programmers/functional/FunctionalAssertFunctionProgrammer.go +133 -133
- package/native/core/programmers/functional/FunctionalAssertParametersProgrammer.go +104 -104
- package/native/core/programmers/functional/FunctionalAssertReturnProgrammer.go +100 -100
- package/native/core/programmers/functional/FunctionalIsFunctionProgrammer.go +79 -79
- package/native/core/programmers/functional/FunctionalIsParametersProgrammer.go +159 -159
- package/native/core/programmers/functional/FunctionalIsReturnProgrammer.go +99 -99
- package/native/core/programmers/functional/FunctionalValidateFunctionProgrammer.go +138 -138
- package/native/core/programmers/functional/FunctionalValidateParametersProgrammer.go +222 -222
- package/native/core/programmers/functional/FunctionalValidateReturnProgrammer.go +116 -116
- package/native/core/programmers/functional/internal/FunctionalGeneralProgrammer.go +36 -36
- package/native/core/programmers/helpers/AtomicPredicator.go +35 -35
- package/native/core/programmers/helpers/CloneJoiner.go +217 -217
- package/native/core/programmers/helpers/FunctionProgrammer.go +79 -79
- package/native/core/programmers/helpers/HttpMetadataUtil.go +17 -17
- package/native/core/programmers/helpers/ICheckEntry.go +5 -5
- package/native/core/programmers/helpers/IExpressionEntry.go +6 -6
- package/native/core/programmers/helpers/NotationJoiner.go +159 -159
- package/native/core/programmers/helpers/OptionPredicator.go +4 -4
- package/native/core/programmers/helpers/ProtobufUtil.go +231 -231
- package/native/core/programmers/helpers/ProtobufWire.go +6 -6
- package/native/core/programmers/helpers/PruneJoiner.go +227 -227
- package/native/core/programmers/helpers/RandomJoiner.go +155 -155
- package/native/core/programmers/helpers/StringifyJoinder.go +331 -331
- package/native/core/programmers/helpers/StringifyPredicator.go +10 -10
- package/native/core/programmers/helpers/UnionExplorer.go +835 -835
- package/native/core/programmers/helpers/UnionPredicator.go +78 -78
- package/native/core/programmers/helpers/disable_function_programmer_declare.go +6 -6
- package/native/core/programmers/http/HttpAssertFormDataProgrammer.go +93 -93
- package/native/core/programmers/http/HttpAssertHeadersProgrammer.go +42 -42
- package/native/core/programmers/http/HttpAssertQueryProgrammer.go +51 -51
- package/native/core/programmers/http/HttpFormDataProgrammer.go +351 -351
- package/native/core/programmers/http/HttpHeadersProgrammer.go +370 -370
- package/native/core/programmers/http/HttpIsFormDataProgrammer.go +109 -109
- package/native/core/programmers/http/HttpIsHeadersProgrammer.go +36 -36
- package/native/core/programmers/http/HttpIsQueryProgrammer.go +45 -45
- package/native/core/programmers/http/HttpParameterProgrammer.go +158 -158
- package/native/core/programmers/http/HttpQueryProgrammer.go +422 -422
- package/native/core/programmers/http/HttpValidateFormDataProgrammer.go +87 -87
- package/native/core/programmers/http/HttpValidateHeadersProgrammer.go +39 -39
- package/native/core/programmers/http/HttpValidateQueryProgrammer.go +48 -48
- package/native/core/programmers/internal/CheckerProgrammer.go +1490 -1490
- package/native/core/programmers/internal/FeatureProgrammer.go +589 -589
- package/native/core/programmers/iterate/check_array_length.go +46 -46
- package/native/core/programmers/iterate/check_bigint.go +52 -52
- package/native/core/programmers/iterate/check_dynamic_key.go +220 -220
- package/native/core/programmers/iterate/check_dynamic_properties.go +245 -245
- package/native/core/programmers/iterate/check_everything.go +21 -21
- package/native/core/programmers/iterate/check_native.go +25 -25
- package/native/core/programmers/iterate/check_number.go +135 -135
- package/native/core/programmers/iterate/check_object.go +66 -66
- package/native/core/programmers/iterate/check_string.go +52 -52
- package/native/core/programmers/iterate/check_template.go +57 -57
- package/native/core/programmers/iterate/check_union_array_like.go +372 -372
- package/native/core/programmers/iterate/decode_union_object.go +118 -118
- package/native/core/programmers/iterate/feature_object_entries.go +134 -134
- package/native/core/programmers/iterate/json_schema_alias.go +52 -52
- package/native/core/programmers/iterate/json_schema_array.go +52 -52
- package/native/core/programmers/iterate/json_schema_bigint.go +8 -8
- package/native/core/programmers/iterate/json_schema_boolean.go +8 -8
- package/native/core/programmers/iterate/json_schema_constant.go +38 -38
- package/native/core/programmers/iterate/json_schema_description.go +12 -12
- package/native/core/programmers/iterate/json_schema_discriminator.go +47 -47
- package/native/core/programmers/iterate/json_schema_escaped.go +58 -58
- package/native/core/programmers/iterate/json_schema_jsDocTags.go +34 -34
- package/native/core/programmers/iterate/json_schema_native.go +43 -43
- package/native/core/programmers/iterate/json_schema_number.go +8 -8
- package/native/core/programmers/iterate/json_schema_object.go +149 -149
- package/native/core/programmers/iterate/json_schema_plugin.go +35 -35
- package/native/core/programmers/iterate/json_schema_station.go +211 -211
- package/native/core/programmers/iterate/json_schema_string.go +8 -8
- package/native/core/programmers/iterate/json_schema_template.go +53 -53
- package/native/core/programmers/iterate/json_schema_title.go +16 -16
- package/native/core/programmers/iterate/json_schema_tuple.go +34 -34
- package/native/core/programmers/iterate/metadata_to_pattern.go +53 -53
- package/native/core/programmers/iterate/postfix_of_tuple.go +5 -5
- package/native/core/programmers/iterate/prune_object_properties.go +85 -85
- package/native/core/programmers/iterate/stringify_dynamic_properties.go +193 -193
- package/native/core/programmers/iterate/stringify_native.go +1 -1
- package/native/core/programmers/iterate/stringify_regular_properties.go +84 -84
- package/native/core/programmers/iterate/template_to_pattern.go +20 -20
- package/native/core/programmers/iterate/wrap_metadata_rest_tuple.go +13 -13
- package/native/core/programmers/json/JsonApplicationProgrammer.go +323 -323
- package/native/core/programmers/json/JsonAssertParseProgrammer.go +100 -100
- package/native/core/programmers/json/JsonAssertStringifyProgrammer.go +88 -88
- package/native/core/programmers/json/JsonIsParseProgrammer.go +130 -130
- package/native/core/programmers/json/JsonIsStringifyProgrammer.go +92 -92
- package/native/core/programmers/json/JsonSchemaProgrammer.go +65 -65
- package/native/core/programmers/json/JsonSchemasProgrammer.go +116 -116
- package/native/core/programmers/json/JsonStringifyProgrammer.go +1245 -1245
- package/native/core/programmers/json/JsonValidateParseProgrammer.go +89 -89
- package/native/core/programmers/json/JsonValidateStringifyProgrammer.go +106 -106
- package/native/core/programmers/llm/LlmApplicationProgrammer.go +449 -437
- package/native/core/programmers/llm/LlmCoerceProgrammer.go +79 -79
- package/native/core/programmers/llm/LlmControllerProgrammer.go +35 -35
- package/native/core/programmers/llm/LlmMetadataFactory.go +74 -74
- package/native/core/programmers/llm/LlmParametersProgrammer.go +105 -132
- package/native/core/programmers/llm/LlmParseProgrammer.go +88 -88
- package/native/core/programmers/llm/LlmSchemaProgrammer.go +780 -423
- package/native/core/programmers/llm/LlmStructuredOutputProgrammer.go +123 -123
- package/native/core/programmers/misc/MiscAssertCloneProgrammer.go +82 -82
- package/native/core/programmers/misc/MiscAssertPruneProgrammer.go +97 -97
- package/native/core/programmers/misc/MiscCloneProgrammer.go +1056 -1056
- package/native/core/programmers/misc/MiscIsCloneProgrammer.go +94 -94
- package/native/core/programmers/misc/MiscIsPruneProgrammer.go +86 -86
- package/native/core/programmers/misc/MiscLiteralsProgrammer.go +99 -99
- package/native/core/programmers/misc/MiscPruneProgrammer.go +700 -700
- package/native/core/programmers/misc/MiscValidateCloneProgrammer.go +103 -103
- package/native/core/programmers/misc/MiscValidatePruneProgrammer.go +94 -94
- package/native/core/programmers/notations/NotationAssertGeneralProgrammer.go +85 -85
- package/native/core/programmers/notations/NotationGeneralProgrammer.go +1188 -1188
- package/native/core/programmers/notations/NotationIsGeneralProgrammer.go +90 -90
- package/native/core/programmers/notations/NotationValidateGeneralProgrammer.go +109 -109
- package/native/core/programmers/protobuf/ProtobufAssertDecodeProgrammer.go +99 -99
- package/native/core/programmers/protobuf/ProtobufAssertEncodeProgrammer.go +114 -114
- package/native/core/programmers/protobuf/ProtobufDecodeProgrammer.go +697 -697
- package/native/core/programmers/protobuf/ProtobufEncodeProgrammer.go +1039 -1039
- package/native/core/programmers/protobuf/ProtobufIsDecodeProgrammer.go +99 -99
- package/native/core/programmers/protobuf/ProtobufIsEncodeProgrammer.go +93 -93
- package/native/core/programmers/protobuf/ProtobufMessageProgrammer.go +228 -228
- package/native/core/programmers/protobuf/ProtobufValidateDecodeProgrammer.go +88 -88
- package/native/core/programmers/protobuf/ProtobufValidateEncodeProgrammer.go +120 -120
- package/native/core/schemas/metadata/IMetadataDictionary.go +4 -4
- package/native/core/schemas/metadata/MetadataAlias.go +15 -15
- package/native/core/schemas/metadata/MetadataAliasType.go +36 -36
- package/native/core/schemas/metadata/MetadataApplication.go +25 -25
- package/native/core/schemas/metadata/MetadataArray.go +15 -15
- package/native/core/schemas/metadata/MetadataArrayType.go +31 -31
- package/native/core/schemas/metadata/MetadataAtomic.go +45 -45
- package/native/core/schemas/metadata/MetadataCollection.go +380 -380
- package/native/core/schemas/metadata/MetadataComponents.go +95 -95
- package/native/core/schemas/metadata/MetadataConstant.go +31 -31
- package/native/core/schemas/metadata/MetadataConstantValue.go +63 -63
- package/native/core/schemas/metadata/MetadataEscaped.go +17 -17
- package/native/core/schemas/metadata/MetadataFunction.go +30 -30
- package/native/core/schemas/metadata/MetadataMap.go +21 -21
- package/native/core/schemas/metadata/MetadataNative.go +48 -48
- package/native/core/schemas/metadata/MetadataObject.go +15 -15
- package/native/core/schemas/metadata/MetadataObjectType.go +116 -116
- package/native/core/schemas/metadata/MetadataParameter.go +28 -28
- package/native/core/schemas/metadata/MetadataProperty.go +32 -32
- package/native/core/schemas/metadata/MetadataSchema.go +766 -766
- package/native/core/schemas/metadata/MetadataSet.go +17 -17
- package/native/core/schemas/metadata/MetadataTemplate.go +43 -43
- package/native/core/schemas/metadata/MetadataTuple.go +10 -10
- package/native/core/schemas/metadata/MetadataTupleType.go +38 -38
- package/native/core/schemas/protobuf/IProtobufProperty.go +2 -2
- package/native/core/schemas/protobuf/IProtobufPropertyType.go +18 -18
- package/native/core/schemas/protobuf/IProtobufSchema.go +17 -17
- package/native/core/typings/Writable.go +1 -1
- package/native/core/utils/PatternUtil.go +38 -38
- package/native/core/utils/ProtobufNameEncoder.go +28 -28
- package/native/shim/printer/shim.go +213 -213
- package/native/third_party/ttsc/driver/host.go +7 -7
- package/native/third_party/ttsc/driver/program.go +275 -275
- package/native/third_party/ttsc/driver/rewrite.go +219 -219
- package/native/third_party/ttsc/shim/ast/lint.go +171 -171
- package/native/third_party/ttsc/shim/ast/shim.go +83 -83
- package/native/third_party/ttsc/shim/bundled/shim.go +5 -1
- package/native/third_party/ttsc/shim/checker/shim.go +79 -79
- package/native/third_party/ttsc/shim/compiler/shim.go +16 -1
- package/native/third_party/ttsc/shim/core/shim.go +10 -10
- package/native/third_party/ttsc/shim/diagnosticwriter/lint.go +79 -79
- package/native/third_party/ttsc/shim/diagnosticwriter/shim.go +19 -19
- package/native/third_party/ttsc/shim/parser/shim.go +7 -1
- package/native/third_party/ttsc/shim/scanner/shim.go +39 -1
- package/native/third_party/ttsc/shim/tsoptions/shim.go +51 -1
- package/native/third_party/ttsc/shim/tspath/shim.go +72 -1
- package/native/third_party/ttsc/shim/vfs/cachedvfs/shim.go +1 -1
- package/native/third_party/ttsc/shim/vfs/osvfs/shim.go +1 -1
- package/native/third_party/ttsc/shim/vfs/shim.go +4 -1
- package/native/transform/CallExpressionTransformer.go +556 -556
- package/native/transform/FileTransformer.go +123 -123
- package/native/transform/ImportTransformer.go +224 -224
- package/native/transform/NodeTransformer.go +11 -11
- package/native/transform/TypiaGenerator.go +136 -136
- package/native/transform/features/AssertTransformer.go +28 -28
- package/native/transform/features/CreateAssertTransformer.go +28 -28
- package/native/transform/features/CreateIsTransformer.go +24 -24
- package/native/transform/features/CreateRandomTransformer.go +35 -35
- package/native/transform/features/CreateValidateTransformer.go +24 -24
- package/native/transform/features/IsTransformer.go +24 -24
- package/native/transform/features/RandomTransformer.go +37 -37
- package/native/transform/features/ValidateTransformer.go +24 -24
- package/native/transform/features/functional/FunctionalGenericTransformer.go +48 -48
- package/native/transform/features/http/CreateHttpAssertFormDataTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpAssertHeadersTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpAssertQueryTransformer.go +17 -17
- package/native/transform/features/http/CreateHttpFormDataTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpHeadersTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpIsFormDataTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpIsHeadersTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpIsQueryTransformer.go +17 -17
- package/native/transform/features/http/CreateHttpParameterTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpQueryTransformer.go +17 -17
- package/native/transform/features/http/CreateHttpValidateFormDataTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpValidateHeadersTransformer.go +11 -11
- package/native/transform/features/http/CreateHttpValidateQueryTransformer.go +17 -17
- package/native/transform/features/http/HttpAssertFormDataTransformer.go +11 -11
- package/native/transform/features/http/HttpAssertHeadersTransformer.go +11 -11
- package/native/transform/features/http/HttpAssertQueryTransformer.go +17 -17
- package/native/transform/features/http/HttpFormDataTransformer.go +11 -11
- package/native/transform/features/http/HttpHeadersTransformer.go +11 -11
- package/native/transform/features/http/HttpIsFormDataTransformer.go +11 -11
- package/native/transform/features/http/HttpIsHeadersTransformer.go +11 -11
- package/native/transform/features/http/HttpIsQueryTransformer.go +17 -17
- package/native/transform/features/http/HttpParameterTransformer.go +11 -11
- package/native/transform/features/http/HttpQueryTransformer.go +17 -17
- package/native/transform/features/http/HttpValidateFormDataTransformer.go +11 -11
- package/native/transform/features/http/HttpValidateHeadersTransformer.go +11 -11
- package/native/transform/features/http/HttpValidateQueryTransformer.go +17 -17
- package/native/transform/features/json/JsonApplicationTransformer.go +61 -61
- package/native/transform/features/json/JsonAssertParseTransformer.go +11 -11
- package/native/transform/features/json/JsonAssertStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateAssertParseTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateAssertStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateIsParseTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateIsStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateValidateParseTransformer.go +11 -11
- package/native/transform/features/json/JsonCreateValidateStringifyProgrammer.go +11 -11
- package/native/transform/features/json/JsonIsParseTransformer.go +11 -11
- package/native/transform/features/json/JsonIsStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonSchemaTransformer.go +148 -148
- package/native/transform/features/json/JsonSchemasTransformer.go +94 -94
- package/native/transform/features/json/JsonStringifyTransformer.go +11 -11
- package/native/transform/features/json/JsonValidateParseTransformer.go +11 -11
- package/native/transform/features/json/JsonValidateStringifyTransformer.go +11 -11
- package/native/transform/features/llm/LlmApplicationTransformer.go +43 -43
- package/native/transform/features/llm/LlmCoerceTransformer.go +50 -50
- package/native/transform/features/llm/LlmControllerTransformer.go +48 -48
- package/native/transform/features/llm/LlmCreateCoerceTransformer.go +43 -43
- package/native/transform/features/llm/LlmCreateParseTransformer.go +43 -43
- package/native/transform/features/llm/LlmParametersTransformer.go +38 -38
- package/native/transform/features/llm/LlmParseTransformer.go +50 -50
- package/native/transform/features/llm/LlmSchemaTransformer.go +129 -129
- package/native/transform/features/llm/LlmStructuredOutputTransformer.go +44 -44
- package/native/transform/features/misc/MiscAssertCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscAssertPruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateAssertCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateAssertPruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateIsCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateIsPruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreatePruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateValidateCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscCreateValidatePruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscIsCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscIsPruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscLiteralsTransformer.go +21 -21
- package/native/transform/features/misc/MiscPruneTransformer.go +11 -11
- package/native/transform/features/misc/MiscValidateCloneTransformer.go +11 -11
- package/native/transform/features/misc/MiscValidatePruneTransformer.go +11 -11
- package/native/transform/features/notations/NotationAssertGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationCreateAssertGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationCreateGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationCreateIsGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationCreateValidateGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationGeneralTransformer.go +21 -21
- package/native/transform/features/notations/NotationIsGeneralTransformer.go +16 -16
- package/native/transform/features/notations/NotationValidateGeneralTransformer.go +16 -16
- package/native/transform/features/protobuf/ProtobufAssertDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufAssertEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateAssertDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateAssertEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateIsDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateIsEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateValidateDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufCreateValidateEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufIsDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufIsEncodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufMessageTransformer.go +20 -20
- package/native/transform/features/protobuf/ProtobufValidateDecodeTransformer.go +11 -11
- package/native/transform/features/protobuf/ProtobufValidateEncodeTransformer.go +11 -11
- package/native/transform/features/reflect/ReflectMetadataTransformer.go +59 -59
- package/native/transform/features/reflect/ReflectNameTransformer.go +78 -78
- package/native/transform/features/reflect/ReflectSchemaTransformer.go +121 -121
- package/native/transform/features/reflect/ReflectSchemasTransformer.go +55 -55
- package/native/transform/internal/GenericTransformer.go +173 -173
- package/native/transform/transform.go +32 -32
- package/package.json +4 -4
- package/src/executable/TypiaGenerateWizard.ts +78 -9
- package/src/executable/generate/ttsc.ts +2 -3
- package/src/executable/setup/PluginConfigurator.ts +2 -3
- package/src/internal/_randomInteger.ts +5 -5
- package/src/internal/_validateReport.ts +1 -2
- package/src/transform.ts +6 -11
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
package misc
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
"fmt"
|
|
5
|
+
"strings"
|
|
6
|
+
|
|
7
|
+
shimast "github.com/microsoft/typescript-go/shim/ast"
|
|
8
|
+
shimchecker "github.com/microsoft/typescript-go/shim/checker"
|
|
9
|
+
nativecontext "github.com/samchon/typia/packages/typia/native/core/context"
|
|
10
|
+
nativefactories "github.com/samchon/typia/packages/typia/native/core/factories"
|
|
11
|
+
nativeprogrammers "github.com/samchon/typia/packages/typia/native/core/programmers"
|
|
12
|
+
nativehelpers "github.com/samchon/typia/packages/typia/native/core/programmers/helpers"
|
|
13
|
+
nativeinternal "github.com/samchon/typia/packages/typia/native/core/programmers/internal"
|
|
14
|
+
nativeiterate "github.com/samchon/typia/packages/typia/native/core/programmers/iterate"
|
|
15
|
+
schemametadata "github.com/samchon/typia/packages/typia/native/core/schemas/metadata"
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
type miscPruneProgrammerNamespace struct{}
|
|
@@ -20,11 +20,11 @@ type miscPruneProgrammerNamespace struct{}
|
|
|
20
20
|
var MiscPruneProgrammer = miscPruneProgrammerNamespace{}
|
|
21
21
|
|
|
22
22
|
type MiscPruneProgrammer_DecomposeProps struct {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
Validated bool
|
|
24
|
+
Context nativecontext.ITypiaContext
|
|
25
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
26
|
+
Type *shimchecker.Type
|
|
27
|
+
Name *string
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const miscPruneProgrammer_PREFIX = "_p"
|
|
@@ -32,767 +32,767 @@ const miscPruneProgrammer_PREFIX = "_p"
|
|
|
32
32
|
var miscPruneProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
33
33
|
|
|
34
34
|
func (miscPruneProgrammerNamespace) Decompose(props MiscPruneProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
config := miscPruneProgrammer_configure(struct {
|
|
36
|
+
Context nativecontext.ITypiaContext
|
|
37
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
38
|
+
}{Context: props.Context, Functor: props.Functor})
|
|
39
|
+
if props.Validated == false {
|
|
40
|
+
config.Addition = func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
41
|
+
return nativeprogrammers.IsProgrammer.Write_function_statements(nativeprogrammers.IsProgrammer_WriteFunctionStatementsProps{
|
|
42
|
+
Context: props.Context,
|
|
43
|
+
Functor: props.Functor,
|
|
44
|
+
Collection: collection,
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
composed := nativeinternal.FeatureProgrammer.Compose(nativeinternal.FeatureProgrammer_ComposeProps{
|
|
49
|
+
Context: props.Context,
|
|
50
|
+
Config: config,
|
|
51
|
+
Functor: props.Functor,
|
|
52
|
+
Type: props.Type,
|
|
53
|
+
Name: props.Name,
|
|
54
|
+
})
|
|
55
|
+
return nativeinternal.FeatureProgrammer_IDecomposed{
|
|
56
|
+
Functions: composed.Functions,
|
|
57
|
+
Statements: composed.Statements,
|
|
58
|
+
Arrow: miscPruneProgrammer_factory.NewArrowFunction(
|
|
59
|
+
nil,
|
|
60
|
+
nil,
|
|
61
|
+
miscPruneProgrammer_factory.NewNodeList(composed.Parameters),
|
|
62
|
+
composed.Response,
|
|
63
|
+
nil,
|
|
64
|
+
miscPruneProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
65
|
+
miscPruneProgrammer_top_level_body(composed.Body),
|
|
66
|
+
),
|
|
67
|
+
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
func (miscPruneProgrammerNamespace) Write(props nativecontext.IProgrammerProps) *shimast.Node {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
functor := nativehelpers.NewFunctionProgrammer(miscCloneProgrammer_method_text(props.Modulo))
|
|
72
|
+
result := MiscPruneProgrammer.Decompose(MiscPruneProgrammer_DecomposeProps{
|
|
73
|
+
Context: props.Context,
|
|
74
|
+
Functor: functor,
|
|
75
|
+
Type: props.Type,
|
|
76
|
+
Name: props.Name,
|
|
77
|
+
Validated: false,
|
|
78
|
+
})
|
|
79
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
80
|
+
Modulo: props.Modulo,
|
|
81
|
+
Functor: functor,
|
|
82
|
+
Result: result,
|
|
83
|
+
})
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
func miscPruneProgrammer_write_array_functions(props struct {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
88
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
89
|
+
Collection *schemametadata.MetadataCollection
|
|
90
90
|
}) []*shimast.Node {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
91
|
+
output := []*shimast.Node{}
|
|
92
|
+
for i, typ := range props.Collection.Arrays() {
|
|
93
|
+
if typ.Recursive == false {
|
|
94
|
+
continue
|
|
95
|
+
}
|
|
96
|
+
output = append(output, nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
97
|
+
Name: fmt.Sprintf("%sa%d", props.Config.Prefix, i),
|
|
98
|
+
Value: miscPruneProgrammer_factory.NewArrowFunction(
|
|
99
|
+
nil,
|
|
100
|
+
nil,
|
|
101
|
+
miscPruneProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ParameterDeclarations(nativeinternal.FeatureProgrammer_ParameterDeclarationsProps{
|
|
102
|
+
Config: nativeinternal.FeatureProgrammer_ParameterConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
103
|
+
Type: nativefactories.TypeFactory.Keyword("any"),
|
|
104
|
+
Input: miscPruneProgrammer_factory.NewIdentifier("input"),
|
|
105
|
+
})),
|
|
106
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
107
|
+
nil,
|
|
108
|
+
miscPruneProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
109
|
+
miscPruneProgrammer_decode_array_inline(miscPruneProgrammer_decodeArrayProps{
|
|
110
|
+
Config: props.Config,
|
|
111
|
+
Functor: props.Functor,
|
|
112
|
+
Input: miscPruneProgrammer_factory.NewIdentifier("input"),
|
|
113
|
+
Array: schemametadata.MetadataArray_create(schemametadata.MetadataArray{
|
|
114
|
+
Type: typ,
|
|
115
|
+
Tags: [][]schemametadata.IMetadataTypeTag{},
|
|
116
|
+
}),
|
|
117
|
+
Explore: nativeinternal.FeatureProgrammer_IExplore{
|
|
118
|
+
Tracable: props.Config.Trace,
|
|
119
|
+
Source: "function",
|
|
120
|
+
From: "array",
|
|
121
|
+
Postfix: "",
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
),
|
|
125
|
+
}))
|
|
126
|
+
}
|
|
127
|
+
return output
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
func miscPruneProgrammer_write_tuple_functions(props struct {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
Context nativecontext.ITypiaContext
|
|
132
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
133
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
134
|
+
Collection *schemametadata.MetadataCollection
|
|
135
135
|
}) []*shimast.Node {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
136
|
+
output := []*shimast.Node{}
|
|
137
|
+
for i, tuple := range props.Collection.Tuples() {
|
|
138
|
+
if tuple.Recursive == false {
|
|
139
|
+
continue
|
|
140
|
+
}
|
|
141
|
+
output = append(output, nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
142
|
+
Name: fmt.Sprintf("%st%d", props.Config.Prefix, i),
|
|
143
|
+
Value: miscPruneProgrammer_factory.NewArrowFunction(
|
|
144
|
+
nil,
|
|
145
|
+
nil,
|
|
146
|
+
miscPruneProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ParameterDeclarations(nativeinternal.FeatureProgrammer_ParameterDeclarationsProps{
|
|
147
|
+
Config: nativeinternal.FeatureProgrammer_ParameterConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
148
|
+
Type: nativefactories.TypeFactory.Keyword("any"),
|
|
149
|
+
Input: miscPruneProgrammer_factory.NewIdentifier("input"),
|
|
150
|
+
})),
|
|
151
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
152
|
+
nil,
|
|
153
|
+
miscPruneProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
154
|
+
miscPruneProgrammer_decode_tuple_inline(miscPruneProgrammer_decodeTupleInlineProps{
|
|
155
|
+
Context: props.Context,
|
|
156
|
+
Config: props.Config,
|
|
157
|
+
Functor: props.Functor,
|
|
158
|
+
Input: miscPruneProgrammer_factory.NewIdentifier("input"),
|
|
159
|
+
Tuple: tuple,
|
|
160
|
+
Explore: nativeinternal.FeatureProgrammer_IExplore{
|
|
161
|
+
Tracable: props.Config.Trace,
|
|
162
|
+
Source: "function",
|
|
163
|
+
From: "array",
|
|
164
|
+
Postfix: "",
|
|
165
|
+
},
|
|
166
|
+
}),
|
|
167
|
+
),
|
|
168
|
+
}))
|
|
169
|
+
}
|
|
170
|
+
return output
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
func miscPruneProgrammer_decode(props struct {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
Context nativecontext.ITypiaContext
|
|
175
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
176
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
177
|
+
Input *shimast.Node
|
|
178
|
+
Metadata *schemametadata.MetadataSchema
|
|
179
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
180
180
|
}) *shimast.Node {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
181
|
+
if miscPruneProgrammer_filter(props.Metadata) == false {
|
|
182
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(nil), false)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
unions := []miscPruneProgrammer_IUnion{}
|
|
186
|
+
for _, tuple := range props.Metadata.Tuples {
|
|
187
|
+
if miscPruneProgrammer_tuple_filter(tuple) == false {
|
|
188
|
+
continue
|
|
189
|
+
}
|
|
190
|
+
tuple := tuple
|
|
191
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
192
|
+
Type: "tuple",
|
|
193
|
+
Is: func() *shimast.Node {
|
|
194
|
+
partial := schemametadata.MetadataSchema_initialize()
|
|
195
|
+
partial.Tuples = append(partial.Tuples, tuple)
|
|
196
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
197
|
+
Context: props.Context,
|
|
198
|
+
Functor: props.Functor,
|
|
199
|
+
Metadata: partial,
|
|
200
|
+
Input: props.Input,
|
|
201
|
+
Explore: miscCloneProgrammer_checker_explore(props.Explore),
|
|
202
|
+
})
|
|
203
|
+
},
|
|
204
|
+
Value: func() *shimast.Node {
|
|
205
|
+
return miscPruneProgrammer_decode_tuple(miscPruneProgrammer_decodeTupleProps{
|
|
206
|
+
Context: props.Context,
|
|
207
|
+
Config: props.Config,
|
|
208
|
+
Functor: props.Functor,
|
|
209
|
+
Input: props.Input,
|
|
210
|
+
Tuple: tuple,
|
|
211
|
+
Explore: props.Explore,
|
|
212
|
+
})
|
|
213
|
+
},
|
|
214
|
+
})
|
|
215
|
+
}
|
|
216
|
+
filteredArrays := []*schemametadata.MetadataArray{}
|
|
217
|
+
for _, array := range props.Metadata.Arrays {
|
|
218
|
+
if miscPruneProgrammer_filter(array.Type.Value) {
|
|
219
|
+
filteredArrays = append(filteredArrays, array)
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if len(filteredArrays) != 0 {
|
|
223
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
224
|
+
Type: "array",
|
|
225
|
+
Is: func() *shimast.Node {
|
|
226
|
+
return nativefactories.ExpressionFactory.IsArray(props.Input)
|
|
227
|
+
},
|
|
228
|
+
Value: func() *shimast.Node {
|
|
229
|
+
explore := props.Explore
|
|
230
|
+
explore.From = "array"
|
|
231
|
+
return miscPruneProgrammer_explore_arrays(miscPruneProgrammer_exploreArraysProps{
|
|
232
|
+
Context: props.Context,
|
|
233
|
+
Config: props.Config,
|
|
234
|
+
Functor: props.Functor,
|
|
235
|
+
Input: props.Input,
|
|
236
|
+
Arrays: filteredArrays,
|
|
237
|
+
Explore: explore,
|
|
238
|
+
})
|
|
239
|
+
},
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
for _, native := range props.Metadata.Natives {
|
|
243
|
+
native := native
|
|
244
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
245
|
+
Type: "native",
|
|
246
|
+
Is: func() *shimast.Node {
|
|
247
|
+
return nativefactories.ExpressionFactory.IsInstanceOf(native.Name, props.Input)
|
|
248
|
+
},
|
|
249
|
+
Value: func() *shimast.Node {
|
|
250
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(nil), true)
|
|
251
|
+
},
|
|
252
|
+
})
|
|
253
|
+
}
|
|
254
|
+
if len(props.Metadata.Sets) != 0 {
|
|
255
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
256
|
+
Type: "set",
|
|
257
|
+
Is: func() *shimast.Node {
|
|
258
|
+
return nativefactories.ExpressionFactory.IsInstanceOf("Set", props.Input)
|
|
259
|
+
},
|
|
260
|
+
Value: func() *shimast.Node {
|
|
261
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(nil), true)
|
|
262
|
+
},
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
if len(props.Metadata.Maps) != 0 {
|
|
266
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
267
|
+
Type: "map",
|
|
268
|
+
Is: func() *shimast.Node {
|
|
269
|
+
return nativefactories.ExpressionFactory.IsInstanceOf("Map", props.Input)
|
|
270
|
+
},
|
|
271
|
+
Value: func() *shimast.Node {
|
|
272
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(nil), true)
|
|
273
|
+
},
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
if len(props.Metadata.Objects) != 0 {
|
|
277
|
+
unions = append(unions, miscPruneProgrammer_IUnion{
|
|
278
|
+
Type: "object",
|
|
279
|
+
Is: func() *shimast.Node {
|
|
280
|
+
return nativefactories.ExpressionFactory.IsObject(nativefactories.ExpressionFactory_IsObjectProps{
|
|
281
|
+
CheckNull: true,
|
|
282
|
+
CheckArray: false,
|
|
283
|
+
Input: props.Input,
|
|
284
|
+
})
|
|
285
|
+
},
|
|
286
|
+
Value: func() *shimast.Node {
|
|
287
|
+
explore := props.Explore
|
|
288
|
+
explore.From = "object"
|
|
289
|
+
return miscPruneProgrammer_explore_objects(miscPruneProgrammer_exploreObjectsProps{
|
|
290
|
+
Config: props.Config,
|
|
291
|
+
Functor: props.Functor,
|
|
292
|
+
Input: props.Input,
|
|
293
|
+
Metadata: props.Metadata,
|
|
294
|
+
Explore: explore,
|
|
295
|
+
})
|
|
296
|
+
},
|
|
297
|
+
})
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
statements := make([]*shimast.Node, 0, len(unions))
|
|
301
|
+
for _, u := range unions {
|
|
302
|
+
statements = append(statements, miscPruneProgrammer_factory.NewIfStatement(
|
|
303
|
+
u.Is(),
|
|
304
|
+
miscPruneProgrammer_to_statement(u.Value()),
|
|
305
|
+
nil,
|
|
306
|
+
))
|
|
307
|
+
}
|
|
308
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(statements), true)
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
type miscPruneProgrammer_IUnion struct {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
Type string
|
|
313
|
+
Is func() *shimast.Node
|
|
314
|
+
Value func() *shimast.Node
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
func miscPruneProgrammer_to_statement(node *shimast.Node) *shimast.Node {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
if node == nil || node.Kind == shimast.KindBlock || node.Kind == shimast.KindReturnStatement {
|
|
319
|
+
return node
|
|
320
|
+
}
|
|
321
|
+
return miscPruneProgrammer_factory.NewExpressionStatement(node)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
func miscPruneProgrammer_top_level_body(body *shimast.Node) *shimast.Node {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
325
|
+
statements := []*shimast.Node{}
|
|
326
|
+
if body != nil && body.Kind == shimast.KindBlock {
|
|
327
|
+
statements = append(statements, body.Statements()...)
|
|
328
|
+
} else if body != nil {
|
|
329
|
+
statements = append(statements, miscPruneProgrammer_factory.NewExpressionStatement(body))
|
|
330
|
+
}
|
|
331
|
+
statements = append(statements, miscPruneProgrammer_factory.NewReturnStatement(
|
|
332
|
+
miscPruneProgrammer_factory.NewIdentifier("input"),
|
|
333
|
+
))
|
|
334
|
+
return miscPruneProgrammer_factory.NewBlock(miscPruneProgrammer_factory.NewNodeList(statements), true)
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
func miscPruneProgrammer_decode_object(props struct {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
339
|
+
Input *shimast.Node
|
|
340
|
+
Object *schemametadata.MetadataObjectType
|
|
341
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
342
342
|
}) *shimast.Node {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
343
|
+
return nativeinternal.FeatureProgrammer.Decode_object(nativeinternal.FeatureProgrammer_DecodeObjectProps{
|
|
344
|
+
Config: nativeinternal.FeatureProgrammer_DecodeObjectConfig{
|
|
345
|
+
Trace: false,
|
|
346
|
+
Path: false,
|
|
347
|
+
Prefix: miscPruneProgrammer_PREFIX,
|
|
348
|
+
},
|
|
349
|
+
Functor: props.Functor,
|
|
350
|
+
Object: props.Object,
|
|
351
|
+
Input: props.Input,
|
|
352
|
+
Explore: props.Explore,
|
|
353
|
+
})
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
type miscPruneProgrammer_decodeArrayProps struct {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
357
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
358
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
359
|
+
Input *shimast.Node
|
|
360
|
+
Array *schemametadata.MetadataArray
|
|
361
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
func miscPruneProgrammer_decode_array(props miscPruneProgrammer_decodeArrayProps) *shimast.Node {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
if props.Array.Type.Recursive {
|
|
366
|
+
return miscPruneProgrammer_factory.NewCallExpression(
|
|
367
|
+
miscPruneProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%sa%d", props.Config.Prefix, *props.Array.Type.Index))),
|
|
368
|
+
nil,
|
|
369
|
+
nil,
|
|
370
|
+
miscPruneProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
371
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
372
|
+
Explore: miscCloneProgrammer_explore_with(props.Explore, "function", "array"),
|
|
373
|
+
Input: props.Input,
|
|
374
|
+
})),
|
|
375
|
+
shimast.NodeFlagsNone,
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
return miscPruneProgrammer_decode_array_inline(props)
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
func miscPruneProgrammer_decode_array_inline(props miscPruneProgrammer_decodeArrayProps) *shimast.Node {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
382
|
+
return nativeinternal.FeatureProgrammer.Decode_array(nativeinternal.FeatureProgrammer_DecodeArrayProps{
|
|
383
|
+
Config: nativeinternal.FeatureProgrammer_DecodeArrayConfig{
|
|
384
|
+
Trace: props.Config.Trace,
|
|
385
|
+
Path: props.Config.Path,
|
|
386
|
+
Prefix: props.Config.Prefix,
|
|
387
|
+
Decoder: props.Config.Decoder,
|
|
388
|
+
},
|
|
389
|
+
Functor: props.Functor,
|
|
390
|
+
Combiner: func(next struct {
|
|
391
|
+
Input *shimast.Expression
|
|
392
|
+
Arrow *shimast.Node
|
|
393
|
+
}) *shimast.Node {
|
|
394
|
+
return nativehelpers.PruneJoiner.Array(nativehelpers.PruneJoiner_ArrayProps{
|
|
395
|
+
Input: next.Input,
|
|
396
|
+
Arrow: next.Arrow,
|
|
397
|
+
})
|
|
398
|
+
},
|
|
399
|
+
Array: props.Array,
|
|
400
|
+
Input: props.Input,
|
|
401
|
+
Explore: props.Explore,
|
|
402
|
+
})
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
type miscPruneProgrammer_decodeTupleProps struct {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
406
|
+
Context nativecontext.ITypiaContext
|
|
407
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
408
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
409
|
+
Input *shimast.Node
|
|
410
|
+
Tuple *schemametadata.MetadataTuple
|
|
411
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
func miscPruneProgrammer_decode_tuple(props miscPruneProgrammer_decodeTupleProps) *shimast.Node {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
415
|
+
if props.Tuple.Type.Recursive {
|
|
416
|
+
return miscPruneProgrammer_factory.NewCallExpression(
|
|
417
|
+
miscPruneProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%st%d", props.Config.Prefix, *props.Tuple.Type.Index))),
|
|
418
|
+
nil,
|
|
419
|
+
nil,
|
|
420
|
+
miscPruneProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
421
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
422
|
+
Explore: miscCloneProgrammer_explore_with(props.Explore, "function", props.Explore.From),
|
|
423
|
+
Input: props.Input,
|
|
424
|
+
})),
|
|
425
|
+
shimast.NodeFlagsNone,
|
|
426
|
+
)
|
|
427
|
+
}
|
|
428
|
+
return miscPruneProgrammer_decode_tuple_inline(miscPruneProgrammer_decodeTupleInlineProps{
|
|
429
|
+
Context: props.Context,
|
|
430
|
+
Config: props.Config,
|
|
431
|
+
Functor: props.Functor,
|
|
432
|
+
Input: props.Input,
|
|
433
|
+
Tuple: props.Tuple.Type,
|
|
434
|
+
Explore: props.Explore,
|
|
435
|
+
})
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
type miscPruneProgrammer_decodeTupleInlineProps struct {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
439
|
+
Context nativecontext.ITypiaContext
|
|
440
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
441
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
442
|
+
Input *shimast.Node
|
|
443
|
+
Tuple *schemametadata.MetadataTupleType
|
|
444
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
func miscPruneProgrammer_decode_tuple_inline(props miscPruneProgrammer_decodeTupleInlineProps) *shimast.Node {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
448
|
+
elements := []*shimast.Node{}
|
|
449
|
+
for index, elem := range props.Tuple.Elements {
|
|
450
|
+
if elem.Rest != nil || miscPruneProgrammer_filter(elem) == false {
|
|
451
|
+
continue
|
|
452
|
+
}
|
|
453
|
+
postfix := fmt.Sprintf("\"[%d]\"", index)
|
|
454
|
+
if props.Explore.Postfix != "" {
|
|
455
|
+
postfix = fmt.Sprintf("%s[%d]\"", nativeiterate.Postfix_of_tuple_export(props.Explore.Postfix), index)
|
|
456
|
+
}
|
|
457
|
+
explore := props.Explore
|
|
458
|
+
explore.From = "array"
|
|
459
|
+
explore.Postfix = postfix
|
|
460
|
+
elements = append(elements, miscPruneProgrammer_decode(struct {
|
|
461
|
+
Context nativecontext.ITypiaContext
|
|
462
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
463
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
464
|
+
Input *shimast.Node
|
|
465
|
+
Metadata *schemametadata.MetadataSchema
|
|
466
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
467
|
+
}{
|
|
468
|
+
Context: props.Context,
|
|
469
|
+
Config: props.Config,
|
|
470
|
+
Functor: props.Functor,
|
|
471
|
+
Input: miscPruneProgrammer_factory.NewElementAccessExpression(props.Input, nil, nativefactories.ExpressionFactory.Number(index), shimast.NodeFlagsNone),
|
|
472
|
+
Metadata: elem,
|
|
473
|
+
Explore: explore,
|
|
474
|
+
}))
|
|
475
|
+
}
|
|
476
|
+
var rest *shimast.Node
|
|
477
|
+
if len(props.Tuple.Elements) != 0 {
|
|
478
|
+
last := props.Tuple.Elements[len(props.Tuple.Elements)-1]
|
|
479
|
+
if last.Rest != nil && miscPruneProgrammer_filter(last.Rest) {
|
|
480
|
+
start := len(props.Tuple.Elements) - 1
|
|
481
|
+
explore := props.Explore
|
|
482
|
+
explore.Start = &start
|
|
483
|
+
rest = miscPruneProgrammer_decode(struct {
|
|
484
|
+
Context nativecontext.ITypiaContext
|
|
485
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
486
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
487
|
+
Input *shimast.Node
|
|
488
|
+
Metadata *schemametadata.MetadataSchema
|
|
489
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
490
|
+
}{
|
|
491
|
+
Context: props.Context,
|
|
492
|
+
Config: props.Config,
|
|
493
|
+
Functor: props.Functor,
|
|
494
|
+
Input: miscPruneProgrammer_factory.NewCallExpression(
|
|
495
|
+
nativefactories.IdentifierFactory.Access(props.Input, "slice"),
|
|
496
|
+
nil,
|
|
497
|
+
nil,
|
|
498
|
+
miscPruneProgrammer_factory.NewNodeList([]*shimast.Node{nativefactories.ExpressionFactory.Number(start)}),
|
|
499
|
+
shimast.NodeFlagsNone,
|
|
500
|
+
),
|
|
501
|
+
Metadata: nativeiterate.Wrap_metadata_rest_tuple_export(last.Rest),
|
|
502
|
+
Explore: explore,
|
|
503
|
+
})
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return nativehelpers.PruneJoiner.Tuple(nativehelpers.PruneJoiner_TupleProps{
|
|
507
|
+
Elements: elements,
|
|
508
|
+
Rest: rest,
|
|
509
|
+
})
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
type miscPruneProgrammer_exploreArraysProps struct {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
513
|
+
Context nativecontext.ITypiaContext
|
|
514
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
515
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
516
|
+
Input *shimast.Node
|
|
517
|
+
Arrays []*schemametadata.MetadataArray
|
|
518
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
func miscPruneProgrammer_explore_arrays(props miscPruneProgrammer_exploreArraysProps) *shimast.Node {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
522
|
+
return miscPruneProgrammer_factory.NewCallExpression(
|
|
523
|
+
nativehelpers.UnionExplorer.Array(nativehelpers.UnionExplorer_ArrayProps{
|
|
524
|
+
Config: nativehelpers.UnionExplorer_ArrayLikeConfig{
|
|
525
|
+
Checker: func(v nativehelpers.UnionExplorer_ArrayLikeCheckerProps) *shimast.Node {
|
|
526
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
527
|
+
Context: props.Context,
|
|
528
|
+
Functor: props.Functor,
|
|
529
|
+
Input: v.Input,
|
|
530
|
+
Metadata: v.Definition.(*schemametadata.MetadataArray).Type.Value,
|
|
531
|
+
Explore: miscCloneProgrammer_checker_explore(v.Explore),
|
|
532
|
+
})
|
|
533
|
+
},
|
|
534
|
+
Decoder: func(v nativehelpers.UnionExplorer_ArrayLikeDecoderProps) *shimast.Node {
|
|
535
|
+
return miscPruneProgrammer_decode_array(miscPruneProgrammer_decodeArrayProps{
|
|
536
|
+
Config: props.Config,
|
|
537
|
+
Functor: props.Functor,
|
|
538
|
+
Input: v.Input,
|
|
539
|
+
Array: v.Definition.(*schemametadata.MetadataArray),
|
|
540
|
+
Explore: miscCloneProgrammer_feature_explore(v.Explore),
|
|
541
|
+
})
|
|
542
|
+
},
|
|
543
|
+
Empty: miscPruneProgrammer_factory.NewStringLiteral("[]", shimast.TokenFlagsNone),
|
|
544
|
+
Success: miscPruneProgrammer_factory.NewKeywordExpression(shimast.KindTrueKeyword),
|
|
545
|
+
Failure: func(v nativehelpers.UnionExplorer_ArrayLikeFailureProps) *shimast.Node {
|
|
546
|
+
return miscCloneProgrammer_create_throw_error(miscCloneProgrammer_throwProps{
|
|
547
|
+
Context: props.Context,
|
|
548
|
+
Functor: props.Functor,
|
|
549
|
+
Expected: v.Expected,
|
|
550
|
+
Input: v.Input,
|
|
551
|
+
})
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
Parameters: nil,
|
|
555
|
+
Input: props.Input,
|
|
556
|
+
Arrays: props.Arrays,
|
|
557
|
+
Explore: props.Explore,
|
|
558
|
+
}),
|
|
559
|
+
nil,
|
|
560
|
+
nil,
|
|
561
|
+
nil,
|
|
562
|
+
shimast.NodeFlagsNone,
|
|
563
|
+
)
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
type miscPruneProgrammer_exploreObjectsProps struct {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
567
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
568
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
569
|
+
Input *shimast.Node
|
|
570
|
+
Metadata *schemametadata.MetadataSchema
|
|
571
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
func miscPruneProgrammer_explore_objects(props miscPruneProgrammer_exploreObjectsProps) *shimast.Node {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
575
|
+
if len(props.Metadata.Objects) == 1 {
|
|
576
|
+
return miscPruneProgrammer_decode_object(struct {
|
|
577
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
578
|
+
Input *shimast.Node
|
|
579
|
+
Object *schemametadata.MetadataObjectType
|
|
580
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
581
|
+
}{
|
|
582
|
+
Functor: props.Functor,
|
|
583
|
+
Input: props.Input,
|
|
584
|
+
Object: props.Metadata.Objects[0].Type,
|
|
585
|
+
Explore: props.Explore,
|
|
586
|
+
})
|
|
587
|
+
}
|
|
588
|
+
index := 0
|
|
589
|
+
if props.Metadata.Union_index != nil {
|
|
590
|
+
index = *props.Metadata.Union_index
|
|
591
|
+
}
|
|
592
|
+
return miscPruneProgrammer_factory.NewCallExpression(
|
|
593
|
+
miscPruneProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%su%d", miscPruneProgrammer_PREFIX, index))),
|
|
594
|
+
nil,
|
|
595
|
+
nil,
|
|
596
|
+
miscPruneProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
597
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
598
|
+
Input: props.Input,
|
|
599
|
+
Explore: props.Explore,
|
|
600
|
+
})),
|
|
601
|
+
shimast.NodeFlagsNone,
|
|
602
|
+
)
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
func miscPruneProgrammer_configure(props struct {
|
|
606
|
-
|
|
607
|
-
|
|
606
|
+
Context nativecontext.ITypiaContext
|
|
607
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
608
608
|
}) nativeinternal.FeatureProgrammer_IConfig {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
609
|
+
config := nativeinternal.FeatureProgrammer_IConfig{}
|
|
610
|
+
config.Types = nativeinternal.FeatureProgrammer_IConfig_ITypes{
|
|
611
|
+
Input: func(t *shimchecker.Type, name *string) *shimast.TypeNode {
|
|
612
|
+
return miscPruneProgrammer_factory.NewTypeReferenceNode(miscPruneProgrammer_factory.NewIdentifier(miscCloneProgrammer_type_name(props.Context, t, name)), nil)
|
|
613
|
+
},
|
|
614
|
+
Output: func(_ *shimchecker.Type, _ *string) *shimast.TypeNode {
|
|
615
|
+
return nativefactories.TypeFactory.Keyword("void")
|
|
616
|
+
},
|
|
617
|
+
}
|
|
618
|
+
config.Prefix = miscPruneProgrammer_PREFIX
|
|
619
|
+
config.Trace = false
|
|
620
|
+
config.Path = false
|
|
621
|
+
config.Initializer = miscPruneProgrammer_initializer
|
|
622
|
+
config.Decoder = func(next nativeinternal.FeatureProgrammer_DecoderProps) *shimast.Node {
|
|
623
|
+
return miscPruneProgrammer_decode(struct {
|
|
624
|
+
Context nativecontext.ITypiaContext
|
|
625
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
626
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
627
|
+
Input *shimast.Node
|
|
628
|
+
Metadata *schemametadata.MetadataSchema
|
|
629
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
630
|
+
}{
|
|
631
|
+
Context: props.Context,
|
|
632
|
+
Config: config,
|
|
633
|
+
Functor: props.Functor,
|
|
634
|
+
Input: next.Input,
|
|
635
|
+
Metadata: next.Metadata,
|
|
636
|
+
Explore: next.Explore,
|
|
637
|
+
})
|
|
638
|
+
}
|
|
639
|
+
config.Objector = nativeinternal.FeatureProgrammer_IConfig_IObjector{
|
|
640
|
+
Checker: func(next nativeinternal.FeatureProgrammer_ObjectorCheckerProps) *shimast.Node {
|
|
641
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
642
|
+
Context: props.Context,
|
|
643
|
+
Functor: props.Functor,
|
|
644
|
+
Input: next.Input,
|
|
645
|
+
Metadata: next.Metadata,
|
|
646
|
+
Explore: miscCloneProgrammer_checker_explore(next.Explore),
|
|
647
|
+
})
|
|
648
|
+
},
|
|
649
|
+
Decoder: func(next nativeinternal.FeatureProgrammer_ObjectorDecoderProps) *shimast.Node {
|
|
650
|
+
return miscPruneProgrammer_decode_object(struct {
|
|
651
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
652
|
+
Input *shimast.Node
|
|
653
|
+
Object *schemametadata.MetadataObjectType
|
|
654
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
655
|
+
}{Functor: props.Functor, Input: next.Input, Object: next.Object, Explore: next.Explore})
|
|
656
|
+
},
|
|
657
|
+
Joiner: func(next nativeinternal.FeatureProgrammer_ObjectorJoinerProps) *shimast.Node {
|
|
658
|
+
return nativehelpers.PruneJoiner.Object(nativehelpers.PruneJoiner_ObjectProps{
|
|
659
|
+
Input: next.Input,
|
|
660
|
+
Entries: next.Entries,
|
|
661
|
+
Object: next.Object,
|
|
662
|
+
})
|
|
663
|
+
},
|
|
664
|
+
Unionizer: func(next nativeinternal.FeatureProgrammer_ObjectorUnionizerProps) *shimast.Node {
|
|
665
|
+
return nativeiterate.Decode_union_object(nativeiterate.Decode_union_objectProps{
|
|
666
|
+
Checker: func(v nativeiterate.Decode_union_object_next) *shimast.Node {
|
|
667
|
+
return nativeprogrammers.IsProgrammer.Decode_object(nativeprogrammers.IsProgrammer_DecodeObjectProps{
|
|
668
|
+
Context: props.Context,
|
|
669
|
+
Functor: props.Functor,
|
|
670
|
+
Input: v.Input,
|
|
671
|
+
Object: v.Object,
|
|
672
|
+
Explore: miscCloneProgrammer_feature_explore(v.Explore),
|
|
673
|
+
})
|
|
674
|
+
},
|
|
675
|
+
Decoder: func(v nativeiterate.Decode_union_object_next) *shimast.Node {
|
|
676
|
+
return miscPruneProgrammer_decode_object(struct {
|
|
677
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
678
|
+
Input *shimast.Node
|
|
679
|
+
Object *schemametadata.MetadataObjectType
|
|
680
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
681
|
+
}{Functor: props.Functor, Input: v.Input, Object: v.Object, Explore: miscCloneProgrammer_feature_explore(v.Explore)})
|
|
682
|
+
},
|
|
683
|
+
Success: func(exp *shimast.Node) *shimast.Node { return exp },
|
|
684
|
+
Escaper: func(v nativeiterate.Decode_union_object_escape) *shimast.Node {
|
|
685
|
+
return miscCloneProgrammer_create_throw_error(miscCloneProgrammer_throwProps{
|
|
686
|
+
Context: props.Context,
|
|
687
|
+
Functor: props.Functor,
|
|
688
|
+
Expected: v.Expected,
|
|
689
|
+
Input: v.Input,
|
|
690
|
+
})
|
|
691
|
+
},
|
|
692
|
+
Input: next.Input,
|
|
693
|
+
Objects: next.Objects,
|
|
694
|
+
Explore: next.Explore,
|
|
695
|
+
})
|
|
696
|
+
},
|
|
697
|
+
Failure: func(next nativeinternal.FeatureProgrammer_ObjectorFailureProps) *shimast.Node {
|
|
698
|
+
return miscCloneProgrammer_create_throw_error(miscCloneProgrammer_throwProps{
|
|
699
|
+
Context: props.Context,
|
|
700
|
+
Functor: props.Functor,
|
|
701
|
+
Expected: next.Expected,
|
|
702
|
+
Input: next.Input,
|
|
703
|
+
})
|
|
704
|
+
},
|
|
705
|
+
}
|
|
706
|
+
config.Generator = nativeinternal.FeatureProgrammer_IConfig_IGenerator{
|
|
707
|
+
Arrays: func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
708
|
+
return miscPruneProgrammer_write_array_functions(struct {
|
|
709
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
710
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
711
|
+
Collection *schemametadata.MetadataCollection
|
|
712
|
+
}{Config: config, Functor: props.Functor, Collection: collection})
|
|
713
|
+
},
|
|
714
|
+
Tuples: func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
715
|
+
return miscPruneProgrammer_write_tuple_functions(struct {
|
|
716
|
+
Context nativecontext.ITypiaContext
|
|
717
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
718
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
719
|
+
Collection *schemametadata.MetadataCollection
|
|
720
|
+
}{Context: props.Context, Config: config, Functor: props.Functor, Collection: collection})
|
|
721
|
+
},
|
|
722
|
+
}
|
|
723
|
+
return config
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
func miscPruneProgrammer_initializer(props nativeinternal.FeatureProgrammer_InitializerProps) nativeinternal.FeatureProgrammer_InitializerOutput {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
727
|
+
collection := schemametadata.NewMetadataCollection()
|
|
728
|
+
result := nativefactories.MetadataFactory.Analyze(nativefactories.MetadataFactory_IProps{
|
|
729
|
+
Checker: props.Context.Checker,
|
|
730
|
+
Transformer: props.Context.Transformer,
|
|
731
|
+
Options: nativefactories.MetadataFactory_IOptions{
|
|
732
|
+
Escape: false,
|
|
733
|
+
Constant: true,
|
|
734
|
+
Absorb: true,
|
|
735
|
+
},
|
|
736
|
+
Components: collection,
|
|
737
|
+
Type: props.Type,
|
|
738
|
+
})
|
|
739
|
+
if result.Success == false {
|
|
740
|
+
panic(nativecontext.TransformerError_from(struct {
|
|
741
|
+
Code string
|
|
742
|
+
Errors []nativecontext.TransformerError_MetadataFactory_IError
|
|
743
|
+
}{
|
|
744
|
+
Code: props.Functor.Method,
|
|
745
|
+
Errors: miscCloneProgrammer_errors(result.Errors),
|
|
746
|
+
}))
|
|
747
|
+
}
|
|
748
|
+
return nativeinternal.FeatureProgrammer_InitializerOutput{
|
|
749
|
+
Collection: collection,
|
|
750
|
+
Metadata: result.Data,
|
|
751
|
+
}
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
func miscPruneProgrammer_filter(metadata *schemametadata.MetadataSchema) bool {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
755
|
+
if metadata.Any {
|
|
756
|
+
return false
|
|
757
|
+
}
|
|
758
|
+
if len(metadata.Objects) != 0 {
|
|
759
|
+
return true
|
|
760
|
+
}
|
|
761
|
+
for _, tuple := range metadata.Tuples {
|
|
762
|
+
if miscPruneProgrammer_tuple_filter(tuple) {
|
|
763
|
+
return true
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
for _, array := range metadata.Arrays {
|
|
767
|
+
if miscPruneProgrammer_filter(array.Type.Value) {
|
|
768
|
+
return true
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return false
|
|
772
772
|
}
|
|
773
773
|
|
|
774
774
|
func miscPruneProgrammer_tuple_filter(tuple *schemametadata.MetadataTuple) bool {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
775
|
+
return len(tuple.Type.Elements) != 0 && miscPruneProgrammer_some_schema(tuple.Type.Elements, func(elem *schemametadata.MetadataSchema) bool {
|
|
776
|
+
if elem.Rest != nil {
|
|
777
|
+
return miscPruneProgrammer_filter(elem.Rest)
|
|
778
|
+
}
|
|
779
|
+
return miscPruneProgrammer_filter(elem)
|
|
780
|
+
})
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
func miscPruneProgrammer_some_schema(values []*schemametadata.MetadataSchema, pred func(*schemametadata.MetadataSchema) bool) bool {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
784
|
+
for _, value := range values {
|
|
785
|
+
if pred(value) {
|
|
786
|
+
return true
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return false
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
func miscPruneProgrammer_join_names[T any](values []T, name func(T) string) string {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
793
|
+
names := make([]string, 0, len(values))
|
|
794
|
+
for _, value := range values {
|
|
795
|
+
names = append(names, name(value))
|
|
796
|
+
}
|
|
797
|
+
return strings.Join(names, " | ")
|
|
798
798
|
}
|