typia 15.1.0 → 15.2.0
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/TypeGuardError.js.map +1 -1
- package/lib/basic.js.map +1 -1
- package/lib/compare.js.map +1 -1
- package/lib/functional.js.map +1 -1
- package/lib/http.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internal/_IProtobufWriter.js.map +1 -1
- package/lib/internal/_ProtobufReader.js.map +1 -1
- package/lib/internal/_ProtobufSizer.js.map +1 -1
- package/lib/internal/_ProtobufWriter.js.map +1 -1
- package/lib/internal/_accessExpressionAsString.js.map +1 -1
- package/lib/internal/_assertGuard.js.map +1 -1
- package/lib/internal/_coerceLlmArguments.js.map +1 -1
- package/lib/internal/_createLlmEvaluation.js.map +1 -1
- package/lib/internal/_createStandardSchema.js.map +1 -1
- package/lib/internal/_decimal.js.map +1 -1
- package/lib/internal/_functionalTypeGuardErrorFactory.js.map +1 -1
- package/lib/internal/_httpFormDataReadArray.js.map +1 -1
- package/lib/internal/_httpFormDataReadBigint.js.map +1 -1
- package/lib/internal/_httpFormDataReadBlob.js.map +1 -1
- package/lib/internal/_httpFormDataReadBoolean.js.map +1 -1
- package/lib/internal/_httpFormDataReadFile.js.map +1 -1
- package/lib/internal/_httpFormDataReadNumber.js.map +1 -1
- package/lib/internal/_httpFormDataReadString.js.map +1 -1
- package/lib/internal/_httpHeaderReadBigint.js.map +1 -1
- package/lib/internal/_httpHeaderReadBoolean.js.map +1 -1
- package/lib/internal/_httpHeaderReadNumber.js.map +1 -1
- package/lib/internal/_httpParameterReadBigint.js.map +1 -1
- package/lib/internal/_httpParameterReadBoolean.js.map +1 -1
- package/lib/internal/_httpParameterReadNumber.js.map +1 -1
- package/lib/internal/_httpParameterReadString.js.map +1 -1
- package/lib/internal/_httpQueryParseURLSearchParams.js.map +1 -1
- package/lib/internal/_httpQueryReadArray.js.map +1 -1
- package/lib/internal/_httpQueryReadBigint.js.map +1 -1
- package/lib/internal/_httpQueryReadBoolean.js.map +1 -1
- package/lib/internal/_httpQueryReadNumber.js.map +1 -1
- package/lib/internal/_httpQueryReadString.js.map +1 -1
- package/lib/internal/_isBetween.js.map +1 -1
- package/lib/internal/_isBigintString.js.map +1 -1
- package/lib/internal/_isFormatByte.js.map +1 -1
- package/lib/internal/_isFormatDate.js.map +1 -1
- package/lib/internal/_isFormatDateTime.js.map +1 -1
- package/lib/internal/_isFormatDuration.js.map +1 -1
- package/lib/internal/_isFormatEmail.js.map +1 -1
- package/lib/internal/_isFormatHostname.js.map +1 -1
- package/lib/internal/_isFormatIdnEmail.js.map +1 -1
- package/lib/internal/_isFormatIdnHostname.js.map +1 -1
- package/lib/internal/_isFormatIpv4.js.map +1 -1
- package/lib/internal/_isFormatIpv6.js.map +1 -1
- package/lib/internal/_isFormatIri.js.map +1 -1
- package/lib/internal/_isFormatIriReference.js.map +1 -1
- package/lib/internal/_isFormatJsonPointer.js.map +1 -1
- package/lib/internal/_isFormatPassword.js.map +1 -1
- package/lib/internal/_isFormatRegex.js.map +1 -1
- package/lib/internal/_isFormatRelativeJsonPointer.js.map +1 -1
- package/lib/internal/_isFormatTime.js.map +1 -1
- package/lib/internal/_isFormatUri.js.map +1 -1
- package/lib/internal/_isFormatUriReference.js.map +1 -1
- package/lib/internal/_isFormatUriTemplate.js.map +1 -1
- package/lib/internal/_isFormatUrl.js.map +1 -1
- package/lib/internal/_isFormatUuid.js.map +1 -1
- package/lib/internal/_isMultipleOf.js.map +1 -1
- package/lib/internal/_isTypeFloat.js.map +1 -1
- package/lib/internal/_isTypeInt16.js.map +1 -1
- package/lib/internal/_isTypeInt32.js.map +1 -1
- package/lib/internal/_isTypeInt64.js.map +1 -1
- package/lib/internal/_isTypeInt64Bigint.js.map +1 -1
- package/lib/internal/_isTypeInt8.js.map +1 -1
- package/lib/internal/_isTypeUint16.js.map +1 -1
- package/lib/internal/_isTypeUint32.js.map +1 -1
- package/lib/internal/_isTypeUint64.js.map +1 -1
- package/lib/internal/_isTypeUint64Bigint.js.map +1 -1
- package/lib/internal/_isTypeUint8.js.map +1 -1
- package/lib/internal/_isUniqueItems.js.map +1 -1
- package/lib/internal/_jsonStringifyArray.js.map +1 -1
- package/lib/internal/_jsonStringifyElement.js.map +1 -1
- package/lib/internal/_jsonStringifyNumber.js.map +1 -1
- package/lib/internal/_jsonStringifyProperty.js.map +1 -1
- package/lib/internal/_jsonStringifyRest.js.map +1 -1
- package/lib/internal/_jsonStringifyString.js.map +1 -1
- package/lib/internal/_jsonStringifyTail.js.map +1 -1
- package/lib/internal/_llmApplicationFinalize.js +8 -1
- package/lib/internal/_llmApplicationFinalize.js.map +1 -1
- package/lib/internal/_notationAny.js.map +1 -1
- package/lib/internal/_notationAssign.js.map +1 -1
- package/lib/internal/_notationCamel.js.map +1 -1
- package/lib/internal/_notationKebab.js.map +1 -1
- package/lib/internal/_notationKeyCollision.js.map +1 -1
- package/lib/internal/_notationPascal.js.map +1 -1
- package/lib/internal/_notationSnake.js.map +1 -1
- package/lib/internal/_parseLlmArguments.js.map +1 -1
- package/lib/internal/_plainCloneAny.js.map +1 -1
- package/lib/internal/_randomArray.js.map +1 -1
- package/lib/internal/_randomBigint.js.map +1 -1
- package/lib/internal/_randomBoolean.js.map +1 -1
- package/lib/internal/_randomFormatByte.js.map +1 -1
- package/lib/internal/_randomFormatDate.js.map +1 -1
- package/lib/internal/_randomFormatDatetime.js.map +1 -1
- package/lib/internal/_randomFormatDuration.js.map +1 -1
- package/lib/internal/_randomFormatEmail.js.map +1 -1
- package/lib/internal/_randomFormatHostname.js.map +1 -1
- package/lib/internal/_randomFormatIdnEmail.js.map +1 -1
- package/lib/internal/_randomFormatIdnHostname.js.map +1 -1
- package/lib/internal/_randomFormatIpv4.js.map +1 -1
- package/lib/internal/_randomFormatIpv6.js.map +1 -1
- package/lib/internal/_randomFormatIri.js.map +1 -1
- package/lib/internal/_randomFormatIriReference.js.map +1 -1
- package/lib/internal/_randomFormatJsonPointer.js.map +1 -1
- package/lib/internal/_randomFormatPassword.js.map +1 -1
- package/lib/internal/_randomFormatRegex.js.map +1 -1
- package/lib/internal/_randomFormatRelativeJsonPointer.js.map +1 -1
- package/lib/internal/_randomFormatTime.js.map +1 -1
- package/lib/internal/_randomFormatUri.js.map +1 -1
- package/lib/internal/_randomFormatUriReference.js.map +1 -1
- package/lib/internal/_randomFormatUriTemplate.js.map +1 -1
- package/lib/internal/_randomFormatUrl.js.map +1 -1
- package/lib/internal/_randomFormatUuid.js.map +1 -1
- package/lib/internal/_randomInteger.js.map +1 -1
- package/lib/internal/_randomMultiple.js.map +1 -1
- package/lib/internal/_randomNumber.js.map +1 -1
- package/lib/internal/_randomPattern.js.map +1 -1
- package/lib/internal/_randomPick.js.map +1 -1
- package/lib/internal/_randomString.js.map +1 -1
- package/lib/internal/_randomStringLength.js.map +1 -1
- package/lib/internal/_stringLength.js.map +1 -1
- package/lib/internal/_stringLengthGte.js.map +1 -1
- package/lib/internal/_stringLengthLte.js.map +1 -1
- package/lib/internal/_throwTypeGuardError.js.map +1 -1
- package/lib/internal/_validateReport.js.map +1 -1
- package/lib/internal/private/__notationRename.js.map +1 -1
- package/lib/internal/private/__randomComposition.js.map +1 -1
- package/lib/internal/private/__randomEpoch.js.map +1 -1
- package/lib/json.js.map +1 -1
- package/lib/llm.js.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/notations.js.map +1 -1
- package/lib/plain.js.map +1 -1
- package/lib/protobuf.js.map +1 -1
- package/lib/re-exports.js.map +1 -1
- package/lib/reflect.js.map +1 -1
- package/lib/transform.d.ts +5 -2
- package/lib/transform.js +6 -2
- package/lib/transform.js.map +1 -1
- package/lib/transform.mjs +7 -3
- package/lib/transform.mjs.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
- package/native/cmd/ttsc-typia/build.go +3 -1
- package/native/cmd/ttsc-typia/content_mapper_transform_ts71_test.go +102 -0
- package/native/cmd/ttsc-typia/diagnostics.go +1 -1
- package/native/cmd/ttsc-typia/distinct_programs_concurrent_emit_test.go +167 -0
- package/native/cmd/ttsc-typia/exact_optional_family_emission_contract_test.go +2 -1
- package/native/cmd/ttsc-typia/project_dependencies_heritage_forms_transform_test.go +84 -0
- package/native/cmd/ttsc-typia/schema_literal_helpers_test.go +2 -1
- package/native/cmd/ttsc-typia/transform.go +7 -6
- package/native/core/context/EmitFactory.go +20 -29
- package/native/core/context/ImportProgrammer.go +5 -7
- package/native/core/context/NodeFactory.go +25 -0
- package/native/core/context/node_factory_ownership_test.go +45 -0
- package/native/core/factories/ExpressionFactory.go +13 -14
- package/native/core/factories/IdentifierFactory.go +3 -5
- package/native/core/factories/LiteralFactory.go +6 -8
- package/native/core/factories/NumericRangeFactory.go +8 -10
- package/native/core/factories/StatementFactory.go +5 -7
- package/native/core/factories/TemplateFactory.go +1 -3
- package/native/core/factories/TypeFactory.go +7 -9
- package/native/core/factories/ValueFactory.go +5 -7
- package/native/core/factories/factory_utility_coverage_test.go +21 -20
- package/native/core/factories/internal/metadata/MetadataHelper.go +13 -13
- package/native/core/factories/internal/metadata/comment_tags_coverage_test.go +7 -16
- package/native/core/factories/internal/metadata/emplace_metadata_object.go +36 -27
- package/native/core/factories/internal/metadata/iterate_metadata_alias.go +2 -2
- package/native/core/factories/internal/metadata/iterate_metadata_constant.go +4 -4
- package/native/core/factories/internal/metadata/iterate_metadata_function.go +2 -2
- package/native/core/factories/internal/metadata/iterate_metadata_intersection.go +11 -11
- package/native/core/factories/internal/metadata/js_doc_link_text_test.go +6 -16
- package/native/core/factories/internal/metadata/js_doc_parameter_name_reads_qualified_name_test.go +2 -1
- package/native/core/factories/internal/metadata/js_doc_source_helpers_test.go +44 -0
- package/native/core/factories/internal/metadata/js_doc_type_tag_blank_separation_test.go +16 -22
- package/native/core/factories/numeric_range_factory_enforces_64bit_bounds_test.go +2 -1
- package/native/core/programmers/AssertProgrammer.go +16 -18
- package/native/core/programmers/IsProgrammer.go +10 -12
- package/native/core/programmers/RandomProgrammer.go +29 -31
- package/native/core/programmers/ValidateProgrammer.go +20 -22
- package/native/core/programmers/compare/CompareEqualProgrammer.go +1 -3
- package/native/core/programmers/compare/CompareLessProgrammer.go +1 -3
- package/native/core/programmers/functional/FunctionalAssertFunctionProgrammer.go +3 -5
- package/native/core/programmers/functional/FunctionalAssertParametersProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalAssertReturnProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalIsFunctionProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalIsParametersProgrammer.go +8 -10
- package/native/core/programmers/functional/FunctionalIsReturnProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalValidateFunctionProgrammer.go +4 -6
- package/native/core/programmers/functional/FunctionalValidateParametersProgrammer.go +2 -2
- package/native/core/programmers/functional/FunctionalValidateReturnProgrammer.go +2 -2
- package/native/core/programmers/helpers/ClassifyJoiner.go +1 -3
- package/native/core/programmers/helpers/CloneJoiner.go +8 -14
- package/native/core/programmers/helpers/FunctionProgrammer.go +3 -5
- package/native/core/programmers/helpers/NotationJoiner.go +6 -12
- package/native/core/programmers/helpers/PruneJoiner.go +10 -12
- package/native/core/programmers/helpers/RandomJoiner.go +5 -7
- package/native/core/programmers/helpers/StringifyJoinder.go +15 -17
- package/native/core/programmers/helpers/UnionExplorer.go +24 -26
- package/native/core/programmers/http/HttpAssertFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpAssertHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpAssertQueryProgrammer.go +1 -1
- package/native/core/programmers/http/HttpFormDataProgrammer.go +9 -11
- package/native/core/programmers/http/HttpHeadersProgrammer.go +7 -9
- package/native/core/programmers/http/HttpIsFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpIsHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpIsQueryProgrammer.go +1 -1
- package/native/core/programmers/http/HttpParameterProgrammer.go +2 -4
- package/native/core/programmers/http/HttpQueryProgrammer.go +8 -10
- package/native/core/programmers/http/HttpValidateFormDataProgrammer.go +2 -4
- package/native/core/programmers/http/HttpValidateHeadersProgrammer.go +1 -1
- package/native/core/programmers/http/HttpValidateQueryProgrammer.go +1 -1
- package/native/core/programmers/internal/CheckerProgrammer.go +26 -28
- package/native/core/programmers/internal/FeatureProgrammer.go +32 -34
- package/native/core/programmers/iterate/check_array_length.go +1 -1
- package/native/core/programmers/iterate/check_bigint.go +2 -4
- package/native/core/programmers/iterate/check_dynamic_key.go +5 -7
- package/native/core/programmers/iterate/check_dynamic_properties.go +43 -57
- package/native/core/programmers/iterate/check_everything.go +3 -5
- package/native/core/programmers/iterate/check_exclude.go +2 -4
- package/native/core/programmers/iterate/check_native.go +2 -4
- package/native/core/programmers/iterate/check_number.go +2 -4
- package/native/core/programmers/iterate/check_object.go +3 -5
- package/native/core/programmers/iterate/check_object_type_tags.go +1 -1
- package/native/core/programmers/iterate/check_string.go +2 -4
- package/native/core/programmers/iterate/check_template.go +7 -9
- package/native/core/programmers/iterate/decode_union_object.go +2 -4
- package/native/core/programmers/iterate/feature_object_entries.go +2 -4
- package/native/core/programmers/json/JsonAssertParseProgrammer.go +2 -2
- package/native/core/programmers/json/JsonAssertStringifyProgrammer.go +2 -4
- package/native/core/programmers/json/JsonIsParseProgrammer.go +4 -6
- package/native/core/programmers/json/JsonIsStringifyProgrammer.go +2 -4
- package/native/core/programmers/json/JsonStringifyProgrammer.go +37 -39
- package/native/core/programmers/json/JsonValidateParseProgrammer.go +2 -2
- package/native/core/programmers/json/JsonValidateStringifyProgrammer.go +2 -4
- package/native/core/programmers/llm/LlmApplicationProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmCoerceProgrammer.go +2 -4
- package/native/core/programmers/llm/LlmControllerProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmEvaluationProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmParametersProgrammer.go +1 -3
- package/native/core/programmers/llm/LlmParseProgrammer.go +3 -5
- package/native/core/programmers/llm/LlmSchemaProgrammer.go +5 -7
- package/native/core/programmers/llm/LlmStructuredOutputProgrammer.go +2 -4
- package/native/core/programmers/llm/llm_schema_programmer_coverage_test.go +1 -1
- package/native/core/programmers/notations/NotationAssertGeneralProgrammer.go +1 -3
- package/native/core/programmers/notations/NotationGeneralProgrammer.go +26 -28
- package/native/core/programmers/notations/NotationIsGeneralProgrammer.go +1 -3
- package/native/core/programmers/notations/NotationValidateGeneralProgrammer.go +1 -3
- package/native/core/programmers/plain/PlainAssertClassifyProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainAssertCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainAssertPruneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainClassifyProgrammer.go +44 -46
- package/native/core/programmers/plain/PlainCloneProgrammer.go +30 -32
- package/native/core/programmers/plain/PlainIsCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainIsPruneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainPruneProgrammer.go +26 -28
- package/native/core/programmers/plain/PlainValidateClassifyProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainValidateCloneProgrammer.go +2 -4
- package/native/core/programmers/plain/PlainValidatePruneProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufAssertDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufAssertEncodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufDecodeProgrammer.go +24 -25
- package/native/core/programmers/protobuf/ProtobufEncodeProgrammer.go +23 -25
- package/native/core/programmers/protobuf/ProtobufIsDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufIsEncodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufMessageProgrammer.go +1 -3
- package/native/core/programmers/protobuf/ProtobufValidateDecodeProgrammer.go +2 -4
- package/native/core/programmers/protobuf/ProtobufValidateEncodeProgrammer.go +3 -5
- package/native/core/programmers/protobuf/protobuf_programmer_helper_coverage_test.go +1 -1
- package/native/core/programmers/reflect/ReflectLiteralsProgrammer.go +1 -3
- package/native/core/schemas/metadata/MetadataCollection.go +2 -2
- package/native/core/schemas/metadata/MetadataDefaultLibrary.go +1 -1
- package/native/core/schemas/metadata/MetadataDependency.go +13 -13
- package/native/core/utils/PromiseTypeFactory.go +3 -3
- package/native/go.mod +3 -4
- package/native/go.work +1 -1
- package/native/transform/CallExpressionTransformer.go +4 -4
- package/native/transform/FileTransformer.go +2 -4
- package/native/transform/features/RandomTransformer.go +1 -3
- package/native/transform/features/compare/CompareEqualTransformer.go +1 -1
- package/native/transform/features/compare/CompareLessTransformer.go +1 -1
- package/native/transform/features/functional/FunctionalGenericTransformer.go +2 -2
- package/native/transform/features/llm/LlmCoerceTransformer.go +1 -1
- package/native/transform/features/llm/LlmEvaluationProbabilityDeclarations.go +1 -1
- package/native/transform/features/llm/LlmEvaluationTransformer.go +1 -1
- package/native/transform/features/llm/LlmParseTransformer.go +1 -1
- package/native/transform/features/llm/LlmSchemaTransformer.go +1 -3
- package/native/transform/features/reflect/ReflectNameTransformer.go +1 -3
- package/native/transform/file_transformer_coverage_test.go +2 -1
- package/native/transform/internal/GenericTransformer.go +1 -3
- package/package.json +6 -6
- package/src/transform.ts +6 -2
|
@@ -34,7 +34,7 @@ type Check_dynamic_keyProps struct {
|
|
|
34
34
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
35
35
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
36
36
|
func Check_dynamic_key(props Check_dynamic_keyProps) *shimast.Node {
|
|
37
|
-
f := nativecontext.
|
|
37
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
38
38
|
if check_dynamic_key_has_pure_string(props.Metadata) {
|
|
39
39
|
return f.NewKeywordExpression(shimast.KindTrueKeyword)
|
|
40
40
|
}
|
|
@@ -132,7 +132,7 @@ func Check_dynamic_key(props Check_dynamic_keyProps) *shimast.Node {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
if len(props.Metadata.Templates) != 0 {
|
|
135
|
-
conditions = append(conditions, check_dynamic_key_atomist(Check_template(Check_templateProps{
|
|
135
|
+
conditions = append(conditions, check_dynamic_key_atomist(Check_template(Check_templateProps{Emit: props.Context.Emit,
|
|
136
136
|
Context: props.Context,
|
|
137
137
|
Templates: props.Metadata.Templates,
|
|
138
138
|
Input: props.Input,
|
|
@@ -246,7 +246,7 @@ func check_dynamic_key_atomist(entry nativehelpers.ICheckEntry, emit ...*shimpri
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
func check_dynamic_key_reduce(expressions []*shimast.Node, operator shimast.Kind, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
249
|
-
f := nativecontext.
|
|
249
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
250
250
|
if len(expressions) == 0 {
|
|
251
251
|
return f.NewKeywordExpression(shimast.KindTrueKeyword)
|
|
252
252
|
}
|
|
@@ -264,7 +264,7 @@ func check_dynamic_key_reduce(expressions []*shimast.Node, operator shimast.Kind
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
func check_dynamic_key_strict_equal(left *shimast.Expression, right *shimast.Expression, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
267
|
-
f := nativecontext.
|
|
267
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
268
268
|
return f.NewBinaryExpression(
|
|
269
269
|
nil,
|
|
270
270
|
left,
|
|
@@ -278,8 +278,6 @@ func check_dynamic_key_internal(context nativecontext.ITypiaContext, name string
|
|
|
278
278
|
if importer := context.Importer; importer != nil {
|
|
279
279
|
return importer.Internal(name)
|
|
280
280
|
}
|
|
281
|
-
f := nativecontext.
|
|
281
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
282
282
|
return f.NewIdentifier(name)
|
|
283
283
|
}
|
|
284
|
-
|
|
285
|
-
var check_dynamic_key_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -38,7 +38,7 @@ type Check_dynamic_propertiesProps struct {
|
|
|
38
38
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
39
39
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
40
40
|
func Check_dynamic_properties(props Check_dynamic_propertiesProps) *shimast.Node {
|
|
41
|
-
f := nativecontext.
|
|
41
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
42
42
|
length := nativefactories.IdentifierFactory.Access(
|
|
43
43
|
props.Context.Emit,
|
|
44
44
|
f.NewCallExpression(
|
|
@@ -135,7 +135,7 @@ func Check_dynamic_properties(props Check_dynamic_propertiesProps) *shimast.Node
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
func check_dynamic_property(props Check_dynamic_propertiesProps) *shimast.Node {
|
|
138
|
-
f := nativecontext.
|
|
138
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
139
139
|
key := f.NewIdentifier("key")
|
|
140
140
|
value := f.NewIdentifier("value")
|
|
141
141
|
|
|
@@ -258,7 +258,7 @@ func check_dynamic_property(props Check_dynamic_propertiesProps) *shimast.Node {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
func is_regular_property(regular []nativehelpers.IExpressionEntry, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
261
|
-
f := nativecontext.
|
|
261
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
262
262
|
elements := make([]*shimast.Node, 0, len(regular))
|
|
263
263
|
for _, entry := range regular {
|
|
264
264
|
key := entry.Key.GetSoleLiteral()
|
|
@@ -267,14 +267,10 @@ func is_regular_property(regular []nativehelpers.IExpressionEntry, emit ...*shim
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return f.NewCallExpression(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
false,
|
|
275
|
-
),
|
|
276
|
-
"some",
|
|
277
|
-
),
|
|
270
|
+
f.NewPropertyAccessExpression(f.NewArrayLiteralExpression(
|
|
271
|
+
f.NewNodeList(elements),
|
|
272
|
+
false,
|
|
273
|
+
), nil, f.NewIdentifier("some"), shimast.NodeFlagsNone),
|
|
278
274
|
nil,
|
|
279
275
|
nil,
|
|
280
276
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -323,7 +319,7 @@ func check_dynamic_properties_internal(context nativecontext.ITypiaContext, name
|
|
|
323
319
|
if importer := context.Importer; importer != nil {
|
|
324
320
|
return importer.Internal(name)
|
|
325
321
|
}
|
|
326
|
-
f := nativecontext.
|
|
322
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
327
323
|
return f.NewIdentifier(name)
|
|
328
324
|
}
|
|
329
325
|
|
|
@@ -367,7 +363,7 @@ func check_dynamic_properties_key_shape(props Check_dynamic_propertiesProps, key
|
|
|
367
363
|
}
|
|
368
364
|
conditions = append(conditions, condition)
|
|
369
365
|
}
|
|
370
|
-
f := nativecontext.
|
|
366
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
371
367
|
for _, template := range entry.Key.Templates {
|
|
372
368
|
// Keep the same structural lowering as the full checker. Removing slot
|
|
373
369
|
// tags first would change constrained string captures from [\s\S] to .
|
|
@@ -454,28 +450,24 @@ func check_dynamic_properties_key_expected(dynamic []nativehelpers.IExpressionEn
|
|
|
454
450
|
// The advice `Superfluous` gives -- remove the property -- is wrong here. The
|
|
455
451
|
// property is declared; its key is what broke.
|
|
456
452
|
func check_dynamic_properties_invalid_key_description(emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
457
|
-
f := nativecontext.
|
|
453
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
458
454
|
return f.NewCallExpression(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
f.
|
|
464
|
-
f.
|
|
465
|
-
|
|
466
|
-
f.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
true,
|
|
476
|
-
),
|
|
477
|
-
"join",
|
|
478
|
-
),
|
|
455
|
+
f.NewPropertyAccessExpression(f.NewArrayLiteralExpression(
|
|
456
|
+
f.NewNodeList([]*shimast.Node{
|
|
457
|
+
f.NewTemplateExpression(
|
|
458
|
+
f.NewTemplateHead("The key `", "The key \\`", shimast.TokenFlagsNone),
|
|
459
|
+
f.NewNodeList([]*shimast.Node{
|
|
460
|
+
f.NewTemplateSpan(
|
|
461
|
+
f.NewIdentifier("key"),
|
|
462
|
+
f.NewTemplateTail("` does not satisfy the type its index signature declares.", "\\` does not satisfy the type its index signature declares.", shimast.TokenFlagsNone),
|
|
463
|
+
),
|
|
464
|
+
}),
|
|
465
|
+
),
|
|
466
|
+
f.NewStringLiteral("", shimast.TokenFlagsNone),
|
|
467
|
+
f.NewStringLiteral("Please correct the key next time.", shimast.TokenFlagsNone),
|
|
468
|
+
}),
|
|
469
|
+
true,
|
|
470
|
+
), nil, f.NewIdentifier("join"), shimast.NodeFlagsNone),
|
|
479
471
|
nil,
|
|
480
472
|
nil,
|
|
481
473
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -486,28 +478,24 @@ func check_dynamic_properties_invalid_key_description(emit ...*shimprinter.EmitC
|
|
|
486
478
|
}
|
|
487
479
|
|
|
488
480
|
func check_dynamic_properties_superfluous_description(emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
489
|
-
f := nativecontext.
|
|
481
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
490
482
|
return f.NewCallExpression(
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
f.
|
|
496
|
-
f.
|
|
497
|
-
|
|
498
|
-
f.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
true,
|
|
508
|
-
),
|
|
509
|
-
"join",
|
|
510
|
-
),
|
|
483
|
+
f.NewPropertyAccessExpression(f.NewArrayLiteralExpression(
|
|
484
|
+
f.NewNodeList([]*shimast.Node{
|
|
485
|
+
f.NewTemplateExpression(
|
|
486
|
+
f.NewTemplateHead("The property `", "The property \\`", shimast.TokenFlagsNone),
|
|
487
|
+
f.NewNodeList([]*shimast.Node{
|
|
488
|
+
f.NewTemplateSpan(
|
|
489
|
+
f.NewIdentifier("key"),
|
|
490
|
+
f.NewTemplateTail("` is not defined in the object type.", "\\` is not defined in the object type.", shimast.TokenFlagsNone),
|
|
491
|
+
),
|
|
492
|
+
}),
|
|
493
|
+
),
|
|
494
|
+
f.NewStringLiteral("", shimast.TokenFlagsNone),
|
|
495
|
+
f.NewStringLiteral("Please remove the property next time.", shimast.TokenFlagsNone),
|
|
496
|
+
}),
|
|
497
|
+
true,
|
|
498
|
+
), nil, f.NewIdentifier("join"), shimast.NodeFlagsNone),
|
|
511
499
|
nil,
|
|
512
500
|
nil,
|
|
513
501
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -516,5 +504,3 @@ func check_dynamic_properties_superfluous_description(emit ...*shimprinter.EmitC
|
|
|
516
504
|
shimast.NodeFlagsNone,
|
|
517
505
|
)
|
|
518
506
|
}
|
|
519
|
-
|
|
520
|
-
var check_dynamic_properties_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -15,9 +15,9 @@ import (
|
|
|
15
15
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
16
16
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
17
17
|
func Check_everything(array *shimast.Expression, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
18
|
-
f := nativecontext.
|
|
18
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
19
19
|
return f.NewCallExpression(
|
|
20
|
-
|
|
20
|
+
f.NewPropertyAccessExpression(array, nil, f.NewIdentifier("every"), shimast.NodeFlagsNone),
|
|
21
21
|
nil,
|
|
22
22
|
nil,
|
|
23
23
|
f.NewNodeList([]*shimast.Node{
|
|
@@ -25,7 +25,7 @@ func Check_everything(array *shimast.Expression, emit ...*shimprinter.EmitContex
|
|
|
25
25
|
nil,
|
|
26
26
|
nil,
|
|
27
27
|
f.NewNodeList([]*shimast.Node{
|
|
28
|
-
nativefactories.IdentifierFactory.Parameter("flag", nativefactories.TypeFactory.Keyword("boolean"), nil),
|
|
28
|
+
nativefactories.IdentifierFactory.Parameter("flag", nativefactories.TypeFactory.Keyword("boolean", emit...), nil, emit...),
|
|
29
29
|
}),
|
|
30
30
|
nil,
|
|
31
31
|
nil,
|
|
@@ -36,5 +36,3 @@ func Check_everything(array *shimast.Expression, emit ...*shimprinter.EmitContex
|
|
|
36
36
|
shimast.NodeFlagsNone,
|
|
37
37
|
)
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
var check_everything_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -29,7 +29,7 @@ func check_exclude_condition(
|
|
|
29
29
|
if len(values) == 0 {
|
|
30
30
|
return nil
|
|
31
31
|
}
|
|
32
|
-
f := nativecontext.
|
|
32
|
+
f := nativecontext.NodeFactoryOf(emit)
|
|
33
33
|
var expression *shimast.Node
|
|
34
34
|
for _, value := range values {
|
|
35
35
|
comparison := f.NewBinaryExpression(
|
|
@@ -74,7 +74,7 @@ func check_exclude_values(tag nativemetadata.IMetadataTypeTag) []any {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
func check_exclude_literal(typ string, value any, emit *shimprinter.EmitContext) *shimast.Node {
|
|
77
|
-
f := nativecontext.
|
|
77
|
+
f := nativecontext.NodeFactoryOf(emit)
|
|
78
78
|
switch typ {
|
|
79
79
|
case "string":
|
|
80
80
|
return f.NewStringLiteral(fmt.Sprint(value), shimast.TokenFlagsNone)
|
|
@@ -84,5 +84,3 @@ func check_exclude_literal(typ string, value any, emit *shimprinter.EmitContext)
|
|
|
84
84
|
return f.NewIdentifier(fmt.Sprint(value))
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
var check_exclude_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -29,8 +29,8 @@ type Check_nativeProps struct {
|
|
|
29
29
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
30
30
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
31
31
|
func Check_native(props Check_nativeProps) *shimast.Node {
|
|
32
|
-
f := nativecontext.
|
|
33
|
-
instanceOf := nativefactories.ExpressionFactory.IsInstanceOf(props.Name, props.Input)
|
|
32
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
33
|
+
instanceOf := nativefactories.ExpressionFactory.IsInstanceOf(props.Name, props.Input, props.Emit)
|
|
34
34
|
if atomic, ok := nativemetadata.MetadataSchema_atomicLikeNative(props.Name); ok {
|
|
35
35
|
return f.NewBinaryExpression(
|
|
36
36
|
nil,
|
|
@@ -48,5 +48,3 @@ func Check_native(props Check_nativeProps) *shimast.Node {
|
|
|
48
48
|
}
|
|
49
49
|
return instanceOf
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
var check_native_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -34,7 +34,7 @@ type Check_numberProps struct {
|
|
|
34
34
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
35
35
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
36
36
|
func Check_number(props Check_numberProps) nativehelpers.ICheckEntry {
|
|
37
|
-
f := nativecontext.
|
|
37
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
38
38
|
base := f.NewBinaryExpression(
|
|
39
39
|
nil,
|
|
40
40
|
f.NewStringLiteral("number", shimast.TokenFlagsNone),
|
|
@@ -190,7 +190,5 @@ func check_number_transpile(context nativecontext.ITypiaContext, script string)
|
|
|
190
190
|
return nativefactories.ExpressionFactory.Transpile(nativefactories.ExpressionFactory_TranspileProps{
|
|
191
191
|
Importer: importer,
|
|
192
192
|
Script: script,
|
|
193
|
-
})
|
|
193
|
+
}, context.Emit)
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
var check_number_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -107,7 +107,7 @@ func check_object_regular_expression(props Check_objectProps, entry nativehelper
|
|
|
107
107
|
if !entry.StrictOptionalUndefined || key == nil {
|
|
108
108
|
return entry.Expression
|
|
109
109
|
}
|
|
110
|
-
f := nativecontext.
|
|
110
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
111
111
|
present := f.NewBinaryExpression(
|
|
112
112
|
nil,
|
|
113
113
|
f.NewStringLiteral(*key, shimast.TokenFlagsNone),
|
|
@@ -130,7 +130,7 @@ type check_object_reduceProps struct {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
func check_object_reduce(props check_object_reduceProps, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
133
|
-
f := nativecontext.
|
|
133
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
134
134
|
if len(props.Expressions) == 0 {
|
|
135
135
|
return props.Config.Positive
|
|
136
136
|
}
|
|
@@ -145,8 +145,6 @@ func check_object_reduce(props check_object_reduceProps, emit ...*shimprinter.Em
|
|
|
145
145
|
f.NewArrayLiteralExpression(
|
|
146
146
|
f.NewNodeList(props.Expressions),
|
|
147
147
|
false,
|
|
148
|
-
),
|
|
148
|
+
), emit...,
|
|
149
149
|
)
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
var check_object_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -29,7 +29,7 @@ type Check_stringProps struct {
|
|
|
29
29
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
30
30
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
31
31
|
func Check_string(props Check_stringProps) nativehelpers.ICheckEntry {
|
|
32
|
-
f := nativecontext.
|
|
32
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
33
33
|
conditions := check_string_type_tags(props)
|
|
34
34
|
return nativehelpers.ICheckEntry{
|
|
35
35
|
Expected: props.Atomic.GetName(),
|
|
@@ -86,7 +86,5 @@ func check_string_transpile(context nativecontext.ITypiaContext, script string)
|
|
|
86
86
|
return nativefactories.ExpressionFactory.Transpile(nativefactories.ExpressionFactory_TranspileProps{
|
|
87
87
|
Importer: importer,
|
|
88
88
|
Script: script,
|
|
89
|
-
})
|
|
89
|
+
}, context.Emit)
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
var check_string_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -35,7 +35,7 @@ type Check_templateProps struct {
|
|
|
35
35
|
// @evidence contracts/common.md#prohibited-implementation-shortcuts Its inputs are its arguments and the context they carry, and it keeps no state of its own.
|
|
36
36
|
// @evidence contracts/common.md#meaningful-documentation The doc states what it builds.
|
|
37
37
|
func Check_template(props Check_templateProps) nativehelpers.ICheckEntry {
|
|
38
|
-
f := nativecontext.
|
|
38
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
39
39
|
conditions := []*shimast.Node{
|
|
40
40
|
f.NewBinaryExpression(
|
|
41
41
|
nil,
|
|
@@ -268,7 +268,7 @@ func check_template_value_conditions(props Check_templateProps, base string, ato
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
func check_template_coerce_input(kind string, input *shimast.Expression, emit *shimprinter.EmitContext) *shimast.Expression {
|
|
271
|
-
f := nativecontext.
|
|
271
|
+
f := nativecontext.NodeFactoryOf(emit)
|
|
272
272
|
coerce := ""
|
|
273
273
|
switch kind {
|
|
274
274
|
case "number":
|
|
@@ -295,7 +295,7 @@ func check_template_coerce_input(kind string, input *shimast.Expression, emit *s
|
|
|
295
295
|
// check_template_value_conditions so direct captures and backtracking slices
|
|
296
296
|
// share the same path.
|
|
297
297
|
func check_template_capture_input(pattern string, capture templateCapture, input *shimast.Expression, emit *shimprinter.EmitContext) *shimast.Expression {
|
|
298
|
-
f := nativecontext.
|
|
298
|
+
f := nativecontext.NodeFactoryOf(emit)
|
|
299
299
|
element := f.NewElementAccessExpression(
|
|
300
300
|
f.NewCallExpression(
|
|
301
301
|
f.NewIdentifier("RegExp(/"+pattern+"/).exec"),
|
|
@@ -318,7 +318,7 @@ func check_template_capture_input(pattern string, capture templateCapture, input
|
|
|
318
318
|
// semantics without repeating the same suffix search or committing to
|
|
319
319
|
// RegExp.exec's single greedy capture.
|
|
320
320
|
func check_template_backtracking(props Check_templateProps, tpl *nativemetadata.MetadataTemplate) *shimast.Node {
|
|
321
|
-
f := nativecontext.
|
|
321
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
322
322
|
statements := make([]*shimast.Node, 0, (len(tpl.Row)+1)*2+1)
|
|
323
323
|
for index := 0; index <= len(tpl.Row); index++ {
|
|
324
324
|
memoName := fmt.Sprintf("_templateMemo%d", index)
|
|
@@ -408,7 +408,7 @@ func check_template_backtracking(props Check_templateProps, tpl *nativemetadata.
|
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
func check_template_backtracking_step(props Check_templateProps, tpl *nativemetadata.MetadataTemplate, index int, offset *shimast.Expression) *shimast.Node {
|
|
411
|
-
f := nativecontext.
|
|
411
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
412
412
|
if index == len(tpl.Row) {
|
|
413
413
|
return f.NewBinaryExpression(
|
|
414
414
|
nil,
|
|
@@ -538,7 +538,7 @@ func check_template_backtracking_step(props Check_templateProps, tpl *nativemeta
|
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
func check_template_backtracking_call(index int, offset *shimast.Expression, emit *shimprinter.EmitContext) *shimast.Node {
|
|
541
|
-
f := nativecontext.
|
|
541
|
+
f := nativecontext.NodeFactoryOf(emit)
|
|
542
542
|
return f.NewCallExpression(
|
|
543
543
|
f.NewIdentifier(fmt.Sprintf("_templateVisit%d", index)),
|
|
544
544
|
nil,
|
|
@@ -653,7 +653,7 @@ func check_template_inline_interpolation_tags(props Check_templateProps, tpl *na
|
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
func check_template_reduce(expressions []*shimast.Node, operator shimast.Kind, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
656
|
-
f := nativecontext.
|
|
656
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
657
657
|
if len(expressions) == 0 {
|
|
658
658
|
return f.NewKeywordExpression(shimast.KindTrueKeyword)
|
|
659
659
|
}
|
|
@@ -669,5 +669,3 @@ func check_template_reduce(expressions []*shimast.Node, operator shimast.Kind, e
|
|
|
669
669
|
}
|
|
670
670
|
return output
|
|
671
671
|
}
|
|
672
|
-
|
|
673
|
-
var check_template_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -88,7 +88,7 @@ func Decode_union_object(props Decode_union_objectProps) *shimast.Node {
|
|
|
88
88
|
},
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
|
-
f := nativecontext.
|
|
91
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
92
92
|
return f.NewCallExpression(
|
|
93
93
|
f.NewArrowFunction(
|
|
94
94
|
nil,
|
|
@@ -126,7 +126,7 @@ type decode_union_object_IBranch struct {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
func decode_union_object_iterate(props decode_union_object_iterateProps) *shimast.Node {
|
|
129
|
-
f := nativecontext.
|
|
129
|
+
f := nativecontext.NodeFactoryOf(props.Emit)
|
|
130
130
|
branches := []decode_union_object_IBranch{}
|
|
131
131
|
for _, u := range props.Unions {
|
|
132
132
|
condition := u.Is()
|
|
@@ -186,5 +186,3 @@ type decode_union_object_IUnion struct {
|
|
|
186
186
|
Is func() *shimast.Node
|
|
187
187
|
Value func() *shimast.Node
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
var decode_union_object_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -127,7 +127,7 @@ func Feature_object_entries(props Feature_object_entriesProps) []nativehelpers.I
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
func feature_object_entries_property_input(input *shimast.Expression, sole *string, emit ...*shimprinter.EmitContext) *shimast.Node {
|
|
130
|
-
f := nativecontext.
|
|
130
|
+
f := nativecontext.NodeFactoryOf(emit...)
|
|
131
131
|
if sole == nil {
|
|
132
132
|
return f.NewIdentifier("value")
|
|
133
133
|
}
|
|
@@ -168,7 +168,7 @@ func feature_object_entries_internal(context nativecontext.ITypiaContext, name s
|
|
|
168
168
|
if importer := context.Importer; importer != nil {
|
|
169
169
|
return importer.Internal(name)
|
|
170
170
|
}
|
|
171
|
-
f := nativecontext.
|
|
171
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
172
172
|
return f.NewIdentifier(name)
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -224,5 +224,3 @@ var feature_object_entries_reserved = map[string]bool{
|
|
|
224
224
|
"while": true,
|
|
225
225
|
"with": true,
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
var feature_object_entries_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
@@ -32,7 +32,7 @@ type JsonAssertParseProgrammer_DecomposeProps struct {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
func (jsonAssertParseProgrammerNamespace) Decompose(props JsonAssertParseProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
35
|
-
f := nativecontext.
|
|
35
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
36
36
|
nativefactories.JsonMetadataFactory.Analyze(nativefactories.JsonMetadataFactory_IProps{
|
|
37
37
|
Method: props.Functor.Method,
|
|
38
38
|
Checker: props.Context.Checker,
|
|
@@ -116,7 +116,7 @@ func (jsonAssertParseProgrammerNamespace) Write(props nativecontext.IProgrammerP
|
|
|
116
116
|
Name: props.Name,
|
|
117
117
|
Init: props.Init,
|
|
118
118
|
})
|
|
119
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
119
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
120
120
|
Modulo: props.Modulo,
|
|
121
121
|
Functor: functor,
|
|
122
122
|
Result: result,
|
|
@@ -31,8 +31,6 @@ type JsonAssertStringifyProgrammer_DecomposeProps struct {
|
|
|
31
31
|
Init *shimast.Node
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var jsonAssertStringifyProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
35
|
-
|
|
36
34
|
func (jsonAssertStringifyProgrammerNamespace) Decompose(props JsonAssertStringifyProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
37
35
|
assertContext := props.Context
|
|
38
36
|
functional := false
|
|
@@ -54,7 +52,7 @@ func (jsonAssertStringifyProgrammerNamespace) Decompose(props JsonAssertStringif
|
|
|
54
52
|
Name: props.Name,
|
|
55
53
|
Validated: true,
|
|
56
54
|
})
|
|
57
|
-
f := nativecontext.
|
|
55
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
58
56
|
statements := append([]*shimast.Node{}, assert.Statements...)
|
|
59
57
|
statements = append(statements, stringify.Statements...)
|
|
60
58
|
statements = append(statements,
|
|
@@ -109,7 +107,7 @@ func (jsonAssertStringifyProgrammerNamespace) Write(props nativecontext.IProgram
|
|
|
109
107
|
Name: props.Name,
|
|
110
108
|
Init: props.Init,
|
|
111
109
|
})
|
|
112
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
110
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
113
111
|
Modulo: props.Modulo,
|
|
114
112
|
Functor: functor,
|
|
115
113
|
Result: result,
|
|
@@ -28,8 +28,6 @@ type JsonIsParseProgrammer_DecomposeProps struct {
|
|
|
28
28
|
Name *string
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
var jsonParseProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
32
|
-
|
|
33
31
|
func (jsonIsParseProgrammerNamespace) Decompose(props JsonIsParseProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
34
32
|
is := nativeprogrammers.IsProgrammer.Decompose(nativeprogrammers.IsProgrammer_DecomposeProps{
|
|
35
33
|
Context: jsonParseProgrammer_context(props.Context, &jsonParseProgrammer_options{
|
|
@@ -42,7 +40,7 @@ func (jsonIsParseProgrammerNamespace) Decompose(props JsonIsParseProgrammer_Deco
|
|
|
42
40
|
Name: props.Name,
|
|
43
41
|
})
|
|
44
42
|
|
|
45
|
-
f := nativecontext.
|
|
43
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
46
44
|
return nativeinternal.FeatureProgrammer_IDecomposed{
|
|
47
45
|
Functions: is.Functions,
|
|
48
46
|
Statements: append(append([]*shimast.Node{}, is.Statements...), nativefactories.StatementFactory.Constant(nativefactories.StatementFactory_ConstantProps{
|
|
@@ -114,7 +112,7 @@ func (jsonIsParseProgrammerNamespace) Write(props nativecontext.IProgrammerProps
|
|
|
114
112
|
Type: props.Type,
|
|
115
113
|
Name: props.Name,
|
|
116
114
|
})
|
|
117
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
115
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
118
116
|
Modulo: props.Modulo,
|
|
119
117
|
Functor: functor,
|
|
120
118
|
Result: result,
|
|
@@ -150,7 +148,7 @@ func jsonProgrammer_import_type(context nativecontext.ITypiaContext, props nativ
|
|
|
150
148
|
if importer := context.Importer; importer != nil {
|
|
151
149
|
return importer.Type(props)
|
|
152
150
|
}
|
|
153
|
-
f := nativecontext.
|
|
151
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
154
152
|
if str, ok := props.Name.(string); ok {
|
|
155
153
|
return f.NewTypeReferenceNode(f.NewIdentifier(str), f.NewNodeList(props.Arguments))
|
|
156
154
|
}
|
|
@@ -158,7 +156,7 @@ func jsonProgrammer_import_type(context nativecontext.ITypiaContext, props nativ
|
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
func jsonProgrammer_typeReference(context nativecontext.ITypiaContext, typ *shimchecker.Type, name *string) *shimast.Node {
|
|
161
|
-
f := nativecontext.
|
|
159
|
+
f := nativecontext.NodeFactoryOf(context.Emit)
|
|
162
160
|
if name != nil {
|
|
163
161
|
return f.NewTypeReferenceNode(f.NewIdentifier(*name), nil)
|
|
164
162
|
}
|
|
@@ -29,8 +29,6 @@ type JsonIsStringifyProgrammer_DecomposeProps struct {
|
|
|
29
29
|
Name *string
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
var jsonIsStringifyProgrammer_factory = shimast.NewNodeFactory(shimast.NodeFactoryHooks{})
|
|
33
|
-
|
|
34
32
|
func (jsonIsStringifyProgrammerNamespace) Decompose(props JsonIsStringifyProgrammer_DecomposeProps) nativeinternal.FeatureProgrammer_IDecomposed {
|
|
35
33
|
isContext := props.Context
|
|
36
34
|
functional := false
|
|
@@ -57,7 +55,7 @@ func (jsonIsStringifyProgrammerNamespace) Decompose(props JsonIsStringifyProgram
|
|
|
57
55
|
Validated: true,
|
|
58
56
|
})
|
|
59
57
|
|
|
60
|
-
f := nativecontext.
|
|
58
|
+
f := nativecontext.NodeFactoryOf(props.Context.Emit)
|
|
61
59
|
statements := append([]*shimast.Node{}, is.Statements...)
|
|
62
60
|
statements = append(statements, stringify.Statements...)
|
|
63
61
|
statements = append(statements,
|
|
@@ -113,7 +111,7 @@ func (jsonIsStringifyProgrammerNamespace) Write(props nativecontext.IProgrammerP
|
|
|
113
111
|
Type: props.Type,
|
|
114
112
|
Name: props.Name,
|
|
115
113
|
})
|
|
116
|
-
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{
|
|
114
|
+
return nativeinternal.FeatureProgrammer.WriteDecomposed(nativeinternal.FeatureProgrammer_WriteDecomposedProps{Emit: props.Context.Emit,
|
|
117
115
|
Modulo: props.Modulo,
|
|
118
116
|
Functor: functor,
|
|
119
117
|
Result: result,
|