@@ -618,7 +618,7 @@ struct IntrinsicJSFragment: Sendable {
618618 printCode : { _ , scope , printer , _ in
619619 let retName = scope . variable ( " ret " )
620620 printer . write (
621- " const \( retName ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( enumBase ) .lift( \( scope . popTagReturn ( ) ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
621+ " const \( retName ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( enumBase ) .lift( \( scope . popTagReturn ( ) ) ); "
622622 )
623623 return [ retName ]
624624 }
@@ -699,7 +699,7 @@ struct IntrinsicJSFragment: Sendable {
699699 printer . write ( " if ( \( isSome ) ) { " )
700700 printer . indent {
701701 printer . write (
702- " \( enumVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( wrappedValue ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
702+ " \( enumVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( wrappedValue ) ); "
703703 )
704704 }
705705 printer . write ( " } " )
@@ -711,7 +711,7 @@ struct IntrinsicJSFragment: Sendable {
711711 printer . write ( " if ( \( isSome ) ) { " )
712712 printer . indent {
713713 printer . write (
714- " \( structVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
714+ " \( structVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift(); "
715715 )
716716 }
717717 printer . write ( " } else { " )
@@ -944,7 +944,7 @@ struct IntrinsicJSFragment: Sendable {
944944 printer . write ( " } else { " )
945945 printer . indent {
946946 printer . write (
947- " \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( tagVar ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
947+ " \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( tagVar ) ); "
948948 )
949949 }
950950 printer . write ( " } " )
@@ -956,7 +956,7 @@ struct IntrinsicJSFragment: Sendable {
956956 printer . write ( " if ( \( isSomeVar ) ) { " )
957957 printer . indent {
958958 printer . write (
959- " \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
959+ " \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift(); "
960960 )
961961 }
962962 printer . write ( " } else { " )
@@ -1283,7 +1283,7 @@ struct IntrinsicJSFragment: Sendable {
12831283 let targetVar = arguments [ 1 ]
12841284 let base = fullName . components ( separatedBy : " . " ) . last ?? fullName
12851285 printer . write (
1286- " let \( targetVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseId ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
1286+ " let \( targetVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseId ) ); "
12871287 )
12881288 return [ ]
12891289 }
@@ -1354,7 +1354,7 @@ struct IntrinsicJSFragment: Sendable {
13541354 case . associatedValueEnum ( let fullName ) :
13551355 let base = fullName . components ( separatedBy : " . " ) . last ?? fullName
13561356 printer . write (
1357- " \( targetVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( value ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
1357+ " \( targetVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( value ) ); "
13581358 )
13591359 default :
13601360 fatalError ( " Unsupported optional wrapped type in closure parameter lifting: \( wrappedType ) " )
@@ -1682,7 +1682,7 @@ struct IntrinsicJSFragment: Sendable {
16821682 let base = fullName . components ( separatedBy : " . " ) . last ?? fullName
16831683 let resultVar = scope . variable ( " result " )
16841684 printer . write (
1685- " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( scope . popTagReturn ( ) ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
1685+ " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( scope . popTagReturn ( ) ) ); "
16861686 )
16871687 printer . write ( " return \( resultVar ) ; " )
16881688 return [ ]
@@ -1907,7 +1907,7 @@ struct IntrinsicJSFragment: Sendable {
19071907 let caseId = arguments [ 0 ]
19081908 let resultVar = scope . variable ( " enumValue " )
19091909 printer . write (
1910- " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseId ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
1910+ " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseId ) ); "
19111911 )
19121912 return [ resultVar ]
19131913 }
@@ -1924,7 +1924,7 @@ struct IntrinsicJSFragment: Sendable {
19241924 printCode : { arguments , scope , printer , cleanupCode in
19251925 let resultVar = scope . variable ( " structValue " )
19261926 printer . write (
1927- " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
1927+ " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( base ) .lift(); "
19281928 )
19291929 return [ resultVar ]
19301930 }
@@ -2107,7 +2107,7 @@ struct IntrinsicJSFragment: Sendable {
21072107
21082108 // Generate lift function
21092109 printer . write (
2110- " lift: (tag, \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ) => { "
2110+ " lift: (tag) => { "
21112111 )
21122112 printer . indent {
21132113 printer . write ( " tag = tag | 0; " )
@@ -2505,7 +2505,7 @@ struct IntrinsicJSFragment: Sendable {
25052505 let caseIdVar = scope . variable ( " caseId " )
25062506 printer . write ( " const \( caseIdVar ) = \( scope . popI32Return ( ) ) ; " )
25072507 printer . write (
2508- " \( optVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseIdVar ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
2508+ " \( optVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseIdVar ) ); "
25092509 )
25102510 } else {
25112511 let wrappedFragment = associatedValuePopPayload ( type : wrappedType )
@@ -2565,7 +2565,7 @@ struct IntrinsicJSFragment: Sendable {
25652565 printCode : { arguments , scope , printer , cleanupCode in
25662566 let resultVar = scope . variable ( " structValue " )
25672567 printer . write (
2568- " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( structBase ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
2568+ " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( structBase ) .lift(); "
25692569 )
25702570 return [ resultVar ]
25712571 }
@@ -2705,7 +2705,7 @@ struct IntrinsicJSFragment: Sendable {
27052705 printCode : { arguments , scope , printer , cleanup in
27062706 let resultVar = scope . variable ( " struct " )
27072707 printer . write (
2708- " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( structBase ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
2708+ " const \( resultVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( structBase ) .lift(); "
27092709 )
27102710 return [ resultVar ]
27112711 }
@@ -2765,7 +2765,7 @@ struct IntrinsicJSFragment: Sendable {
27652765 printCode : { arguments , scope , printer , cleanup in
27662766 let resultVar = scope . variable ( " enumValue " )
27672767 printer . write (
2768- " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( scope . popTagReturn ( ) ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
2768+ " const \( resultVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( scope . popTagReturn ( ) ) , ); "
27692769 )
27702770 return [ resultVar ]
27712771 }
@@ -3125,7 +3125,7 @@ struct IntrinsicJSFragment: Sendable {
31253125 printer . write ( " }, " )
31263126
31273127 printer . write (
3128- " lift: ( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ) => { "
3128+ " lift: () => { "
31293129 )
31303130 printer . indent {
31313131 generateStructLiftCode (
@@ -3678,7 +3678,7 @@ struct IntrinsicJSFragment: Sendable {
36783678 let caseIdVar = scope . variable ( " enumCaseId " )
36793679 printer . write ( " const \( caseIdVar ) = \( scope . popI32Return ( ) ) ; " )
36803680 printer . write (
3681- " \( optVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseIdVar ) , \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
3681+ " \( optVar ) = \( JSGlueVariableScope . reservedEnumHelpers ) . \( base ) .lift( \( caseIdVar ) , ); "
36823682 )
36833683 } else {
36843684 let wrappedFragment = structFieldLiftFragment (
@@ -3712,7 +3712,7 @@ struct IntrinsicJSFragment: Sendable {
37123712 printCode : { arguments , scope , printer , cleanup in
37133713 let structVar = scope . variable ( " struct " )
37143714 printer . write (
3715- " const \( structVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( nestedName ) .lift( \( JSGlueVariableScope . reservedTmpRetStrings ) , \( JSGlueVariableScope . reservedTmpRetInts ) , \( JSGlueVariableScope . reservedTmpRetF32s ) , \( JSGlueVariableScope . reservedTmpRetF64s ) , \( JSGlueVariableScope . reservedTmpRetPointers ) ); "
3715+ " const \( structVar ) = \( JSGlueVariableScope . reservedStructHelpers ) . \( nestedName ) .lift(); "
37163716 )
37173717 return [ structVar ]
37183718 }
0 commit comments