From 84d30e0127648a855b2055d058c1471787cf608d Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Wed, 6 Apr 2022 12:04:44 -0400 Subject: [PATCH] add memory kind last --- runtime/common/memorykind.go | 4 ++++ runtime/common/memorykind_string.go | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/common/memorykind.go b/runtime/common/memorykind.go index 797c18e416..9ceff85a93 100644 --- a/runtime/common/memorykind.go +++ b/runtime/common/memorykind.go @@ -116,4 +116,8 @@ const ( MemoryKindReferenceExpression MemoryKindForceExpression MemoryKindPathExpression + + // Placeholder kind to allow consistent indexing + // this should always be the last kind + MemoryKindLast ) diff --git a/runtime/common/memorykind_string.go b/runtime/common/memorykind_string.go index a2115d2e9a..9720461442 100644 --- a/runtime/common/memorykind_string.go +++ b/runtime/common/memorykind_string.go @@ -84,11 +84,12 @@ func _() { _ = x[MemoryKindReferenceExpression-73] _ = x[MemoryKindForceExpression-74] _ = x[MemoryKindPathExpression-75] + _ = x[MemoryKindLast-76] } -const _MemoryKind_name = "UnknownBoolAddressStringCharacterMetaTypeNumberArrayDictionaryCompositeOptionalNilVoidTypeValuePathValueCapabilityValueLinkValueStorageReferenceValueEphemeralReferenceValueInterpretedFunctionHostFunctionBoundFunctionBigIntRawStringAddressLocationBytesVariableTokenIdentifierTokenCommentTokenNumericLiteralTokenSyntaxIdentifierArgumentBlockFunctionDeclarationCompositeDeclarationInterfaceDeclarationEnumCaseDeclarationFieldDeclarationTransactionDeclarationImportDeclarationVariableDeclarationSpecialFunctionDeclarationPragmaDeclarationAssignmentStatementBreakStatementContinueStatementEmitStatementExpressionStatementForStatementIfStatementReturnStatementSwapStatementSwitchStatementWhileStatementBooleanExpressionNilExpressionStringExpressionIntegerExpressionFixedPointExpressionArrayExpressionDictionaryExpressionIdentifierExpressionInvocationExpressionMemberExpressionIndexExpressionConditionalExpressionUnaryExpressionBinaryExpressionFunctionExpressionCastingExpressionCreateExpressionDestroyExpressionReferenceExpressionForceExpressionPathExpression" +const _MemoryKind_name = "UnknownBoolAddressStringCharacterMetaTypeNumberArrayDictionaryCompositeOptionalNilVoidTypeValuePathValueCapabilityValueLinkValueStorageReferenceValueEphemeralReferenceValueInterpretedFunctionHostFunctionBoundFunctionBigIntRawStringAddressLocationBytesVariableTokenIdentifierTokenCommentTokenNumericLiteralTokenSyntaxIdentifierArgumentBlockFunctionDeclarationCompositeDeclarationInterfaceDeclarationEnumCaseDeclarationFieldDeclarationTransactionDeclarationImportDeclarationVariableDeclarationSpecialFunctionDeclarationPragmaDeclarationAssignmentStatementBreakStatementContinueStatementEmitStatementExpressionStatementForStatementIfStatementReturnStatementSwapStatementSwitchStatementWhileStatementBooleanExpressionNilExpressionStringExpressionIntegerExpressionFixedPointExpressionArrayExpressionDictionaryExpressionIdentifierExpressionInvocationExpressionMemberExpressionIndexExpressionConditionalExpressionUnaryExpressionBinaryExpressionFunctionExpressionCastingExpressionCreateExpressionDestroyExpressionReferenceExpressionForceExpressionPathExpressionLast" -var _MemoryKind_index = [...]uint16{0, 7, 11, 18, 24, 33, 41, 47, 52, 62, 71, 79, 82, 86, 95, 104, 119, 128, 149, 172, 191, 203, 216, 222, 231, 246, 251, 259, 274, 286, 305, 316, 326, 334, 339, 358, 378, 398, 417, 433, 455, 472, 491, 517, 534, 553, 567, 584, 597, 616, 628, 639, 654, 667, 682, 696, 713, 726, 742, 759, 779, 794, 814, 834, 854, 870, 885, 906, 921, 937, 955, 972, 988, 1005, 1024, 1039, 1053} +var _MemoryKind_index = [...]uint16{0, 7, 11, 18, 24, 33, 41, 47, 52, 62, 71, 79, 82, 86, 95, 104, 119, 128, 149, 172, 191, 203, 216, 222, 231, 246, 251, 259, 274, 286, 305, 316, 326, 334, 339, 358, 378, 398, 417, 433, 455, 472, 491, 517, 534, 553, 567, 584, 597, 616, 628, 639, 654, 667, 682, 696, 713, 726, 742, 759, 779, 794, 814, 834, 854, 870, 885, 906, 921, 937, 955, 972, 988, 1005, 1024, 1039, 1053, 1057} func (i MemoryKind) String() string { if i >= MemoryKind(len(_MemoryKind_index)-1) {