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 notations
|
|
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 notationGeneralProgrammerNamespace struct{}
|
|
@@ -20,28 +20,28 @@ type notationGeneralProgrammerNamespace struct{}
|
|
|
20
20
|
var NotationGeneralProgrammer = notationGeneralProgrammerNamespace{}
|
|
21
21
|
|
|
22
22
|
type NotationGeneralProgrammer_IRename struct {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Name string
|
|
24
|
+
Func func(str string) string
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
type NotationGeneralProgrammer_IProps struct {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
nativecontext.IProgrammerProps
|
|
29
|
+
Rename NotationGeneralProgrammer_IRename
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
type NotationGeneralProgrammer_ReturnTypeProps struct {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
Rename NotationGeneralProgrammer_IRename
|
|
34
|
+
Context nativecontext.ITypiaContext
|
|
35
|
+
Type string
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
type NotationGeneralProgrammer_DecomposeProps struct {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
Rename NotationGeneralProgrammer_IRename
|
|
40
|
+
Validated bool
|
|
41
|
+
Context nativecontext.ITypiaContext
|
|
42
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
43
|
+
Type *shimchecker.Type
|
|
44
|
+
Name *string
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const notationGeneralProgrammer_PREFIX = "_c"
|
|
@@ -49,1224 +49,1224 @@ const notationGeneralProgrammer_PREFIX = "_c"
|
|
|
49
49
|
var notationGeneralProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
50
50
|
|
|
51
51
|
func (notationGeneralProgrammerNamespace) ReturnType(props NotationGeneralProgrammer_ReturnTypeProps) *shimast.Node {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
return notationGeneralProgrammer_import_type(props.Context, nativeprogrammers.ImportProgrammer_TypeProps{
|
|
53
|
+
File: "typia",
|
|
54
|
+
Name: notationGeneralProgrammer_capitalize(props.Rename.Name) + "Case",
|
|
55
|
+
Arguments: []*shimast.TypeNode{
|
|
56
|
+
notationGeneralProgrammer_factory.NewTypeReferenceNode(notationGeneralProgrammer_factory.NewIdentifier(props.Type), nil),
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
func (notationGeneralProgrammerNamespace) Decompose(props NotationGeneralProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
62
|
+
config := notationGeneralProgrammer_configure(struct {
|
|
63
|
+
Rename NotationGeneralProgrammer_IRename
|
|
64
|
+
Context nativecontext.ITypiaContext
|
|
65
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
66
|
+
}{Rename: props.Rename, Context: props.Context, Functor: props.Functor})
|
|
67
|
+
if props.Validated == false {
|
|
68
|
+
config.Addition = func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
69
|
+
return nativeprogrammers.IsProgrammer.Write_function_statements(nativeprogrammers.IsProgrammer_WriteFunctionStatementsProps{
|
|
70
|
+
Context: props.Context,
|
|
71
|
+
Functor: props.Functor,
|
|
72
|
+
Collection: collection,
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
composed := nativeinternal.FeatureProgrammer.Compose(nativeinternal.FeatureProgrammer_ComposeProps{
|
|
77
|
+
Context: props.Context,
|
|
78
|
+
Config: config,
|
|
79
|
+
Functor: props.Functor,
|
|
80
|
+
Type: props.Type,
|
|
81
|
+
Name: props.Name,
|
|
82
|
+
})
|
|
83
|
+
typeName := notationGeneralProgrammer_type_name(props.Context, props.Type, props.Name)
|
|
84
|
+
return nativeinternal.FeatureProgrammer_IDecomposed{
|
|
85
|
+
Functions: composed.Functions,
|
|
86
|
+
Statements: composed.Statements,
|
|
87
|
+
Arrow: notationGeneralProgrammer_factory.NewArrowFunction(
|
|
88
|
+
nil,
|
|
89
|
+
nil,
|
|
90
|
+
notationGeneralProgrammer_factory.NewNodeList(composed.Parameters),
|
|
91
|
+
NotationGeneralProgrammer.ReturnType(NotationGeneralProgrammer_ReturnTypeProps{
|
|
92
|
+
Rename: props.Rename,
|
|
93
|
+
Context: props.Context,
|
|
94
|
+
Type: typeName,
|
|
95
|
+
}),
|
|
96
|
+
nil,
|
|
97
|
+
notationGeneralProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
98
|
+
composed.Body,
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
func (notationGeneralProgrammerNamespace) Write(props NotationGeneralProgrammer_IProps) *shimast.Node {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
functor := nativehelpers.NewFunctionProgrammer(notationGeneralProgrammer_method_text(props.Modulo))
|
|
105
|
+
result := NotationGeneralProgrammer.Decompose(NotationGeneralProgrammer_DecomposeProps{
|
|
106
|
+
Rename: props.Rename,
|
|
107
|
+
Context: props.Context,
|
|
108
|
+
Functor: functor,
|
|
109
|
+
Type: props.Type,
|
|
110
|
+
Name: props.Name,
|
|
111
|
+
Validated: true,
|
|
112
|
+
})
|
|
113
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
114
|
+
Functor: functor,
|
|
115
|
+
Modulo: props.Modulo,
|
|
116
|
+
Result: result,
|
|
117
|
+
})
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
func notationGeneralProgrammer_write_array_functions(props struct {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
122
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
123
|
+
Collection *schemametadata.MetadataCollection
|
|
124
124
|
}) []*shimast.Node {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
125
|
+
output := []*shimast.Node{}
|
|
126
|
+
for i, typ := range props.Collection.Arrays() {
|
|
127
|
+
if typ.Recursive == false {
|
|
128
|
+
continue
|
|
129
|
+
}
|
|
130
|
+
output = append(output, nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
131
|
+
Name: fmt.Sprintf("%sa%d", props.Config.Prefix, i),
|
|
132
|
+
Value: notationGeneralProgrammer_factory.NewArrowFunction(
|
|
133
|
+
nil,
|
|
134
|
+
nil,
|
|
135
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ParameterDeclarations(nativeinternal.FeatureProgrammer_ParameterDeclarationsProps{
|
|
136
|
+
Config: nativeinternal.FeatureProgrammer_ParameterConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
137
|
+
Type: nativefactories.TypeFactory.Keyword("any"),
|
|
138
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
139
|
+
})),
|
|
140
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
141
|
+
nil,
|
|
142
|
+
notationGeneralProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
143
|
+
notationGeneralProgrammer_decode_array_inline(notationGeneralProgrammer_decodeArrayProps{
|
|
144
|
+
Config: props.Config,
|
|
145
|
+
Functor: props.Functor,
|
|
146
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
147
|
+
Array: schemametadata.MetadataArray_create(schemametadata.MetadataArray{
|
|
148
|
+
Type: typ,
|
|
149
|
+
Tags: [][]schemametadata.IMetadataTypeTag{},
|
|
150
|
+
}),
|
|
151
|
+
Explore: nativeinternal.FeatureProgrammer_IExplore{
|
|
152
|
+
Tracable: props.Config.Trace,
|
|
153
|
+
Source: "function",
|
|
154
|
+
From: "array",
|
|
155
|
+
Postfix: "",
|
|
156
|
+
},
|
|
157
|
+
}),
|
|
158
|
+
),
|
|
159
|
+
}))
|
|
160
|
+
}
|
|
161
|
+
return output
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
func notationGeneralProgrammer_write_tuple_functions(props struct {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
166
|
+
Rename NotationGeneralProgrammer_IRename
|
|
167
|
+
Context nativecontext.ITypiaContext
|
|
168
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
169
|
+
Collection *schemametadata.MetadataCollection
|
|
170
170
|
}) []*shimast.Node {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
171
|
+
output := []*shimast.Node{}
|
|
172
|
+
for i, tuple := range props.Collection.Tuples() {
|
|
173
|
+
if tuple.Recursive == false {
|
|
174
|
+
continue
|
|
175
|
+
}
|
|
176
|
+
output = append(output, nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
177
|
+
Name: fmt.Sprintf("%st%d", props.Config.Prefix, i),
|
|
178
|
+
Value: notationGeneralProgrammer_factory.NewArrowFunction(
|
|
179
|
+
nil,
|
|
180
|
+
nil,
|
|
181
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ParameterDeclarations(nativeinternal.FeatureProgrammer_ParameterDeclarationsProps{
|
|
182
|
+
Config: nativeinternal.FeatureProgrammer_ParameterConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
183
|
+
Type: nativefactories.TypeFactory.Keyword("any"),
|
|
184
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
185
|
+
})),
|
|
186
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
187
|
+
nil,
|
|
188
|
+
notationGeneralProgrammer_factory.NewToken(shimast.KindEqualsGreaterThanToken),
|
|
189
|
+
notationGeneralProgrammer_decode_tuple_inline(notationGeneralProgrammer_decodeTupleInlineProps{
|
|
190
|
+
Context: props.Context,
|
|
191
|
+
Rename: props.Rename,
|
|
192
|
+
Config: props.Config,
|
|
193
|
+
Functor: props.Functor,
|
|
194
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
195
|
+
Tuple: tuple,
|
|
196
|
+
Explore: nativeinternal.FeatureProgrammer_IExplore{
|
|
197
|
+
Tracable: props.Config.Trace,
|
|
198
|
+
Source: "function",
|
|
199
|
+
From: "array",
|
|
200
|
+
Postfix: "",
|
|
201
|
+
},
|
|
202
|
+
}),
|
|
203
|
+
),
|
|
204
|
+
}))
|
|
205
|
+
}
|
|
206
|
+
return output
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
func notationGeneralProgrammer_decode(props struct {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
210
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
211
|
+
Rename NotationGeneralProgrammer_IRename
|
|
212
|
+
Context nativecontext.ITypiaContext
|
|
213
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
214
|
+
Metadata *schemametadata.MetadataSchema
|
|
215
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
216
|
+
Input *shimast.Node
|
|
217
217
|
}) *shimast.Node {
|
|
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
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
218
|
+
if props.Metadata.Any ||
|
|
219
|
+
notationGeneralProgrammer_some_arrays(props.Metadata.Arrays, func(a *schemametadata.MetadataArray) bool { return a.Type.Value.Any }) ||
|
|
220
|
+
notationGeneralProgrammer_some_tuples(props.Metadata.Tuples, func(t *schemametadata.MetadataTuple) bool {
|
|
221
|
+
return len(t.Type.Elements) != 0 && notationGeneralProgrammer_every_schema(t.Type.Elements, func(e *schemametadata.MetadataSchema) bool { return e.Any })
|
|
222
|
+
}) {
|
|
223
|
+
return nativefactories.ExpressionFactory.Currying(nativefactories.ExpressionFactory_CurryingProps{
|
|
224
|
+
Function: notationGeneralProgrammer_internal(props.Context, "notationAny"),
|
|
225
|
+
Arguments: []*shimast.Expression{
|
|
226
|
+
notationGeneralProgrammer_internal(props.Context, "notation"+notationGeneralProgrammer_capitalize(props.Rename.Name)),
|
|
227
|
+
props.Input,
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
unions := []notationGeneralProgrammer_IUnion{}
|
|
233
|
+
if len(props.Metadata.Functions) != 0 {
|
|
234
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
235
|
+
Type: "functional",
|
|
236
|
+
Is: func() *shimast.Node {
|
|
237
|
+
return notationGeneralProgrammer_binary(
|
|
238
|
+
notationGeneralProgrammer_factory.NewStringLiteral("function", shimast.TokenFlagsNone),
|
|
239
|
+
shimast.KindEqualsEqualsEqualsToken,
|
|
240
|
+
notationGeneralProgrammer_factory.NewTypeOfExpression(props.Input),
|
|
241
|
+
)
|
|
242
|
+
},
|
|
243
|
+
Value: func() *shimast.Node {
|
|
244
|
+
return notationGeneralProgrammer_factory.NewIdentifier("undefined")
|
|
245
|
+
},
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
for _, tuple := range props.Metadata.Tuples {
|
|
250
|
+
tuple := tuple
|
|
251
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
252
|
+
Type: "tuple",
|
|
253
|
+
Is: func() *shimast.Node {
|
|
254
|
+
partial := schemametadata.MetadataSchema_initialize()
|
|
255
|
+
partial.Tuples = append(partial.Tuples, tuple)
|
|
256
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
257
|
+
Context: props.Context,
|
|
258
|
+
Functor: props.Functor,
|
|
259
|
+
Input: props.Input,
|
|
260
|
+
Metadata: partial,
|
|
261
|
+
Explore: notationGeneralProgrammer_checker_explore(props.Explore),
|
|
262
|
+
})
|
|
263
|
+
},
|
|
264
|
+
Value: func() *shimast.Node {
|
|
265
|
+
return notationGeneralProgrammer_decode_tuple(notationGeneralProgrammer_decodeTupleProps{
|
|
266
|
+
Config: props.Config,
|
|
267
|
+
Rename: props.Rename,
|
|
268
|
+
Context: props.Context,
|
|
269
|
+
Functor: props.Functor,
|
|
270
|
+
Tuple: tuple,
|
|
271
|
+
Explore: props.Explore,
|
|
272
|
+
Input: props.Input,
|
|
273
|
+
})
|
|
274
|
+
},
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if len(props.Metadata.Arrays) != 0 {
|
|
279
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
280
|
+
Type: "array",
|
|
281
|
+
Is: func() *shimast.Node {
|
|
282
|
+
return nativefactories.ExpressionFactory.IsArray(props.Input)
|
|
283
|
+
},
|
|
284
|
+
Value: func() *shimast.Node {
|
|
285
|
+
explore := props.Explore
|
|
286
|
+
explore.From = "array"
|
|
287
|
+
return notationGeneralProgrammer_explore_arrays(notationGeneralProgrammer_exploreArraysProps{
|
|
288
|
+
Context: props.Context,
|
|
289
|
+
Config: props.Config,
|
|
290
|
+
Functor: props.Functor,
|
|
291
|
+
Input: props.Input,
|
|
292
|
+
Arrays: props.Metadata.Arrays,
|
|
293
|
+
Explore: explore,
|
|
294
|
+
})
|
|
295
|
+
},
|
|
296
|
+
})
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if len(props.Metadata.Sets) != 0 {
|
|
300
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
301
|
+
Type: "set",
|
|
302
|
+
Is: func() *shimast.Node {
|
|
303
|
+
return nativefactories.ExpressionFactory.IsInstanceOf("Set", props.Input)
|
|
304
|
+
},
|
|
305
|
+
Value: func() *shimast.Node {
|
|
306
|
+
explore := props.Explore
|
|
307
|
+
explore.From = "array"
|
|
308
|
+
return notationGeneralProgrammer_explore_sets(notationGeneralProgrammer_exploreSetsProps{
|
|
309
|
+
Context: props.Context,
|
|
310
|
+
Config: props.Config,
|
|
311
|
+
Functor: props.Functor,
|
|
312
|
+
Input: props.Input,
|
|
313
|
+
Explore: explore,
|
|
314
|
+
Sets: props.Metadata.Sets,
|
|
315
|
+
})
|
|
316
|
+
},
|
|
317
|
+
})
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if len(props.Metadata.Maps) != 0 {
|
|
321
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
322
|
+
Type: "map",
|
|
323
|
+
Is: func() *shimast.Node {
|
|
324
|
+
return nativefactories.ExpressionFactory.IsInstanceOf("Map", props.Input)
|
|
325
|
+
},
|
|
326
|
+
Value: func() *shimast.Node {
|
|
327
|
+
explore := props.Explore
|
|
328
|
+
explore.From = "array"
|
|
329
|
+
return notationGeneralProgrammer_explore_maps(notationGeneralProgrammer_exploreMapsProps{
|
|
330
|
+
Context: props.Context,
|
|
331
|
+
Config: props.Config,
|
|
332
|
+
Functor: props.Functor,
|
|
333
|
+
Input: props.Input,
|
|
334
|
+
Maps: props.Metadata.Maps,
|
|
335
|
+
Explore: explore,
|
|
336
|
+
})
|
|
337
|
+
},
|
|
338
|
+
})
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
for _, native := range props.Metadata.Natives {
|
|
342
|
+
native := native
|
|
343
|
+
if native.Name == "WeakSet" || native.Name == "WeakMap" {
|
|
344
|
+
continue
|
|
345
|
+
}
|
|
346
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
347
|
+
Type: "native",
|
|
348
|
+
Is: func() *shimast.Node {
|
|
349
|
+
return nativefactories.ExpressionFactory.IsInstanceOf(native.Name, props.Input)
|
|
350
|
+
},
|
|
351
|
+
Value: func() *shimast.Node {
|
|
352
|
+
if native.Name == "Boolean" || native.Name == "Number" || native.Name == "String" {
|
|
353
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
354
|
+
nativefactories.IdentifierFactory.Access(props.Input, "valueOf"),
|
|
355
|
+
nil,
|
|
356
|
+
nil,
|
|
357
|
+
nil,
|
|
358
|
+
shimast.NodeFlagsNone,
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
return notationGeneralProgrammer_decode_native(struct {
|
|
362
|
+
Name string
|
|
363
|
+
Input *shimast.Node
|
|
364
|
+
}{Name: native.Name, Input: props.Input})
|
|
365
|
+
},
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if len(props.Metadata.Objects) != 0 {
|
|
370
|
+
unions = append(unions, notationGeneralProgrammer_IUnion{
|
|
371
|
+
Type: "object",
|
|
372
|
+
Is: func() *shimast.Node {
|
|
373
|
+
return nativefactories.ExpressionFactory.IsObject(nativefactories.ExpressionFactory_IsObjectProps{
|
|
374
|
+
CheckNull: true,
|
|
375
|
+
CheckArray: false,
|
|
376
|
+
Input: props.Input,
|
|
377
|
+
})
|
|
378
|
+
},
|
|
379
|
+
Value: func() *shimast.Node {
|
|
380
|
+
explore := props.Explore
|
|
381
|
+
explore.From = "object"
|
|
382
|
+
return notationGeneralProgrammer_explore_objects(notationGeneralProgrammer_exploreObjectsProps{
|
|
383
|
+
Config: props.Config,
|
|
384
|
+
Functor: props.Functor,
|
|
385
|
+
Input: props.Input,
|
|
386
|
+
Metadata: props.Metadata,
|
|
387
|
+
Explore: explore,
|
|
388
|
+
})
|
|
389
|
+
},
|
|
390
|
+
})
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if len(unions) == 0 {
|
|
394
|
+
return props.Input
|
|
395
|
+
}
|
|
396
|
+
if len(unions) == 1 && props.Metadata.Size() == 1 {
|
|
397
|
+
value := unions[0].Value()
|
|
398
|
+
if (props.Metadata.Nullable || props.Metadata.IsRequired() == false) && notationGeneralProgrammer_is_instance(props.Metadata) {
|
|
399
|
+
value = notationGeneralProgrammer_factory.NewConditionalExpression(
|
|
400
|
+
props.Input,
|
|
401
|
+
nil,
|
|
402
|
+
value,
|
|
403
|
+
nil,
|
|
404
|
+
props.Input,
|
|
405
|
+
)
|
|
406
|
+
}
|
|
407
|
+
return notationGeneralProgrammer_factory.NewAsExpression(value, nativefactories.TypeFactory.Keyword("any"))
|
|
408
|
+
}
|
|
409
|
+
last := props.Input
|
|
410
|
+
for i := len(unions) - 1; i >= 0; i-- {
|
|
411
|
+
union := unions[i]
|
|
412
|
+
last = notationGeneralProgrammer_factory.NewConditionalExpression(
|
|
413
|
+
union.Is(),
|
|
414
|
+
nil,
|
|
415
|
+
union.Value(),
|
|
416
|
+
nil,
|
|
417
|
+
last,
|
|
418
|
+
)
|
|
419
|
+
}
|
|
420
|
+
return notationGeneralProgrammer_factory.NewAsExpression(last, nativefactories.TypeFactory.Keyword("any"))
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
func notationGeneralProgrammer_decode_object(props struct {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
424
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
425
|
+
Object *schemametadata.MetadataObjectType
|
|
426
|
+
Input *shimast.Node
|
|
427
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
428
428
|
}) *shimast.Node {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
429
|
+
return nativeinternal.FeatureProgrammer.Decode_object(nativeinternal.FeatureProgrammer_DecodeObjectProps{
|
|
430
|
+
Config: nativeinternal.FeatureProgrammer_DecodeObjectConfig{Trace: false, Path: false, Prefix: notationGeneralProgrammer_PREFIX},
|
|
431
|
+
Functor: props.Functor,
|
|
432
|
+
Object: props.Object,
|
|
433
|
+
Input: props.Input,
|
|
434
|
+
Explore: props.Explore,
|
|
435
|
+
})
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
type notationGeneralProgrammer_decodeArrayProps struct {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
439
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
440
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
441
|
+
Input *shimast.Node
|
|
442
|
+
Array *schemametadata.MetadataArray
|
|
443
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
func notationGeneralProgrammer_decode_array(props notationGeneralProgrammer_decodeArrayProps) *shimast.Node {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
447
|
+
if props.Array.Type.Recursive {
|
|
448
|
+
index := 0
|
|
449
|
+
if props.Array.Type.Index != nil {
|
|
450
|
+
index = *props.Array.Type.Index
|
|
451
|
+
}
|
|
452
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
453
|
+
notationGeneralProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%sa%d", props.Config.Prefix, index))),
|
|
454
|
+
nil,
|
|
455
|
+
nil,
|
|
456
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
457
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
458
|
+
Explore: notationGeneralProgrammer_explore_with(props.Explore, "function", "array"),
|
|
459
|
+
Input: props.Input,
|
|
460
|
+
})),
|
|
461
|
+
shimast.NodeFlagsNone,
|
|
462
|
+
)
|
|
463
|
+
}
|
|
464
|
+
return notationGeneralProgrammer_decode_array_inline(props)
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
func notationGeneralProgrammer_decode_array_inline(props notationGeneralProgrammer_decodeArrayProps) *shimast.Node {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
468
|
+
return nativeinternal.FeatureProgrammer.Decode_array(nativeinternal.FeatureProgrammer_DecodeArrayProps{
|
|
469
|
+
Config: nativeinternal.FeatureProgrammer_DecodeArrayConfig{
|
|
470
|
+
Trace: props.Config.Trace,
|
|
471
|
+
Path: props.Config.Path,
|
|
472
|
+
Prefix: props.Config.Prefix,
|
|
473
|
+
Decoder: props.Config.Decoder,
|
|
474
|
+
},
|
|
475
|
+
Functor: props.Functor,
|
|
476
|
+
Combiner: func(next struct {
|
|
477
|
+
Input *shimast.Expression
|
|
478
|
+
Arrow *shimast.Node
|
|
479
|
+
}) *shimast.Node {
|
|
480
|
+
return nativehelpers.NotationJoiner.Array(nativehelpers.NotationJoiner_ArrayProps{
|
|
481
|
+
Input: next.Input,
|
|
482
|
+
Arrow: next.Arrow,
|
|
483
|
+
})
|
|
484
|
+
},
|
|
485
|
+
Array: props.Array,
|
|
486
|
+
Input: props.Input,
|
|
487
|
+
Explore: props.Explore,
|
|
488
|
+
})
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
type notationGeneralProgrammer_decodeTupleProps struct {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
492
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
493
|
+
Rename NotationGeneralProgrammer_IRename
|
|
494
|
+
Context nativecontext.ITypiaContext
|
|
495
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
496
|
+
Tuple *schemametadata.MetadataTuple
|
|
497
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
498
|
+
Input *shimast.Node
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
func notationGeneralProgrammer_decode_tuple(props notationGeneralProgrammer_decodeTupleProps) *shimast.Node {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
502
|
+
if props.Tuple.Type.Recursive {
|
|
503
|
+
index := 0
|
|
504
|
+
if props.Tuple.Type.Index != nil {
|
|
505
|
+
index = *props.Tuple.Type.Index
|
|
506
|
+
}
|
|
507
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
508
|
+
notationGeneralProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%st%d", props.Config.Prefix, index))),
|
|
509
|
+
nil,
|
|
510
|
+
nil,
|
|
511
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
512
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
513
|
+
Explore: notationGeneralProgrammer_explore_with(props.Explore, "function", props.Explore.From),
|
|
514
|
+
Input: props.Input,
|
|
515
|
+
})),
|
|
516
|
+
shimast.NodeFlagsNone,
|
|
517
|
+
)
|
|
518
|
+
}
|
|
519
|
+
return notationGeneralProgrammer_decode_tuple_inline(notationGeneralProgrammer_decodeTupleInlineProps{
|
|
520
|
+
Context: props.Context,
|
|
521
|
+
Rename: props.Rename,
|
|
522
|
+
Config: props.Config,
|
|
523
|
+
Functor: props.Functor,
|
|
524
|
+
Tuple: props.Tuple.Type,
|
|
525
|
+
Explore: props.Explore,
|
|
526
|
+
Input: props.Input,
|
|
527
|
+
})
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
type notationGeneralProgrammer_decodeTupleInlineProps struct {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
531
|
+
Context nativecontext.ITypiaContext
|
|
532
|
+
Rename NotationGeneralProgrammer_IRename
|
|
533
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
534
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
535
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
536
|
+
Tuple *schemametadata.MetadataTupleType
|
|
537
|
+
Input *shimast.Node
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
func notationGeneralProgrammer_decode_tuple_inline(props notationGeneralProgrammer_decodeTupleInlineProps) *shimast.Node {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
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
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
541
|
+
elements := []*shimast.Node{}
|
|
542
|
+
for index, elem := range props.Tuple.Elements {
|
|
543
|
+
if elem.Rest != nil {
|
|
544
|
+
continue
|
|
545
|
+
}
|
|
546
|
+
explore := props.Explore
|
|
547
|
+
explore.From = "array"
|
|
548
|
+
if len(props.Explore.Postfix) != 0 {
|
|
549
|
+
explore.Postfix = fmt.Sprintf("%s[%d]\"", nativeiterate.Postfix_of_tuple_export(props.Explore.Postfix), index)
|
|
550
|
+
} else {
|
|
551
|
+
explore.Postfix = fmt.Sprintf("\"[%d]\"", index)
|
|
552
|
+
}
|
|
553
|
+
elements = append(elements, notationGeneralProgrammer_decode(struct {
|
|
554
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
555
|
+
Rename NotationGeneralProgrammer_IRename
|
|
556
|
+
Context nativecontext.ITypiaContext
|
|
557
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
558
|
+
Metadata *schemametadata.MetadataSchema
|
|
559
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
560
|
+
Input *shimast.Node
|
|
561
|
+
}{
|
|
562
|
+
Config: props.Config,
|
|
563
|
+
Rename: props.Rename,
|
|
564
|
+
Context: props.Context,
|
|
565
|
+
Functor: props.Functor,
|
|
566
|
+
Metadata: elem,
|
|
567
|
+
Explore: explore,
|
|
568
|
+
Input: notationGeneralProgrammer_factory.NewElementAccessExpression(props.Input, nil, nativefactories.ExpressionFactory.Number(index), shimast.NodeFlagsNone),
|
|
569
|
+
}))
|
|
570
|
+
}
|
|
571
|
+
var rest *shimast.Node
|
|
572
|
+
if len(props.Tuple.Elements) != 0 {
|
|
573
|
+
last := props.Tuple.Elements[len(props.Tuple.Elements)-1]
|
|
574
|
+
if last.Rest != nil {
|
|
575
|
+
start := len(props.Tuple.Elements) - 1
|
|
576
|
+
explore := props.Explore
|
|
577
|
+
explore.Start = &start
|
|
578
|
+
rest = notationGeneralProgrammer_decode(struct {
|
|
579
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
580
|
+
Rename NotationGeneralProgrammer_IRename
|
|
581
|
+
Context nativecontext.ITypiaContext
|
|
582
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
583
|
+
Metadata *schemametadata.MetadataSchema
|
|
584
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
585
|
+
Input *shimast.Node
|
|
586
|
+
}{
|
|
587
|
+
Config: props.Config,
|
|
588
|
+
Rename: props.Rename,
|
|
589
|
+
Context: props.Context,
|
|
590
|
+
Functor: props.Functor,
|
|
591
|
+
Input: notationGeneralProgrammer_factory.NewCallExpression(
|
|
592
|
+
nativefactories.IdentifierFactory.Access(props.Input, "slice"),
|
|
593
|
+
nil,
|
|
594
|
+
nil,
|
|
595
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{nativefactories.ExpressionFactory.Number(start)}),
|
|
596
|
+
shimast.NodeFlagsNone,
|
|
597
|
+
),
|
|
598
|
+
Metadata: nativeiterate.Wrap_metadata_rest_tuple_export(last.Rest),
|
|
599
|
+
Explore: explore,
|
|
600
|
+
})
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return nativehelpers.NotationJoiner.Tuple(nativehelpers.NotationJoiner_TupleProps{
|
|
604
|
+
Elements: elements,
|
|
605
|
+
Rest: rest,
|
|
606
|
+
})
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
func notationGeneralProgrammer_decode_native(props struct {
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
Name string
|
|
611
|
+
Input *shimast.Node
|
|
612
612
|
}) *shimast.Node {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
613
|
+
if props.Name == "Date" {
|
|
614
|
+
return notationGeneralProgrammer_factory.NewNewExpression(
|
|
615
|
+
notationGeneralProgrammer_factory.NewIdentifier(props.Name),
|
|
616
|
+
nil,
|
|
617
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{props.Input}),
|
|
618
|
+
)
|
|
619
|
+
}
|
|
620
|
+
return props.Input
|
|
621
621
|
}
|
|
622
622
|
|
|
623
623
|
type notationGeneralProgrammer_exploreSetsProps struct {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
624
|
+
Context nativecontext.ITypiaContext
|
|
625
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
626
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
627
|
+
Input *shimast.Node
|
|
628
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
629
|
+
Sets []*schemametadata.MetadataSet
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
func notationGeneralProgrammer_explore_sets(props notationGeneralProgrammer_exploreSetsProps) *shimast.Node {
|
|
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
|
-
|
|
633
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
634
|
+
nativehelpers.UnionExplorer.Set(nativehelpers.UnionExplorer_SetProps{
|
|
635
|
+
Config: nativehelpers.UnionExplorer_ArrayLikeConfig{
|
|
636
|
+
Checker: func(v nativehelpers.UnionExplorer_ArrayLikeCheckerProps) *shimast.Node {
|
|
637
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
638
|
+
Context: props.Context,
|
|
639
|
+
Functor: props.Functor,
|
|
640
|
+
Input: v.Input,
|
|
641
|
+
Metadata: v.Definition.(*schemametadata.MetadataSchema),
|
|
642
|
+
Explore: notationGeneralProgrammer_checker_explore(v.Explore),
|
|
643
|
+
})
|
|
644
|
+
},
|
|
645
|
+
Decoder: func(v nativehelpers.UnionExplorer_ArrayLikeDecoderProps) *shimast.Node {
|
|
646
|
+
return notationGeneralProgrammer_factory.NewNewExpression(
|
|
647
|
+
notationGeneralProgrammer_factory.NewIdentifier("Set"),
|
|
648
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{nativefactories.TypeFactory.Keyword("any")}),
|
|
649
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
650
|
+
notationGeneralProgrammer_decode_array(notationGeneralProgrammer_decodeArrayProps{
|
|
651
|
+
Config: props.Config,
|
|
652
|
+
Functor: props.Functor,
|
|
653
|
+
Input: v.Input,
|
|
654
|
+
Array: v.Definition.(*schemametadata.MetadataArray),
|
|
655
|
+
Explore: notationGeneralProgrammer_feature_explore(v.Explore),
|
|
656
|
+
}),
|
|
657
|
+
}),
|
|
658
|
+
)
|
|
659
|
+
},
|
|
660
|
+
Empty: notationGeneralProgrammer_factory.NewNewExpression(
|
|
661
|
+
notationGeneralProgrammer_factory.NewIdentifier("Set"),
|
|
662
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{nativefactories.TypeFactory.Keyword("any")}),
|
|
663
|
+
nil,
|
|
664
|
+
),
|
|
665
|
+
Success: notationGeneralProgrammer_factory.NewKeywordExpression(shimast.KindTrueKeyword),
|
|
666
|
+
Failure: func(v nativehelpers.UnionExplorer_ArrayLikeFailureProps) *shimast.Node {
|
|
667
|
+
return notationGeneralProgrammer_create_throw_error(notationGeneralProgrammer_throwProps{
|
|
668
|
+
Context: props.Context,
|
|
669
|
+
Functor: props.Functor,
|
|
670
|
+
Expected: v.Expected,
|
|
671
|
+
Input: v.Input,
|
|
672
|
+
})
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
Parameters: nil,
|
|
676
|
+
Input: props.Input,
|
|
677
|
+
Sets: props.Sets,
|
|
678
|
+
Explore: props.Explore,
|
|
679
|
+
}),
|
|
680
|
+
nil,
|
|
681
|
+
nil,
|
|
682
|
+
nil,
|
|
683
|
+
shimast.NodeFlagsNone,
|
|
684
|
+
)
|
|
685
685
|
}
|
|
686
686
|
|
|
687
687
|
type notationGeneralProgrammer_exploreMapsProps struct {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
688
|
+
Context nativecontext.ITypiaContext
|
|
689
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
690
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
691
|
+
Input *shimast.Node
|
|
692
|
+
Maps []*schemametadata.MetadataMap
|
|
693
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
func notationGeneralProgrammer_explore_maps(props notationGeneralProgrammer_exploreMapsProps) *shimast.Node {
|
|
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
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
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
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
697
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
698
|
+
nativehelpers.UnionExplorer.Map(nativehelpers.UnionExplorer_MapProps{
|
|
699
|
+
Config: nativehelpers.UnionExplorer_ArrayLikeConfig{
|
|
700
|
+
Checker: func(v nativehelpers.UnionExplorer_ArrayLikeCheckerProps) *shimast.Node {
|
|
701
|
+
pair := v.Definition.([]*schemametadata.MetadataSchema)
|
|
702
|
+
first := nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
703
|
+
Context: props.Context,
|
|
704
|
+
Functor: props.Functor,
|
|
705
|
+
Input: notationGeneralProgrammer_factory.NewElementAccessExpression(v.Input, nil, nativefactories.ExpressionFactory.Number(0), shimast.NodeFlagsNone),
|
|
706
|
+
Metadata: pair[0],
|
|
707
|
+
Explore: notationGeneralProgrammer_checker_explore_with_postfix(v.Explore, "[0]"),
|
|
708
|
+
})
|
|
709
|
+
second := nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
710
|
+
Context: props.Context,
|
|
711
|
+
Functor: props.Functor,
|
|
712
|
+
Input: notationGeneralProgrammer_factory.NewElementAccessExpression(v.Input, nil, nativefactories.ExpressionFactory.Number(1), shimast.NodeFlagsNone),
|
|
713
|
+
Metadata: pair[1],
|
|
714
|
+
Explore: notationGeneralProgrammer_checker_explore_with_postfix(v.Explore, "[1]"),
|
|
715
|
+
})
|
|
716
|
+
return notationGeneralProgrammer_binary(first, shimast.KindAmpersandAmpersandToken, second)
|
|
717
|
+
},
|
|
718
|
+
Decoder: func(v nativehelpers.UnionExplorer_ArrayLikeDecoderProps) *shimast.Node {
|
|
719
|
+
return notationGeneralProgrammer_factory.NewNewExpression(
|
|
720
|
+
notationGeneralProgrammer_factory.NewIdentifier("Map"),
|
|
721
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
722
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
723
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
724
|
+
}),
|
|
725
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
726
|
+
notationGeneralProgrammer_decode_array(notationGeneralProgrammer_decodeArrayProps{
|
|
727
|
+
Config: props.Config,
|
|
728
|
+
Functor: props.Functor,
|
|
729
|
+
Input: v.Input,
|
|
730
|
+
Array: v.Definition.(*schemametadata.MetadataArray),
|
|
731
|
+
Explore: notationGeneralProgrammer_feature_explore(v.Explore),
|
|
732
|
+
}),
|
|
733
|
+
}),
|
|
734
|
+
)
|
|
735
|
+
},
|
|
736
|
+
Empty: notationGeneralProgrammer_factory.NewNewExpression(
|
|
737
|
+
notationGeneralProgrammer_factory.NewIdentifier("Map"),
|
|
738
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
739
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
740
|
+
nativefactories.TypeFactory.Keyword("any"),
|
|
741
|
+
}),
|
|
742
|
+
nil,
|
|
743
|
+
),
|
|
744
|
+
Success: notationGeneralProgrammer_factory.NewKeywordExpression(shimast.KindTrueKeyword),
|
|
745
|
+
Failure: func(v nativehelpers.UnionExplorer_ArrayLikeFailureProps) *shimast.Node {
|
|
746
|
+
return notationGeneralProgrammer_create_throw_error(notationGeneralProgrammer_throwProps{
|
|
747
|
+
Context: props.Context,
|
|
748
|
+
Functor: props.Functor,
|
|
749
|
+
Expected: v.Expected,
|
|
750
|
+
Input: v.Input,
|
|
751
|
+
})
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
Parameters: nil,
|
|
755
|
+
Input: props.Input,
|
|
756
|
+
Maps: props.Maps,
|
|
757
|
+
Explore: props.Explore,
|
|
758
|
+
}),
|
|
759
|
+
nil,
|
|
760
|
+
nil,
|
|
761
|
+
nil,
|
|
762
|
+
shimast.NodeFlagsNone,
|
|
763
|
+
)
|
|
764
764
|
}
|
|
765
765
|
|
|
766
766
|
type notationGeneralProgrammer_exploreObjectsProps struct {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
767
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
768
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
769
|
+
Input *shimast.Node
|
|
770
|
+
Metadata *schemametadata.MetadataSchema
|
|
771
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
772
772
|
}
|
|
773
773
|
|
|
774
774
|
func notationGeneralProgrammer_explore_objects(props notationGeneralProgrammer_exploreObjectsProps) *shimast.Node {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
775
|
+
if len(props.Metadata.Objects) == 1 {
|
|
776
|
+
return notationGeneralProgrammer_decode_object(struct {
|
|
777
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
778
|
+
Object *schemametadata.MetadataObjectType
|
|
779
|
+
Input *shimast.Node
|
|
780
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
781
|
+
}{Functor: props.Functor, Object: props.Metadata.Objects[0].Type, Input: props.Input, Explore: props.Explore})
|
|
782
|
+
}
|
|
783
|
+
index := 0
|
|
784
|
+
if props.Metadata.Union_index != nil {
|
|
785
|
+
index = *props.Metadata.Union_index
|
|
786
|
+
}
|
|
787
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
788
|
+
notationGeneralProgrammer_factory.NewIdentifier(props.Functor.UseLocal(fmt.Sprintf("%su%d", notationGeneralProgrammer_PREFIX, index))),
|
|
789
|
+
nil,
|
|
790
|
+
nil,
|
|
791
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
792
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
793
|
+
Explore: props.Explore,
|
|
794
|
+
Input: props.Input,
|
|
795
|
+
})),
|
|
796
|
+
shimast.NodeFlagsNone,
|
|
797
|
+
)
|
|
798
798
|
}
|
|
799
799
|
|
|
800
800
|
type notationGeneralProgrammer_exploreArraysProps struct {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
801
|
+
Context nativecontext.ITypiaContext
|
|
802
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
803
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
804
|
+
Input *shimast.Node
|
|
805
|
+
Arrays []*schemametadata.MetadataArray
|
|
806
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
807
807
|
}
|
|
808
808
|
|
|
809
809
|
func notationGeneralProgrammer_explore_arrays(props notationGeneralProgrammer_exploreArraysProps) *shimast.Node {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
810
|
+
return notationGeneralProgrammer_explore_array_like_union_types(notationGeneralProgrammer_exploreArrayLikeUnionTypesProps[*schemametadata.MetadataArray]{
|
|
811
|
+
Config: props.Config,
|
|
812
|
+
Functor: props.Functor,
|
|
813
|
+
Factory: func(next notationGeneralProgrammer_arrayLikeFactoryProps[*schemametadata.MetadataArray]) *shimast.Node {
|
|
814
|
+
return nativehelpers.UnionExplorer.Array(nativehelpers.UnionExplorer_ArrayProps{
|
|
815
|
+
Config: nativehelpers.UnionExplorer_ArrayLikeConfig{
|
|
816
|
+
Checker: func(v nativehelpers.UnionExplorer_ArrayLikeCheckerProps) *shimast.Node {
|
|
817
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
818
|
+
Context: props.Context,
|
|
819
|
+
Functor: props.Functor,
|
|
820
|
+
Input: v.Input,
|
|
821
|
+
Metadata: v.Definition.(*schemametadata.MetadataSchema),
|
|
822
|
+
Explore: notationGeneralProgrammer_checker_explore(v.Explore),
|
|
823
|
+
})
|
|
824
|
+
},
|
|
825
|
+
Decoder: func(v nativehelpers.UnionExplorer_ArrayLikeDecoderProps) *shimast.Node {
|
|
826
|
+
return notationGeneralProgrammer_decode_array(notationGeneralProgrammer_decodeArrayProps{
|
|
827
|
+
Config: props.Config,
|
|
828
|
+
Functor: props.Functor,
|
|
829
|
+
Input: v.Input,
|
|
830
|
+
Array: v.Definition.(*schemametadata.MetadataArray),
|
|
831
|
+
Explore: notationGeneralProgrammer_feature_explore(v.Explore),
|
|
832
|
+
})
|
|
833
|
+
},
|
|
834
|
+
Empty: notationGeneralProgrammer_factory.NewIdentifier("[]"),
|
|
835
|
+
Success: notationGeneralProgrammer_factory.NewKeywordExpression(shimast.KindTrueKeyword),
|
|
836
|
+
Failure: func(v nativehelpers.UnionExplorer_ArrayLikeFailureProps) *shimast.Node {
|
|
837
|
+
return notationGeneralProgrammer_create_throw_error(notationGeneralProgrammer_throwProps{
|
|
838
|
+
Context: props.Context,
|
|
839
|
+
Functor: props.Functor,
|
|
840
|
+
Expected: v.Expected,
|
|
841
|
+
Input: v.Input,
|
|
842
|
+
})
|
|
843
|
+
},
|
|
844
|
+
},
|
|
845
|
+
Parameters: next.Parameters,
|
|
846
|
+
Input: next.Input,
|
|
847
|
+
Arrays: next.Definitions,
|
|
848
|
+
Explore: next.Explore,
|
|
849
|
+
})
|
|
850
|
+
},
|
|
851
|
+
Definitions: props.Arrays,
|
|
852
|
+
Input: props.Input,
|
|
853
|
+
Explore: props.Explore,
|
|
854
|
+
})
|
|
855
855
|
}
|
|
856
856
|
|
|
857
857
|
type notationGeneralProgrammer_arrayLikeFactoryProps[T any] struct {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
858
|
+
Parameters []*shimast.Node
|
|
859
|
+
Input *shimast.Node
|
|
860
|
+
Definitions []T
|
|
861
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
862
862
|
}
|
|
863
863
|
|
|
864
864
|
type notationGeneralProgrammer_exploreArrayLikeUnionTypesProps[T interface {
|
|
865
|
-
|
|
865
|
+
*schemametadata.MetadataArray | *schemametadata.MetadataTuple
|
|
866
866
|
}] struct {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
867
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
868
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
869
|
+
Factory func(next notationGeneralProgrammer_arrayLikeFactoryProps[T]) *shimast.Node
|
|
870
|
+
Input *shimast.Node
|
|
871
|
+
Definitions []T
|
|
872
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
873
873
|
}
|
|
874
874
|
|
|
875
875
|
func notationGeneralProgrammer_explore_array_like_union_types[T interface {
|
|
876
|
-
|
|
876
|
+
*schemametadata.MetadataArray | *schemametadata.MetadataTuple
|
|
877
877
|
}](props notationGeneralProgrammer_exploreArrayLikeUnionTypesProps[T]) *shimast.Node {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
878
|
+
arrow := func(next struct {
|
|
879
|
+
Parameters []*shimast.Node
|
|
880
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
881
|
+
Input *shimast.Node
|
|
882
|
+
}) *shimast.Node {
|
|
883
|
+
return props.Factory(notationGeneralProgrammer_arrayLikeFactoryProps[T]{
|
|
884
|
+
Parameters: next.Parameters,
|
|
885
|
+
Definitions: props.Definitions,
|
|
886
|
+
Explore: next.Explore,
|
|
887
|
+
Input: next.Input,
|
|
888
|
+
})
|
|
889
|
+
}
|
|
890
|
+
arrayExplore := props.Explore
|
|
891
|
+
arrayExplore.Source = "function"
|
|
892
|
+
arrayExplore.From = "array"
|
|
893
|
+
return notationGeneralProgrammer_factory.NewCallExpression(
|
|
894
|
+
notationGeneralProgrammer_factory.NewIdentifier(props.Functor.EmplaceUnion(props.Config.Prefix, notationGeneralProgrammer_array_like_names(props.Definitions), func() *shimast.Node {
|
|
895
|
+
explore := arrayExplore
|
|
896
|
+
explore.Postfix = ""
|
|
897
|
+
return arrow(struct {
|
|
898
|
+
Parameters []*shimast.Node
|
|
899
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
900
|
+
Input *shimast.Node
|
|
901
|
+
}{
|
|
902
|
+
Parameters: nativeinternal.FeatureProgrammer.ParameterDeclarations(nativeinternal.FeatureProgrammer_ParameterDeclarationsProps{
|
|
903
|
+
Config: nativeinternal.FeatureProgrammer_ParameterConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
904
|
+
Type: nativefactories.TypeFactory.Keyword("any"),
|
|
905
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
906
|
+
}),
|
|
907
|
+
Explore: explore,
|
|
908
|
+
Input: notationGeneralProgrammer_factory.NewIdentifier("input"),
|
|
909
|
+
})
|
|
910
|
+
})),
|
|
911
|
+
nil,
|
|
912
|
+
nil,
|
|
913
|
+
notationGeneralProgrammer_factory.NewNodeList(nativeinternal.FeatureProgrammer.ArgumentsArray(nativeinternal.FeatureProgrammer_ArgumentsArrayProps{
|
|
914
|
+
Config: nativeinternal.FeatureProgrammer_ArgumentsArrayConfig{Path: props.Config.Path, Trace: props.Config.Trace},
|
|
915
|
+
Explore: arrayExplore,
|
|
916
|
+
Input: props.Input,
|
|
917
|
+
})),
|
|
918
|
+
shimast.NodeFlagsNone,
|
|
919
|
+
)
|
|
920
920
|
}
|
|
921
921
|
|
|
922
922
|
func notationGeneralProgrammer_configure(props struct {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
923
|
+
Rename NotationGeneralProgrammer_IRename
|
|
924
|
+
Context nativecontext.ITypiaContext
|
|
925
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
926
926
|
}) nativeinternal.FeatureProgrammer_IConfig {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
927
|
+
var config nativeinternal.FeatureProgrammer_IConfig
|
|
928
|
+
config = nativeinternal.FeatureProgrammer_IConfig{
|
|
929
|
+
Types: nativeinternal.FeatureProgrammer_IConfig_ITypes{
|
|
930
|
+
Input: func(t *shimchecker.Type, name *string) *shimast.TypeNode {
|
|
931
|
+
return notationGeneralProgrammer_factory.NewTypeReferenceNode(notationGeneralProgrammer_factory.NewIdentifier(notationGeneralProgrammer_type_name(props.Context, t, name)), nil)
|
|
932
|
+
},
|
|
933
|
+
Output: func(t *shimchecker.Type, name *string) *shimast.TypeNode {
|
|
934
|
+
return NotationGeneralProgrammer.ReturnType(NotationGeneralProgrammer_ReturnTypeProps{
|
|
935
|
+
Rename: props.Rename,
|
|
936
|
+
Context: props.Context,
|
|
937
|
+
Type: notationGeneralProgrammer_type_name(props.Context, t, name),
|
|
938
|
+
})
|
|
939
|
+
},
|
|
940
|
+
},
|
|
941
|
+
Prefix: notationGeneralProgrammer_PREFIX,
|
|
942
|
+
Trace: false,
|
|
943
|
+
Path: false,
|
|
944
|
+
Initializer: notationGeneralProgrammer_initializer,
|
|
945
|
+
Decoder: func(next nativeinternal.FeatureProgrammer_DecoderProps) *shimast.Node {
|
|
946
|
+
return notationGeneralProgrammer_decode(struct {
|
|
947
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
948
|
+
Rename NotationGeneralProgrammer_IRename
|
|
949
|
+
Context nativecontext.ITypiaContext
|
|
950
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
951
|
+
Metadata *schemametadata.MetadataSchema
|
|
952
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
953
|
+
Input *shimast.Node
|
|
954
|
+
}{Config: config, Rename: props.Rename, Context: props.Context, Functor: props.Functor, Metadata: next.Metadata, Explore: next.Explore, Input: next.Input})
|
|
955
|
+
},
|
|
956
|
+
Objector: nativeinternal.FeatureProgrammer_IConfig_IObjector{
|
|
957
|
+
Checker: func(next nativeinternal.FeatureProgrammer_ObjectorCheckerProps) *shimast.Node {
|
|
958
|
+
return nativeprogrammers.IsProgrammer.Decode(nativeprogrammers.IsProgrammer_DecodeProps{
|
|
959
|
+
Context: props.Context,
|
|
960
|
+
Functor: props.Functor,
|
|
961
|
+
Input: next.Input,
|
|
962
|
+
Metadata: next.Metadata,
|
|
963
|
+
Explore: notationGeneralProgrammer_checker_explore(next.Explore),
|
|
964
|
+
})
|
|
965
|
+
},
|
|
966
|
+
Decoder: func(next nativeinternal.FeatureProgrammer_ObjectorDecoderProps) *shimast.Node {
|
|
967
|
+
return notationGeneralProgrammer_decode_object(struct {
|
|
968
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
969
|
+
Object *schemametadata.MetadataObjectType
|
|
970
|
+
Input *shimast.Node
|
|
971
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
972
|
+
}{Functor: props.Functor, Object: next.Object, Input: next.Input, Explore: next.Explore})
|
|
973
|
+
},
|
|
974
|
+
Joiner: func(next nativeinternal.FeatureProgrammer_ObjectorJoinerProps) *shimast.Node {
|
|
975
|
+
return nativehelpers.NotationJoiner.Object(nativehelpers.NotationJoiner_ObjectProps{
|
|
976
|
+
Rename: props.Rename.Func,
|
|
977
|
+
Input: next.Input,
|
|
978
|
+
Entries: next.Entries,
|
|
979
|
+
})
|
|
980
|
+
},
|
|
981
|
+
Unionizer: func(next nativeinternal.FeatureProgrammer_ObjectorUnionizerProps) *shimast.Node {
|
|
982
|
+
return nativeiterate.Decode_union_object(nativeiterate.Decode_union_objectProps{
|
|
983
|
+
Checker: func(v nativeiterate.Decode_union_object_next) *shimast.Node {
|
|
984
|
+
return nativeprogrammers.IsProgrammer.Decode_object(nativeprogrammers.IsProgrammer_DecodeObjectProps{
|
|
985
|
+
Context: props.Context,
|
|
986
|
+
Functor: props.Functor,
|
|
987
|
+
Object: v.Object,
|
|
988
|
+
Input: v.Input,
|
|
989
|
+
Explore: notationGeneralProgrammer_feature_explore(v.Explore),
|
|
990
|
+
})
|
|
991
|
+
},
|
|
992
|
+
Decoder: func(v nativeiterate.Decode_union_object_next) *shimast.Node {
|
|
993
|
+
return notationGeneralProgrammer_decode_object(struct {
|
|
994
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
995
|
+
Object *schemametadata.MetadataObjectType
|
|
996
|
+
Input *shimast.Node
|
|
997
|
+
Explore nativeinternal.FeatureProgrammer_IExplore
|
|
998
|
+
}{Functor: props.Functor, Object: v.Object, Input: v.Input, Explore: notationGeneralProgrammer_feature_explore(v.Explore)})
|
|
999
|
+
},
|
|
1000
|
+
Success: func(exp *shimast.Expression) *shimast.Node {
|
|
1001
|
+
return exp
|
|
1002
|
+
},
|
|
1003
|
+
Escaper: func(v nativeiterate.Decode_union_object_escape) *shimast.Node {
|
|
1004
|
+
return notationGeneralProgrammer_create_throw_error(notationGeneralProgrammer_throwProps{
|
|
1005
|
+
Context: props.Context,
|
|
1006
|
+
Functor: props.Functor,
|
|
1007
|
+
Expected: v.Expected,
|
|
1008
|
+
Input: v.Input,
|
|
1009
|
+
})
|
|
1010
|
+
},
|
|
1011
|
+
Input: next.Input,
|
|
1012
|
+
Objects: next.Objects,
|
|
1013
|
+
Explore: next.Explore,
|
|
1014
|
+
})
|
|
1015
|
+
},
|
|
1016
|
+
Failure: func(next nativeinternal.FeatureProgrammer_ObjectorFailureProps) *shimast.Node {
|
|
1017
|
+
return notationGeneralProgrammer_create_throw_error(notationGeneralProgrammer_throwProps{
|
|
1018
|
+
Context: props.Context,
|
|
1019
|
+
Functor: props.Functor,
|
|
1020
|
+
Expected: next.Expected,
|
|
1021
|
+
Input: next.Input,
|
|
1022
|
+
})
|
|
1023
|
+
},
|
|
1024
|
+
},
|
|
1025
|
+
Generator: nativeinternal.FeatureProgrammer_IConfig_IGenerator{
|
|
1026
|
+
Arrays: func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
1027
|
+
return notationGeneralProgrammer_write_array_functions(struct {
|
|
1028
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
1029
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
1030
|
+
Collection *schemametadata.MetadataCollection
|
|
1031
|
+
}{Config: config, Functor: props.Functor, Collection: collection})
|
|
1032
|
+
},
|
|
1033
|
+
Tuples: func(collection *schemametadata.MetadataCollection) []*shimast.Node {
|
|
1034
|
+
return notationGeneralProgrammer_write_tuple_functions(struct {
|
|
1035
|
+
Config nativeinternal.FeatureProgrammer_IConfig
|
|
1036
|
+
Rename NotationGeneralProgrammer_IRename
|
|
1037
|
+
Context nativecontext.ITypiaContext
|
|
1038
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
1039
|
+
Collection *schemametadata.MetadataCollection
|
|
1040
|
+
}{Config: config, Rename: props.Rename, Context: props.Context, Functor: props.Functor, Collection: collection})
|
|
1041
|
+
},
|
|
1042
|
+
},
|
|
1043
|
+
}
|
|
1044
|
+
return config
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
1047
|
func notationGeneralProgrammer_initializer(props nativeinternal.FeatureProgrammer_InitializerProps) nativeinternal.FeatureProgrammer_InitializerOutput {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1048
|
+
collection := schemametadata.NewMetadataCollection()
|
|
1049
|
+
result := nativefactories.MetadataFactory.Analyze(nativefactories.MetadataFactory_IProps{
|
|
1050
|
+
Checker: props.Context.Checker,
|
|
1051
|
+
Transformer: props.Context.Transformer,
|
|
1052
|
+
Options: nativefactories.MetadataFactory_IOptions{
|
|
1053
|
+
Escape: false,
|
|
1054
|
+
Constant: true,
|
|
1055
|
+
Absorb: true,
|
|
1056
|
+
},
|
|
1057
|
+
Components: collection,
|
|
1058
|
+
Type: props.Type,
|
|
1059
|
+
})
|
|
1060
|
+
if result.Success == false {
|
|
1061
|
+
panic(nativecontext.TransformerError_from(struct {
|
|
1062
|
+
Code string
|
|
1063
|
+
Errors []nativecontext.TransformerError_MetadataFactory_IError
|
|
1064
|
+
}{
|
|
1065
|
+
Code: props.Functor.Method,
|
|
1066
|
+
Errors: notationGeneralProgrammer_errors(result.Errors),
|
|
1067
|
+
}))
|
|
1068
|
+
}
|
|
1069
|
+
return nativeinternal.FeatureProgrammer_InitializerOutput{
|
|
1070
|
+
Collection: collection,
|
|
1071
|
+
Metadata: result.Data,
|
|
1072
|
+
}
|
|
1073
1073
|
}
|
|
1074
1074
|
|
|
1075
1075
|
type notationGeneralProgrammer_throwProps struct {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1076
|
+
Context nativecontext.ITypiaContext
|
|
1077
|
+
Functor *nativehelpers.FunctionProgrammer
|
|
1078
|
+
Expected string
|
|
1079
|
+
Input *shimast.Node
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
1082
|
func notationGeneralProgrammer_create_throw_error(props notationGeneralProgrammer_throwProps) *shimast.Node {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1083
|
+
return notationGeneralProgrammer_factory.NewExpressionStatement(
|
|
1084
|
+
notationGeneralProgrammer_factory.NewCallExpression(
|
|
1085
|
+
notationGeneralProgrammer_internal(props.Context, "throwTypeGuardError"),
|
|
1086
|
+
nil,
|
|
1087
|
+
notationGeneralProgrammer_factory.NewNodeList(nil),
|
|
1088
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
1089
|
+
notationGeneralProgrammer_factory.NewObjectLiteralExpression(
|
|
1090
|
+
notationGeneralProgrammer_factory.NewNodeList([]*shimast.Node{
|
|
1091
|
+
notationGeneralProgrammer_factory.NewPropertyAssignment(nil, nativefactories.IdentifierFactory.Identifier("method"), nil, nil, notationGeneralProgrammer_factory.NewStringLiteral(props.Functor.Method, shimast.TokenFlagsNone)),
|
|
1092
|
+
notationGeneralProgrammer_factory.NewPropertyAssignment(nil, nativefactories.IdentifierFactory.Identifier("expected"), nil, nil, notationGeneralProgrammer_factory.NewStringLiteral(props.Expected, shimast.TokenFlagsNone)),
|
|
1093
|
+
notationGeneralProgrammer_factory.NewPropertyAssignment(nil, nativefactories.IdentifierFactory.Identifier("value"), nil, nil, props.Input),
|
|
1094
|
+
}),
|
|
1095
|
+
true,
|
|
1096
|
+
),
|
|
1097
|
+
}),
|
|
1098
|
+
shimast.NodeFlagsNone,
|
|
1099
|
+
),
|
|
1100
|
+
)
|
|
1101
1101
|
}
|
|
1102
1102
|
|
|
1103
1103
|
func notationGeneralProgrammer_is_instance(metadata *schemametadata.MetadataSchema) bool {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1104
|
+
return len(metadata.Objects) != 0 ||
|
|
1105
|
+
len(metadata.Arrays) != 0 ||
|
|
1106
|
+
len(metadata.Tuples) != 0 ||
|
|
1107
|
+
len(metadata.Sets) != 0 ||
|
|
1108
|
+
len(metadata.Maps) != 0 ||
|
|
1109
|
+
len(metadata.Natives) != 0 ||
|
|
1110
|
+
(metadata.Rest != nil && notationGeneralProgrammer_is_instance(metadata.Rest))
|
|
1111
1111
|
}
|
|
1112
1112
|
|
|
1113
1113
|
type notationGeneralProgrammer_IUnion struct {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1114
|
+
Type string
|
|
1115
|
+
Is func() *shimast.Node
|
|
1116
|
+
Value func() *shimast.Node
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
1119
|
func notationGeneralProgrammer_binary(left *shimast.Node, operator shimast.Kind, right *shimast.Node) *shimast.Node {
|
|
1120
|
-
|
|
1120
|
+
return notationGeneralProgrammer_factory.NewBinaryExpression(nil, left, nil, notationGeneralProgrammer_factory.NewToken(operator), right)
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
1123
|
func notationGeneralProgrammer_internal(context nativecontext.ITypiaContext, name string) *shimast.Node {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1124
|
+
if importer, ok := context.Importer.(interface{ Internal(string) *shimast.Node }); ok {
|
|
1125
|
+
return importer.Internal(name)
|
|
1126
|
+
}
|
|
1127
|
+
return notationGeneralProgrammer_factory.NewIdentifier(name)
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
1130
|
func notationGeneralProgrammer_import_type(context nativecontext.ITypiaContext, props nativeprogrammers.ImportProgrammer_TypeProps) *shimast.Node {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1131
|
+
if importer, ok := context.Importer.(interface {
|
|
1132
|
+
Type(nativeprogrammers.ImportProgrammer_TypeProps) *shimast.Node
|
|
1133
|
+
}); ok {
|
|
1134
|
+
return importer.Type(props)
|
|
1135
|
+
}
|
|
1136
|
+
if str, ok := props.Name.(string); ok {
|
|
1137
|
+
return notationGeneralProgrammer_factory.NewTypeReferenceNode(notationGeneralProgrammer_factory.NewIdentifier(str), notationGeneralProgrammer_factory.NewNodeList(props.Arguments))
|
|
1138
|
+
}
|
|
1139
|
+
return props.Name.(*shimast.Node)
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
1142
|
func notationGeneralProgrammer_type_name(context nativecontext.ITypiaContext, typ *shimchecker.Type, name *string) string {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1143
|
+
if name != nil {
|
|
1144
|
+
return *name
|
|
1145
|
+
}
|
|
1146
|
+
return nativefactories.TypeFactory.GetFullName(nativefactories.TypeFactory_GetFullNameProps{
|
|
1147
|
+
Checker: context.Checker,
|
|
1148
|
+
Type: typ,
|
|
1149
|
+
})
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
1152
|
func notationGeneralProgrammer_method_text(modulo *shimast.Node) string {
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1153
|
+
if modulo == nil {
|
|
1154
|
+
return ""
|
|
1155
|
+
}
|
|
1156
|
+
return modulo.Text()
|
|
1157
1157
|
}
|
|
1158
1158
|
|
|
1159
1159
|
func notationGeneralProgrammer_feature_explore(input any) nativeinternal.FeatureProgrammer_IExplore {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1160
|
+
switch v := input.(type) {
|
|
1161
|
+
case nativeinternal.FeatureProgrammer_IExplore:
|
|
1162
|
+
return v
|
|
1163
|
+
case *nativeinternal.FeatureProgrammer_IExplore:
|
|
1164
|
+
return *v
|
|
1165
|
+
default:
|
|
1166
|
+
return nativeinternal.FeatureProgrammer_IExplore{}
|
|
1167
|
+
}
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
1170
1170
|
func notationGeneralProgrammer_checker_explore(input any) nativeinternal.CheckerProgrammer_IExplore {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1171
|
+
v := notationGeneralProgrammer_feature_explore(input)
|
|
1172
|
+
return nativeinternal.CheckerProgrammer_IExplore{
|
|
1173
|
+
Tracable: v.Tracable,
|
|
1174
|
+
Source: v.Source,
|
|
1175
|
+
From: v.From,
|
|
1176
|
+
Postfix: v.Postfix,
|
|
1177
|
+
Start: v.Start,
|
|
1178
|
+
}
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
1181
|
func notationGeneralProgrammer_checker_explore_with_postfix(input any, postfix string) nativeinternal.CheckerProgrammer_IExplore {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1182
|
+
v := notationGeneralProgrammer_checker_explore(input)
|
|
1183
|
+
v.Postfix = v.Postfix + postfix
|
|
1184
|
+
return v
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
1187
|
func notationGeneralProgrammer_explore_with(explore nativeinternal.FeatureProgrammer_IExplore, source string, from string) nativeinternal.FeatureProgrammer_IExplore {
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1188
|
+
explore.Source = source
|
|
1189
|
+
explore.From = from
|
|
1190
|
+
return explore
|
|
1191
1191
|
}
|
|
1192
1192
|
|
|
1193
1193
|
func notationGeneralProgrammer_errors(errors []nativefactories.MetadataFactory_IError) []nativecontext.TransformerError_MetadataFactory_IError {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1194
|
+
output := make([]nativecontext.TransformerError_MetadataFactory_IError, 0, len(errors))
|
|
1195
|
+
for _, err := range errors {
|
|
1196
|
+
output = append(output, nativecontext.TransformerError_MetadataFactory_IError{
|
|
1197
|
+
Name: err.Name,
|
|
1198
|
+
Explore: nativecontext.TransformerError_MetadataFactory_IExplore{
|
|
1199
|
+
Object: err.Explore.Object,
|
|
1200
|
+
Property: err.Explore.Property,
|
|
1201
|
+
Parameter: err.Explore.Parameter,
|
|
1202
|
+
Output: err.Explore.Output,
|
|
1203
|
+
},
|
|
1204
|
+
Messages: append([]string{}, err.Messages...),
|
|
1205
|
+
})
|
|
1206
|
+
}
|
|
1207
|
+
return output
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
1210
|
func notationGeneralProgrammer_some_arrays(values []*schemametadata.MetadataArray, pred func(*schemametadata.MetadataArray) bool) bool {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1211
|
+
for _, value := range values {
|
|
1212
|
+
if pred(value) {
|
|
1213
|
+
return true
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return false
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
1219
|
func notationGeneralProgrammer_some_tuples(values []*schemametadata.MetadataTuple, pred func(*schemametadata.MetadataTuple) bool) bool {
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1220
|
+
for _, value := range values {
|
|
1221
|
+
if pred(value) {
|
|
1222
|
+
return true
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
return false
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
1228
|
func notationGeneralProgrammer_every_schema(values []*schemametadata.MetadataSchema, pred func(*schemametadata.MetadataSchema) bool) bool {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1229
|
+
if len(values) == 0 {
|
|
1230
|
+
return false
|
|
1231
|
+
}
|
|
1232
|
+
for _, value := range values {
|
|
1233
|
+
if pred(value) == false {
|
|
1234
|
+
return false
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
return true
|
|
1238
1238
|
}
|
|
1239
1239
|
|
|
1240
1240
|
func notationGeneralProgrammer_array_like_names[T interface {
|
|
1241
|
-
|
|
1241
|
+
*schemametadata.MetadataArray | *schemametadata.MetadataTuple
|
|
1242
1242
|
}](values []T) string {
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1243
|
+
names := make([]string, 0, len(values))
|
|
1244
|
+
for _, value := range values {
|
|
1245
|
+
switch typed := any(value).(type) {
|
|
1246
|
+
case *schemametadata.MetadataArray:
|
|
1247
|
+
names = append(names, typed.Type.Name)
|
|
1248
|
+
case *schemametadata.MetadataTuple:
|
|
1249
|
+
names = append(names, typed.Type.Name)
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
return strings.Join(names, " | ")
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
1255
|
func notationGeneralProgrammer_merge_functions(groups ...map[string]*shimast.Node) map[string]*shimast.Node {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1256
|
+
output := map[string]*shimast.Node{}
|
|
1257
|
+
for _, group := range groups {
|
|
1258
|
+
for key, value := range group {
|
|
1259
|
+
output[key] = value
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
return output
|
|
1263
1263
|
}
|
|
1264
1264
|
|
|
1265
1265
|
func notationGeneralProgrammer_capitalize(str string) string {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1266
|
+
if str == "" {
|
|
1267
|
+
return str
|
|
1268
|
+
}
|
|
1269
|
+
return strings.ToUpper(str[:1]) + str[1:]
|
|
1270
1270
|
}
|
|
1271
1271
|
|
|
1272
1272
|
var NotationGeneralProgrammer_Camel = NotationGeneralProgrammer_IRename{Name: "camel", Func: notationGeneralProgrammer_camel}
|
|
@@ -1274,108 +1274,108 @@ var NotationGeneralProgrammer_Pascal = NotationGeneralProgrammer_IRename{Name: "
|
|
|
1274
1274
|
var NotationGeneralProgrammer_Snake = NotationGeneralProgrammer_IRename{Name: "snake", Func: notationGeneralProgrammer_snake}
|
|
1275
1275
|
|
|
1276
1276
|
func notationGeneralProgrammer_camel(str string) string {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1277
|
+
return notationGeneralProgrammer_unsnake(str, func(value string) string {
|
|
1278
|
+
if value == "" {
|
|
1279
|
+
return value
|
|
1280
|
+
}
|
|
1281
|
+
if value == strings.ToUpper(value) {
|
|
1282
|
+
return strings.ToLower(value)
|
|
1283
|
+
}
|
|
1284
|
+
return strings.ToLower(value[:1]) + value[1:]
|
|
1285
|
+
}, func(value string, index int) string {
|
|
1286
|
+
if index == 0 {
|
|
1287
|
+
return strings.ToLower(value)
|
|
1288
|
+
}
|
|
1289
|
+
return notationGeneralProgrammer_capitalize(strings.ToLower(value))
|
|
1290
|
+
})
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
1293
|
func notationGeneralProgrammer_pascal(str string) string {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1294
|
+
return notationGeneralProgrammer_unsnake(str, func(value string) string {
|
|
1295
|
+
if value == "" {
|
|
1296
|
+
return value
|
|
1297
|
+
}
|
|
1298
|
+
return strings.ToUpper(value[:1]) + value[1:]
|
|
1299
|
+
}, func(value string, index int) string {
|
|
1300
|
+
return notationGeneralProgrammer_capitalize(value)
|
|
1301
|
+
})
|
|
1302
1302
|
}
|
|
1303
1303
|
|
|
1304
1304
|
func notationGeneralProgrammer_snake(str string) string {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1305
|
+
if str == "" {
|
|
1306
|
+
return str
|
|
1307
|
+
}
|
|
1308
|
+
prefix := ""
|
|
1309
|
+
for len(str) != 0 && str[0] == '_' {
|
|
1310
|
+
prefix += "_"
|
|
1311
|
+
str = str[1:]
|
|
1312
|
+
}
|
|
1313
|
+
out := func(value string) string { return prefix + value }
|
|
1314
|
+
items := strings.Split(str, "_")
|
|
1315
|
+
if len(items) > 1 {
|
|
1316
|
+
for i, item := range items {
|
|
1317
|
+
items[i] = strings.ToLower(item)
|
|
1318
|
+
}
|
|
1319
|
+
return out(strings.Join(items, "_"))
|
|
1320
|
+
}
|
|
1321
|
+
indexes := []int{}
|
|
1322
|
+
for i := 0; i < len(str); i++ {
|
|
1323
|
+
code := str[i]
|
|
1324
|
+
if 'A' <= code && code <= 'Z' {
|
|
1325
|
+
indexes = append(indexes, i)
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
for i := len(indexes) - 1; i > 0; i-- {
|
|
1329
|
+
now := indexes[i]
|
|
1330
|
+
prev := indexes[i-1]
|
|
1331
|
+
if now-prev == 1 {
|
|
1332
|
+
indexes = append(indexes[:i], indexes[i+1:]...)
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
if len(indexes) != 0 && indexes[0] == 0 {
|
|
1336
|
+
indexes = indexes[1:]
|
|
1337
|
+
}
|
|
1338
|
+
if len(indexes) == 0 {
|
|
1339
|
+
return strings.ToLower(str)
|
|
1340
|
+
}
|
|
1341
|
+
ret := ""
|
|
1342
|
+
for i, last := range indexes {
|
|
1343
|
+
first := 0
|
|
1344
|
+
if i != 0 {
|
|
1345
|
+
first = indexes[i-1]
|
|
1346
|
+
}
|
|
1347
|
+
ret += strings.ToLower(str[first:last])
|
|
1348
|
+
ret += "_"
|
|
1349
|
+
}
|
|
1350
|
+
ret += strings.ToLower(str[indexes[len(indexes)-1]:])
|
|
1351
|
+
return out(ret)
|
|
1352
1352
|
}
|
|
1353
1353
|
|
|
1354
1354
|
func notationGeneralProgrammer_unsnake(str string, plain func(string) string, snake func(string, int) string) string {
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1355
|
+
prefix := ""
|
|
1356
|
+
for len(str) != 0 && str[0] == '_' {
|
|
1357
|
+
prefix += "_"
|
|
1358
|
+
str = str[1:]
|
|
1359
|
+
}
|
|
1360
|
+
out := func(value string) string { return prefix + value }
|
|
1361
|
+
if str == "" {
|
|
1362
|
+
return out("")
|
|
1363
|
+
}
|
|
1364
|
+
raw := strings.Split(str, "_")
|
|
1365
|
+
items := []string{}
|
|
1366
|
+
for _, item := range raw {
|
|
1367
|
+
if item != "" {
|
|
1368
|
+
items = append(items, item)
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
if len(items) == 0 {
|
|
1372
|
+
return out("")
|
|
1373
|
+
}
|
|
1374
|
+
if len(items) == 1 {
|
|
1375
|
+
return out(plain(items[0]))
|
|
1376
|
+
}
|
|
1377
|
+
for i, item := range items {
|
|
1378
|
+
items[i] = snake(item, i)
|
|
1379
|
+
}
|
|
1380
|
+
return out(strings.Join(items, ""))
|
|
1381
1381
|
}
|