@harmoniclabs/pebble 0.1.0-dev0
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/dist/IR/IRHash.d.ts +8 -0
- package/dist/IR/IRHash.js +78 -0
- package/dist/IR/IRNodeKind.d.ts +17 -0
- package/dist/IR/IRNodeKind.js +19 -0
- package/dist/IR/IRNodes/BaseIRMetadata.d.ts +3 -0
- package/dist/IR/IRNodes/BaseIRMetadata.js +1 -0
- package/dist/IR/IRNodes/IRApp.d.ts +36 -0
- package/dist/IR/IRNodes/IRApp.js +91 -0
- package/dist/IR/IRNodes/IRCase.d.ts +32 -0
- package/dist/IR/IRNodes/IRCase.js +91 -0
- package/dist/IR/IRNodes/IRConst.d.ts +49 -0
- package/dist/IR/IRNodes/IRConst.js +273 -0
- package/dist/IR/IRNodes/IRConstr.d.ts +30 -0
- package/dist/IR/IRNodes/IRConstr.js +87 -0
- package/dist/IR/IRNodes/IRDelayed.d.ts +31 -0
- package/dist/IR/IRNodes/IRDelayed.js +68 -0
- package/dist/IR/IRNodes/IRError.d.ts +32 -0
- package/dist/IR/IRNodes/IRError.js +44 -0
- package/dist/IR/IRNodes/IRForced.d.ts +31 -0
- package/dist/IR/IRNodes/IRForced.js +69 -0
- package/dist/IR/IRNodes/IRFunc.d.ts +33 -0
- package/dist/IR/IRNodes/IRFunc.js +91 -0
- package/dist/IR/IRNodes/IRHoisted.d.ts +55 -0
- package/dist/IR/IRNodes/IRHoisted.js +212 -0
- package/dist/IR/IRNodes/IRLetted.d.ts +108 -0
- package/dist/IR/IRNodes/IRLetted.js +444 -0
- package/dist/IR/IRNodes/IRNative/IRNativeTag.d.ts +138 -0
- package/dist/IR/IRNodes/IRNative/IRNativeTag.js +204 -0
- package/dist/IR/IRNodes/IRNative/index.d.ts +165 -0
- package/dist/IR/IRNodes/IRNative/index.js +240 -0
- package/dist/IR/IRNodes/IRNative/isForcedNative.d.ts +3 -0
- package/dist/IR/IRNodes/IRNative/isForcedNative.js +18 -0
- package/dist/IR/IRNodes/IRRecursive.d.ts +29 -0
- package/dist/IR/IRNodes/IRRecursive.js +90 -0
- package/dist/IR/IRNodes/IRSelfCall.d.ts +46 -0
- package/dist/IR/IRNodes/IRSelfCall.js +127 -0
- package/dist/IR/IRNodes/IRVar.d.ts +41 -0
- package/dist/IR/IRNodes/IRVar.js +93 -0
- package/dist/IR/IRNodes/index.d.ts +12 -0
- package/dist/IR/IRNodes/index.js +12 -0
- package/dist/IR/IRNodes/utils/dependsByDbns.d.ts +5 -0
- package/dist/IR/IRNodes/utils/dependsByDbns.js +29 -0
- package/dist/IR/IRNodes/utils/isClosedAtDbn.d.ts +2 -0
- package/dist/IR/IRNodes/utils/isClosedAtDbn.js +22 -0
- package/dist/IR/IRNodes/utils/makeArrayLikeProxy.d.ts +1 -0
- package/dist/IR/IRNodes/utils/makeArrayLikeProxy.js +34 -0
- package/dist/IR/IRNodes/utils/mapArrayLike.d.ts +1 -0
- package/dist/IR/IRNodes/utils/mapArrayLike.js +8 -0
- package/dist/IR/IRTerm.d.ts +15 -0
- package/dist/IR/IRTerm.js +1 -0
- package/dist/IR/index.d.ts +5 -0
- package/dist/IR/index.js +5 -0
- package/dist/IR/interfaces/IHash.d.ts +6 -0
- package/dist/IR/interfaces/IHash.js +1 -0
- package/dist/IR/interfaces/IIRParent.d.ts +4 -0
- package/dist/IR/interfaces/IIRParent.js +1 -0
- package/dist/IR/interfaces/IRMetadata.d.ts +3 -0
- package/dist/IR/interfaces/IRMetadata.js +2 -0
- package/dist/IR/interfaces/ToIR.d.ts +5 -0
- package/dist/IR/interfaces/ToIR.js +1 -0
- package/dist/IR/interfaces/index.d.ts +4 -0
- package/dist/IR/interfaces/index.js +4 -0
- package/dist/IR/toUPLC/CompilerOptions.d.ts +80 -0
- package/dist/IR/toUPLC/CompilerOptions.js +98 -0
- package/dist/IR/toUPLC/_internal/_addDepth.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/_addDepth.js +58 -0
- package/dist/IR/toUPLC/_internal/_irToUplc.d.ts +9 -0
- package/dist/IR/toUPLC/_internal/_irToUplc.js +156 -0
- package/dist/IR/toUPLC/_internal/_makeAllNegativeNativesHoisted.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/_makeAllNegativeNativesHoisted.js +12 -0
- package/dist/IR/toUPLC/_internal/_modifyChildFromTo.d.ts +10 -0
- package/dist/IR/toUPLC/_internal/_modifyChildFromTo.js +141 -0
- package/dist/IR/toUPLC/_internal/depth.d.ts +5 -0
- package/dist/IR/toUPLC/_internal/depth.js +8 -0
- package/dist/IR/toUPLC/_internal/findAll.d.ts +3 -0
- package/dist/IR/toUPLC/_internal/findAll.js +99 -0
- package/dist/IR/toUPLC/_internal/getDebruijnInTerm.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/getDebruijnInTerm.js +51 -0
- package/dist/IR/toUPLC/_internal/getDiffDbn.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/getDiffDbn.js +55 -0
- package/dist/IR/toUPLC/_internal/includesLettedTerms.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/includesLettedTerms.js +50 -0
- package/dist/IR/toUPLC/_internal/includesNode.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/includesNode.js +54 -0
- package/dist/IR/toUPLC/_internal/iterTree.d.ts +2 -0
- package/dist/IR/toUPLC/_internal/iterTree.js +93 -0
- package/dist/IR/toUPLC/_internal/lowestCommonAncestor.d.ts +3 -0
- package/dist/IR/toUPLC/_internal/lowestCommonAncestor.js +41 -0
- package/dist/IR/toUPLC/compileIRToUPLC.d.ts +4 -0
- package/dist/IR/toUPLC/compileIRToUPLC.js +118 -0
- package/dist/IR/toUPLC/index.d.ts +1 -0
- package/dist/IR/toUPLC/index.js +1 -0
- package/dist/IR/toUPLC/subRoutines/handleHoistedAndReturnRoot/index.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/handleHoistedAndReturnRoot/index.js +161 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/findHighestRecursiveParent.d.ts +5 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/findHighestRecursiveParent.js +14 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/groupByScope.d.ts +20 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/groupByScope.js +107 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/incrementUnboundDbns.d.ts +9 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/incrementUnboundDbns.js +73 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/index.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/handleLetted/index.js +304 -0
- package/dist/IR/toUPLC/subRoutines/handleRecursiveTerms.d.ts +3 -0
- package/dist/IR/toUPLC/subRoutines/handleRecursiveTerms.js +32 -0
- package/dist/IR/toUPLC/subRoutines/hoistForcedNatives.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/hoistForcedNatives.js +58 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseApplications.d.ts +1 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseApplications.js +12 -0
- package/dist/IR/toUPLC/subRoutines/markRecursiveHoistsAsForced.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/markRecursiveHoistsAsForced.js +82 -0
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/expandFuncsAndReturnRoot.d.ts +4 -0
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/expandFuncsAndReturnRoot.js +68 -0
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/index.d.ts +5 -0
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/index.js +227 -0
- package/dist/IR/toUPLC/subRoutines/replaceClosedLettedWithHoisted.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/replaceClosedLettedWithHoisted.js +13 -0
- package/dist/IR/toUPLC/subRoutines/replaceForcedNativesWithHoisted.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/replaceForcedNativesWithHoisted.js +11 -0
- package/dist/IR/toUPLC/subRoutines/replaceHoistedWithLetted.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/replaceHoistedWithLetted.js +16 -0
- package/dist/IR/toUPLC/subRoutines/replaceNatives/index.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/replaceNatives/index.js +16 -0
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.d.ts +3 -0
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.js +520 -0
- package/dist/IR/toUPLC/subRoutines/sanifyTree.d.ts +5 -0
- package/dist/IR/toUPLC/subRoutines/sanifyTree.js +84 -0
- package/dist/IR/tree_utils/_ir_apps.d.ts +3 -0
- package/dist/IR/tree_utils/_ir_apps.js +8 -0
- package/dist/IR/tree_utils/_ir_lazyChooseList.d.ts +3 -0
- package/dist/IR/tree_utils/_ir_lazyChooseList.js +5 -0
- package/dist/IR/tree_utils/_ir_lazyIfThenElse.d.ts +3 -0
- package/dist/IR/tree_utils/_ir_lazyIfThenElse.js +5 -0
- package/dist/IR/tree_utils/_ir_let.d.ts +3 -0
- package/dist/IR/tree_utils/_ir_let.js +4 -0
- package/dist/IR/tree_utils/getChildren.d.ts +2 -0
- package/dist/IR/tree_utils/getChildren.js +33 -0
- package/dist/IR/tree_utils/getRoot.d.ts +2 -0
- package/dist/IR/tree_utils/getRoot.js +6 -0
- package/dist/IR/utils/MutArrayLike.d.ts +5 -0
- package/dist/IR/utils/MutArrayLike.js +1 -0
- package/dist/IR/utils/concatUint8Arr.d.ts +1 -0
- package/dist/IR/utils/concatUint8Arr.js +11 -0
- package/dist/IR/utils/equalIRTerm.d.ts +12 -0
- package/dist/IR/utils/equalIRTerm.js +19 -0
- package/dist/IR/utils/index.d.ts +3 -0
- package/dist/IR/utils/index.js +3 -0
- package/dist/IR/utils/isClosedIRTerm.d.ts +2 -0
- package/dist/IR/utils/isClosedIRTerm.js +58 -0
- package/dist/IR/utils/isIRParentTerm.d.ts +12 -0
- package/dist/IR/utils/isIRParentTerm.js +26 -0
- package/dist/IR/utils/isIRTerm.d.ts +2 -0
- package/dist/IR/utils/isIRTerm.js +30 -0
- package/dist/IR/utils/positiveIntAsBytes.d.ts +5 -0
- package/dist/IR/utils/positiveIntAsBytes.js +27 -0
- package/dist/IR/utils/showIR.d.ts +43 -0
- package/dist/IR/utils/showIR.js +372 -0
- package/dist/ast/PebbleAst.d.ts +8 -0
- package/dist/ast/PebbleAst.js +15 -0
- package/dist/ast/Source/Source.d.ts +47 -0
- package/dist/ast/Source/Source.js +89 -0
- package/dist/ast/Source/SourceRange.d.ts +16 -0
- package/dist/ast/Source/SourceRange.js +49 -0
- package/dist/ast/nodes/HasSourceRange.d.ts +5 -0
- package/dist/ast/nodes/HasSourceRange.js +6 -0
- package/dist/ast/nodes/common/Identifier.d.ts +13 -0
- package/dist/ast/nodes/common/Identifier.js +20 -0
- package/dist/ast/nodes/expr/CaseExpr.d.ts +22 -0
- package/dist/ast/nodes/expr/CaseExpr.js +30 -0
- package/dist/ast/nodes/expr/ElemAccessExpr.d.ts +12 -0
- package/dist/ast/nodes/expr/ElemAccessExpr.js +13 -0
- package/dist/ast/nodes/expr/IsExpr.d.ts +1 -0
- package/dist/ast/nodes/expr/IsExpr.js +14 -0
- package/dist/ast/nodes/expr/ParentesizedExpr.d.ts +8 -0
- package/dist/ast/nodes/expr/ParentesizedExpr.js +8 -0
- package/dist/ast/nodes/expr/PebbleExpr.d.ts +18 -0
- package/dist/ast/nodes/expr/PebbleExpr.js +31 -0
- package/dist/ast/nodes/expr/PropAccessExpr.d.ts +28 -0
- package/dist/ast/nodes/expr/PropAccessExpr.js +46 -0
- package/dist/ast/nodes/expr/TernaryExpr.d.ts +10 -0
- package/dist/ast/nodes/expr/TernaryExpr.js +12 -0
- package/dist/ast/nodes/expr/TypeConversionExpr.d.ts +10 -0
- package/dist/ast/nodes/expr/TypeConversionExpr.js +11 -0
- package/dist/ast/nodes/expr/binary/BinaryExpr.d.ts +133 -0
- package/dist/ast/nodes/expr/binary/BinaryExpr.js +253 -0
- package/dist/ast/nodes/expr/functions/ArrowKind.d.ts +9 -0
- package/dist/ast/nodes/expr/functions/ArrowKind.js +11 -0
- package/dist/ast/nodes/expr/functions/CallExpr.d.ts +17 -0
- package/dist/ast/nodes/expr/functions/CallExpr.js +16 -0
- package/dist/ast/nodes/expr/functions/FuncExpr.d.ts +21 -0
- package/dist/ast/nodes/expr/functions/FuncExpr.js +21 -0
- package/dist/ast/nodes/expr/litteral/LitArrExpr.d.ts +8 -0
- package/dist/ast/nodes/expr/litteral/LitArrExpr.js +8 -0
- package/dist/ast/nodes/expr/litteral/LitFalseExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitFalseExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitHexBytesExpr.d.ts +7 -0
- package/dist/ast/nodes/expr/litteral/LitHexBytesExpr.js +8 -0
- package/dist/ast/nodes/expr/litteral/LitIntExpr.d.ts +7 -0
- package/dist/ast/nodes/expr/litteral/LitIntExpr.js +8 -0
- package/dist/ast/nodes/expr/litteral/LitNamedObjExpr.d.ts +12 -0
- package/dist/ast/nodes/expr/litteral/LitNamedObjExpr.js +12 -0
- package/dist/ast/nodes/expr/litteral/LitObjExpr.d.ts +14 -0
- package/dist/ast/nodes/expr/litteral/LitObjExpr.js +10 -0
- package/dist/ast/nodes/expr/litteral/LitStrExpr.d.ts +7 -0
- package/dist/ast/nodes/expr/litteral/LitStrExpr.js +8 -0
- package/dist/ast/nodes/expr/litteral/LitThisExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitThisExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitTrueExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitTrueExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitUndefExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitUndefExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitVoidExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitVoidExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitteralExpr.d.ts +13 -0
- package/dist/ast/nodes/expr/litteral/LitteralExpr.js +24 -0
- package/dist/ast/nodes/expr/unary/IUnaryExpression.d.ts +4 -0
- package/dist/ast/nodes/expr/unary/IUnaryExpression.js +1 -0
- package/dist/ast/nodes/expr/unary/NonNullExpr.d.ts +8 -0
- package/dist/ast/nodes/expr/unary/NonNullExpr.js +8 -0
- package/dist/ast/nodes/expr/unary/UnaryExclamation.d.ts +9 -0
- package/dist/ast/nodes/expr/unary/UnaryExclamation.js +8 -0
- package/dist/ast/nodes/expr/unary/UnaryMinus.d.ts +9 -0
- package/dist/ast/nodes/expr/unary/UnaryMinus.js +8 -0
- package/dist/ast/nodes/expr/unary/UnaryPlus.d.ts +9 -0
- package/dist/ast/nodes/expr/unary/UnaryPlus.js +8 -0
- package/dist/ast/nodes/expr/unary/UnaryPrefixExpr.d.ts +14 -0
- package/dist/ast/nodes/expr/unary/UnaryPrefixExpr.js +27 -0
- package/dist/ast/nodes/expr/unary/UnaryTilde.d.ts +9 -0
- package/dist/ast/nodes/expr/unary/UnaryTilde.js +8 -0
- package/dist/ast/nodes/statements/AssertStmt.d.ts +15 -0
- package/dist/ast/nodes/statements/AssertStmt.js +14 -0
- package/dist/ast/nodes/statements/AssignmentStmt.d.ts +105 -0
- package/dist/ast/nodes/statements/AssignmentStmt.js +211 -0
- package/dist/ast/nodes/statements/BlockStmt.d.ts +8 -0
- package/dist/ast/nodes/statements/BlockStmt.js +8 -0
- package/dist/ast/nodes/statements/BreakStmt.d.ts +6 -0
- package/dist/ast/nodes/statements/BreakStmt.js +6 -0
- package/dist/ast/nodes/statements/ContinueStmt.d.ts +6 -0
- package/dist/ast/nodes/statements/ContinueStmt.js +6 -0
- package/dist/ast/nodes/statements/DecrStmt.d.ts +11 -0
- package/dist/ast/nodes/statements/DecrStmt.js +11 -0
- package/dist/ast/nodes/statements/DoWhileStmt.d.ts +10 -0
- package/dist/ast/nodes/statements/DoWhileStmt.js +10 -0
- package/dist/ast/nodes/statements/EmptyStmt.d.ts +6 -0
- package/dist/ast/nodes/statements/EmptyStmt.js +6 -0
- package/dist/ast/nodes/statements/ExportImportStmt.d.ts +15 -0
- package/dist/ast/nodes/statements/ExportImportStmt.js +15 -0
- package/dist/ast/nodes/statements/ExportStarStmt.d.ts +8 -0
- package/dist/ast/nodes/statements/ExportStarStmt.js +8 -0
- package/dist/ast/nodes/statements/ExportStmt.d.ts +13 -0
- package/dist/ast/nodes/statements/ExportStmt.js +13 -0
- package/dist/ast/nodes/statements/ExprStmt.d.ts +8 -0
- package/dist/ast/nodes/statements/ExprStmt.js +18 -0
- package/dist/ast/nodes/statements/FailStmt.d.ts +11 -0
- package/dist/ast/nodes/statements/FailStmt.js +10 -0
- package/dist/ast/nodes/statements/ForOfStmt.d.ts +16 -0
- package/dist/ast/nodes/statements/ForOfStmt.js +15 -0
- package/dist/ast/nodes/statements/ForStmt.d.ts +19 -0
- package/dist/ast/nodes/statements/ForStmt.js +19 -0
- package/dist/ast/nodes/statements/IfStmt.d.ts +11 -0
- package/dist/ast/nodes/statements/IfStmt.js +12 -0
- package/dist/ast/nodes/statements/ImportStarStmt.d.ts +15 -0
- package/dist/ast/nodes/statements/ImportStarStmt.js +15 -0
- package/dist/ast/nodes/statements/ImportStmt.d.ts +21 -0
- package/dist/ast/nodes/statements/ImportStmt.js +25 -0
- package/dist/ast/nodes/statements/IncrStmt.d.ts +8 -0
- package/dist/ast/nodes/statements/IncrStmt.js +8 -0
- package/dist/ast/nodes/statements/MatchStmt.d.ts +17 -0
- package/dist/ast/nodes/statements/MatchStmt.js +20 -0
- package/dist/ast/nodes/statements/PebbleStmt.d.ts +29 -0
- package/dist/ast/nodes/statements/PebbleStmt.js +62 -0
- package/dist/ast/nodes/statements/ReturnStmt.d.ts +8 -0
- package/dist/ast/nodes/statements/ReturnStmt.js +8 -0
- package/dist/ast/nodes/statements/TestStmt.d.ts +10 -0
- package/dist/ast/nodes/statements/TestStmt.js +10 -0
- package/dist/ast/nodes/statements/TypeImplementsStmt.d.ts +21 -0
- package/dist/ast/nodes/statements/TypeImplementsStmt.js +26 -0
- package/dist/ast/nodes/statements/UsingStmt.d.ts +16 -0
- package/dist/ast/nodes/statements/UsingStmt.js +20 -0
- package/dist/ast/nodes/statements/VarStmt.d.ts +10 -0
- package/dist/ast/nodes/statements/VarStmt.js +11 -0
- package/dist/ast/nodes/statements/WhileStmt.d.ts +10 -0
- package/dist/ast/nodes/statements/WhileStmt.js +10 -0
- package/dist/ast/nodes/statements/declarations/EnumDecl.d.ts +18 -0
- package/dist/ast/nodes/statements/declarations/EnumDecl.js +22 -0
- package/dist/ast/nodes/statements/declarations/FuncDecl.d.ts +8 -0
- package/dist/ast/nodes/statements/declarations/FuncDecl.js +9 -0
- package/dist/ast/nodes/statements/declarations/InterfaceDecl.d.ts +19 -0
- package/dist/ast/nodes/statements/declarations/InterfaceDecl.js +26 -0
- package/dist/ast/nodes/statements/declarations/PebbleTypeDecl.d.ts +5 -0
- package/dist/ast/nodes/statements/declarations/PebbleTypeDecl.js +8 -0
- package/dist/ast/nodes/statements/declarations/StructDecl.d.ts +25 -0
- package/dist/ast/nodes/statements/declarations/StructDecl.js +36 -0
- package/dist/ast/nodes/statements/declarations/TypeAliasDecl.d.ts +11 -0
- package/dist/ast/nodes/statements/declarations/TypeAliasDecl.js +12 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/ArrayLikeDeconstr.d.ts +19 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/ArrayLikeDeconstr.js +19 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/HasInit.d.ts +5 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/HasInit.js +7 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/NamedDeconstructVarDecl.d.ts +24 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/NamedDeconstructVarDecl.js +30 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/SimpleVarDecl.d.ts +17 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/SimpleVarDecl.js +21 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/SingleDeconstructVarDecl.d.ts +24 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/SingleDeconstructVarDecl.js +20 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/VarDecl.d.ts +8 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/VarDecl.js +13 -0
- package/dist/ast/nodes/types/AstNamedTypeExpr.d.ts +14 -0
- package/dist/ast/nodes/types/AstNamedTypeExpr.js +14 -0
- package/dist/ast/nodes/types/AstNativeTypeExpr.d.ts +52 -0
- package/dist/ast/nodes/types/AstNativeTypeExpr.js +82 -0
- package/dist/ast/nodes/types/AstTypeExpr.d.ts +4 -0
- package/dist/ast/nodes/types/AstTypeExpr.js +7 -0
- package/dist/common.d.ts +194 -0
- package/dist/common.js +224 -0
- package/dist/compiler/AstCompiler/AstCompilationCtx.d.ts +35 -0
- package/dist/compiler/AstCompiler/AstCompilationCtx.js +43 -0
- package/dist/compiler/AstCompiler/AstCompiler.d.ts +73 -0
- package/dist/compiler/AstCompiler/AstCompiler.js +532 -0
- package/dist/compiler/AstCompiler/compileAst.d.ts +0 -0
- package/dist/compiler/AstCompiler/compileAst.js +0 -0
- package/dist/compiler/AstCompiler/index.d.ts +1 -0
- package/dist/compiler/AstCompiler/index.js +1 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileBinaryExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileBinaryExpr.js +66 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileCallExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileCallExpr.js +36 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileCaseExpr.d.ts +6 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileCaseExpr.js +47 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileElemAccessExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileElemAccessExpr.js +23 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileExpr.d.ts +22 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileExpr.js +77 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileFuncExpr.d.ts +26 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileFuncExpr.js +163 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileIsExpr.d.ts +1 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileIsExpr.js +43 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileLitteralExpr.d.ts +19 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileLitteralExpr.js +202 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileNonNullExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileNonNullExpr.js +43 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compilePropAccessExpr.d.ts +9 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compilePropAccessExpr.js +102 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileTernaryExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileTernaryExpr.js +22 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileTypeConversionExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileTypeConversionExpr.js +25 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileUnaryPrefixExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileUnaryPrefixExpr.js +54 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileVarAccessExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileVarAccessExpr.js +9 -0
- package/dist/compiler/AstCompiler/internal/exprs/_hasDuplicateTypeParams.d.ts +3 -0
- package/dist/compiler/AstCompiler/internal/exprs/_hasDuplicateTypeParams.js +13 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileAddExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileAddExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseAndExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseAndExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseOrExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseOrExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseXorExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileBitwiseXorExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileDivExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileDivExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileEqualExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileEqualExpr.js +18 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileExponentiationExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileExponentiationExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanEqualExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanEqualExpr.js +27 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileGreaterThanExpr.js +26 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanEqualExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanEqualExpr.js +25 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLessThanExpr.js +26 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLogicalAndExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLogicalAndExpr.js +22 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLogicalOrExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileLogicalOrExpr.js +22 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileModuloExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileModuloExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileMultExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileMultExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileNotEqualExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileNotEqualExpr.js +18 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileOptionalDefaultExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileOptionalDefaultExpr.js +60 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileShiftLeftExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileShiftLeftExpr.js +21 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileShiftRightExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileShiftRightExpr.js +21 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileSubExpr.d.ts +5 -0
- package/dist/compiler/AstCompiler/internal/exprs/binary/_compileSubExpr.js +20 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileAssertStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileAssertStmt.js +30 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileAssignmentStmt.d.ts +8 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileAssignmentStmt.js +154 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileBlockStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileBlockStmt.js +14 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileBreakStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileBreakStmt.js +7 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileContinueStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileContinueStmt.js +7 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileExprStmt.d.ts +1 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileExprStmt.js +12 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileFailStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileFailStmt.js +18 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileForOfStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileForOfStmt.js +30 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileForStmt.d.ts +7 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileForStmt.js +46 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileIfStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileIfStmt.js +27 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileMatchStmt.d.ts +6 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileMatchStmt.js +182 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileReturnStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileReturnStmt.js +17 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileStatement.d.ts +11 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileStatement.js +73 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileTestStmt.d.ts +1 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileTestStmt.js +32 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileUsingStmt.d.ts +11 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileUsingStmt.js +41 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileVarStmt.d.ts +34 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileVarStmt.js +207 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileWhileStmt.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/statements/_compileWhileStmt.js +19 -0
- package/dist/compiler/AstCompiler/internal/types/_compileDataEncodedConcreteType.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/types/_compileDataEncodedConcreteType.js +61 -0
- package/dist/compiler/AstCompiler/internal/types/_compileSopEncodedConcreteType.d.ts +4 -0
- package/dist/compiler/AstCompiler/internal/types/_compileSopEncodedConcreteType.js +59 -0
- package/dist/compiler/AstCompiler/scope/AstScope.d.ts +102 -0
- package/dist/compiler/AstCompiler/scope/AstScope.js +195 -0
- package/dist/compiler/AstCompiler/utils/deps/ResolveStackNode.d.ts +14 -0
- package/dist/compiler/AstCompiler/utils/deps/ResolveStackNode.js +36 -0
- package/dist/compiler/AstCompiler/utils/getPropAccessReturnType.d.ts +4 -0
- package/dist/compiler/AstCompiler/utils/getPropAccessReturnType.js +121 -0
- package/dist/compiler/AstCompiler/utils/getTirFuncSigTree/TirFuncSigTree.d.ts +39 -0
- package/dist/compiler/AstCompiler/utils/getTirFuncSigTree/TirFuncSigTree.js +129 -0
- package/dist/compiler/AstCompiler/utils/getTirFuncSigTree/getTirFuncSigTree.d.ts +4 -0
- package/dist/compiler/AstCompiler/utils/getTirFuncSigTree/getTirFuncSigTree.js +49 -0
- package/dist/compiler/AstCompiler/utils/wrapManyStatementsOrReturnSame.d.ts +3 -0
- package/dist/compiler/AstCompiler/utils/wrapManyStatementsOrReturnSame.js +12 -0
- package/dist/compiler/Compiler.d.ts +10 -0
- package/dist/compiler/Compiler.js +39 -0
- package/dist/compiler/TirCompiler/TirCompilerCtx.d.ts +7 -0
- package/dist/compiler/TirCompiler/TirCompilerCtx.js +8 -0
- package/dist/compiler/TirCompiler/compileTirProgram.d.ts +9 -0
- package/dist/compiler/TirCompiler/compileTirProgram.js +18 -0
- package/dist/compiler/TirCompiler/expressify/ExpressifyCtx.d.ts +72 -0
- package/dist/compiler/TirCompiler/expressify/ExpressifyCtx.js +282 -0
- package/dist/compiler/TirCompiler/expressify/determineReassignedVariablesAndReturn.d.ts +27 -0
- package/dist/compiler/TirCompiler/expressify/determineReassignedVariablesAndReturn.js +248 -0
- package/dist/compiler/TirCompiler/expressify/expressify.d.ts +15 -0
- package/dist/compiler/TirCompiler/expressify/expressify.js +403 -0
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.d.ts +8 -0
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.js +115 -0
- package/dist/compiler/TirCompiler/expressify/expressifyIfBranch.d.ts +6 -0
- package/dist/compiler/TirCompiler/expressify/expressifyIfBranch.js +105 -0
- package/dist/compiler/TirCompiler/expressify/expressifyTerminatingIfStmt.d.ts +5 -0
- package/dist/compiler/TirCompiler/expressify/expressifyTerminatingIfStmt.js +15 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVarAssignmentStmt.d.ts +4 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVarAssignmentStmt.js +20 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVarDecl.d.ts +3 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVarDecl.js +34 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVars.d.ts +10 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVars.js +320 -0
- package/dist/compiler/TirCompiler/expressify/flattenSopNamedDeconstructInplace_addTopDestructToCtx_getNestedDeconstruct.d.ts +9 -0
- package/dist/compiler/TirCompiler/expressify/flattenSopNamedDeconstructInplace_addTopDestructToCtx_getNestedDeconstruct.js +59 -0
- package/dist/compiler/TirCompiler/expressify/isSingleConstrStruct.d.ts +3 -0
- package/dist/compiler/TirCompiler/expressify/isSingleConstrStruct.js +9 -0
- package/dist/compiler/TirCompiler/expressify/toNamedDeconstructVarDecl.d.ts +3 -0
- package/dist/compiler/TirCompiler/expressify/toNamedDeconstructVarDecl.js +15 -0
- package/dist/compiler/TirCompiler/index.d.ts +2 -0
- package/dist/compiler/TirCompiler/index.js +2 -0
- package/dist/compiler/TirCompiler/internal/_compileHoistedDeps.d.ts +5 -0
- package/dist/compiler/TirCompiler/internal/_compileHoistedDeps.js +37 -0
- package/dist/compiler/TirCompiler/internal/deps/DepsNode.d.ts +13 -0
- package/dist/compiler/TirCompiler/internal/deps/DepsNode.js +36 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/internalVar.d.ts +19 -0
- package/dist/compiler/internalVar.js +56 -0
- package/dist/compiler/io/CompilerIoApi.d.ts +36 -0
- package/dist/compiler/io/CompilerIoApi.js +62 -0
- package/dist/compiler/io/IOutputStream.d.ts +28 -0
- package/dist/compiler/io/IOutputStream.js +45 -0
- package/dist/compiler/io/index.d.ts +2 -0
- package/dist/compiler/io/index.js +2 -0
- package/dist/compiler/path/getAbsolutePath.d.ts +12 -0
- package/dist/compiler/path/getAbsolutePath.js +114 -0
- package/dist/compiler/path/path.d.ts +5 -0
- package/dist/compiler/path/path.js +160 -0
- package/dist/compiler/tir/expressions/ITirExpr.d.ts +11 -0
- package/dist/compiler/tir/expressions/ITirExpr.js +1 -0
- package/dist/compiler/tir/expressions/TirAssertAndContinueExpr.d.ts +19 -0
- package/dist/compiler/tir/expressions/TirAssertAndContinueExpr.js +41 -0
- package/dist/compiler/tir/expressions/TirCallExpr.d.ts +17 -0
- package/dist/compiler/tir/expressions/TirCallExpr.js +28 -0
- package/dist/compiler/tir/expressions/TirCaseExpr.d.ts +36 -0
- package/dist/compiler/tir/expressions/TirCaseExpr.js +257 -0
- package/dist/compiler/tir/expressions/TirElemAccessExpr.d.ts +20 -0
- package/dist/compiler/tir/expressions/TirElemAccessExpr.js +43 -0
- package/dist/compiler/tir/expressions/TirExpr.d.ts +23 -0
- package/dist/compiler/tir/expressions/TirExpr.js +46 -0
- package/dist/compiler/tir/expressions/TirFailExpr.d.ts +19 -0
- package/dist/compiler/tir/expressions/TirFailExpr.js +28 -0
- package/dist/compiler/tir/expressions/TirFromDataExpr.d.ts +22 -0
- package/dist/compiler/tir/expressions/TirFromDataExpr.js +196 -0
- package/dist/compiler/tir/expressions/TirFuncExpr.d.ts +37 -0
- package/dist/compiler/tir/expressions/TirFuncExpr.js +92 -0
- package/dist/compiler/tir/expressions/TirHoistedExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/TirHoistedExpr.js +28 -0
- package/dist/compiler/tir/expressions/TirInlineClosedIR.d.ts +16 -0
- package/dist/compiler/tir/expressions/TirInlineClosedIR.js +25 -0
- package/dist/compiler/tir/expressions/TirLettedExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/TirLettedExpr.js +28 -0
- package/dist/compiler/tir/expressions/TirNativeFunc.d.ts +104 -0
- package/dist/compiler/tir/expressions/TirNativeFunc.js +805 -0
- package/dist/compiler/tir/expressions/TirParentesizedExpr.d.ts +17 -0
- package/dist/compiler/tir/expressions/TirParentesizedExpr.js +20 -0
- package/dist/compiler/tir/expressions/TirPropAccessExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/TirPropAccessExpr.js +29 -0
- package/dist/compiler/tir/expressions/TirTernaryExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/TirTernaryExpr.js +36 -0
- package/dist/compiler/tir/expressions/TirToDataExpr.d.ts +28 -0
- package/dist/compiler/tir/expressions/TirToDataExpr.js +172 -0
- package/dist/compiler/tir/expressions/TirTraceIfFalseExpr.d.ts +23 -0
- package/dist/compiler/tir/expressions/TirTraceIfFalseExpr.js +32 -0
- package/dist/compiler/tir/expressions/TirTypeConversionExpr.d.ts +16 -0
- package/dist/compiler/tir/expressions/TirTypeConversionExpr.js +66 -0
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.js +30 -0
- package/dist/compiler/tir/expressions/ToIRTermCtx.d.ts +29 -0
- package/dist/compiler/tir/expressions/ToIRTermCtx.js +77 -0
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.d.ts +221 -0
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.js +532 -0
- package/dist/compiler/tir/expressions/litteral/TirLitArrExpr.d.ts +16 -0
- package/dist/compiler/tir/expressions/litteral/TirLitArrExpr.js +60 -0
- package/dist/compiler/tir/expressions/litteral/TirLitFalseExpr.d.ts +14 -0
- package/dist/compiler/tir/expressions/litteral/TirLitFalseExpr.js +17 -0
- package/dist/compiler/tir/expressions/litteral/TirLitHexBytesExpr.d.ts +15 -0
- package/dist/compiler/tir/expressions/litteral/TirLitHexBytesExpr.js +19 -0
- package/dist/compiler/tir/expressions/litteral/TirLitIntExpr.d.ts +15 -0
- package/dist/compiler/tir/expressions/litteral/TirLitIntExpr.js +19 -0
- package/dist/compiler/tir/expressions/litteral/TirLitNamedObjExpr.d.ts +22 -0
- package/dist/compiler/tir/expressions/litteral/TirLitNamedObjExpr.js +105 -0
- package/dist/compiler/tir/expressions/litteral/TirLitObjExpr.d.ts +22 -0
- package/dist/compiler/tir/expressions/litteral/TirLitObjExpr.js +102 -0
- package/dist/compiler/tir/expressions/litteral/TirLitStrExpr.d.ts +15 -0
- package/dist/compiler/tir/expressions/litteral/TirLitStrExpr.js +20 -0
- package/dist/compiler/tir/expressions/litteral/TirLitThisExpr.d.ts +14 -0
- package/dist/compiler/tir/expressions/litteral/TirLitThisExpr.js +20 -0
- package/dist/compiler/tir/expressions/litteral/TirLitTrueExpr.d.ts +14 -0
- package/dist/compiler/tir/expressions/litteral/TirLitTrueExpr.js +17 -0
- package/dist/compiler/tir/expressions/litteral/TirLitUndefExpr.d.ts +18 -0
- package/dist/compiler/tir/expressions/litteral/TirLitUndefExpr.js +23 -0
- package/dist/compiler/tir/expressions/litteral/TirLitVoidExpr.d.ts +14 -0
- package/dist/compiler/tir/expressions/litteral/TirLitVoidExpr.js +17 -0
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.d.ts +13 -0
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.js +24 -0
- package/dist/compiler/tir/expressions/unary/ITirUnaryExpression.d.ts +4 -0
- package/dist/compiler/tir/expressions/unary/ITirUnaryExpression.js +1 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryExclamation.d.ts +17 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryExclamation.js +23 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryMinus.d.ts +17 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryMinus.js +22 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryPlus.d.ts +15 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryPlus.js +20 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryPrefixExpr.d.ts +6 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryPrefixExpr.js +10 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryTilde.d.ts +17 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryTilde.js +22 -0
- package/dist/compiler/tir/expressions/utils/NamedExpr.d.ts +5 -0
- package/dist/compiler/tir/expressions/utils/NamedExpr.js +1 -0
- package/dist/compiler/tir/program/TypedProgram.d.ts +44 -0
- package/dist/compiler/tir/program/TypedProgram.js +126 -0
- package/dist/compiler/tir/program/stdScope/StdTypes.d.ts +34 -0
- package/dist/compiler/tir/program/stdScope/StdTypes.js +40 -0
- package/dist/compiler/tir/program/stdScope/prelude/preludeTypesSrc.d.ts +0 -0
- package/dist/compiler/tir/program/stdScope/prelude/preludeTypesSrc.js +288 -0
- package/dist/compiler/tir/program/stdScope/stdScope.d.ts +15 -0
- package/dist/compiler/tir/program/stdScope/stdScope.js +730 -0
- package/dist/compiler/tir/statements/TirAssertStmt.d.ts +18 -0
- package/dist/compiler/tir/statements/TirAssertStmt.js +29 -0
- package/dist/compiler/tir/statements/TirAssignmentStmt.d.ts +12 -0
- package/dist/compiler/tir/statements/TirAssignmentStmt.js +14 -0
- package/dist/compiler/tir/statements/TirBlockStmt.d.ts +9 -0
- package/dist/compiler/tir/statements/TirBlockStmt.js +25 -0
- package/dist/compiler/tir/statements/TirBreakStmt.d.ts +8 -0
- package/dist/compiler/tir/statements/TirBreakStmt.js +11 -0
- package/dist/compiler/tir/statements/TirContinueStmt.d.ts +8 -0
- package/dist/compiler/tir/statements/TirContinueStmt.js +13 -0
- package/dist/compiler/tir/statements/TirFailStmt.d.ts +13 -0
- package/dist/compiler/tir/statements/TirFailStmt.js +14 -0
- package/dist/compiler/tir/statements/TirForOfStmt.d.ts +16 -0
- package/dist/compiler/tir/statements/TirForOfStmt.js +25 -0
- package/dist/compiler/tir/statements/TirForStmt.d.ts +19 -0
- package/dist/compiler/tir/statements/TirForStmt.js +39 -0
- package/dist/compiler/tir/statements/TirIfStmt.d.ts +12 -0
- package/dist/compiler/tir/statements/TirIfStmt.js +23 -0
- package/dist/compiler/tir/statements/TirMatchStmt.d.ts +27 -0
- package/dist/compiler/tir/statements/TirMatchStmt.js +51 -0
- package/dist/compiler/tir/statements/TirReturnStmt.d.ts +10 -0
- package/dist/compiler/tir/statements/TirReturnStmt.js +12 -0
- package/dist/compiler/tir/statements/TirStmt.d.ts +32 -0
- package/dist/compiler/tir/statements/TirStmt.js +40 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirArrayLikeDeconstr.d.ts +17 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirArrayLikeDeconstr.js +30 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirNamedDeconstructVarDecl.d.ts +21 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirNamedDeconstructVarDecl.js +34 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSimpleVarDecl.d.ts +17 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSimpleVarDecl.js +22 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSingleDeconstructVarDecl.d.ts +17 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSingleDeconstructVarDecl.js +30 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirVarDecl.d.ts +10 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirVarDecl.js +11 -0
- package/dist/compiler/tir/statements/TirWhileStmt.d.ts +11 -0
- package/dist/compiler/tir/statements/TirWhileStmt.js +19 -0
- package/dist/compiler/tir/statements/utils/definitelyFails.d.ts +3 -0
- package/dist/compiler/tir/statements/utils/definitelyFails.js +52 -0
- package/dist/compiler/tir/types/TirAliasType.d.ts +32 -0
- package/dist/compiler/tir/types/TirAliasType.js +49 -0
- package/dist/compiler/tir/types/TirInterfaceImpl.d.ts +44 -0
- package/dist/compiler/tir/types/TirInterfaceImpl.js +32 -0
- package/dist/compiler/tir/types/TirInterfaceType.d.ts +28 -0
- package/dist/compiler/tir/types/TirInterfaceType.js +36 -0
- package/dist/compiler/tir/types/TirNativeType/TirNativeType.d.ts +41 -0
- package/dist/compiler/tir/types/TirNativeType/TirNativeType.js +86 -0
- package/dist/compiler/tir/types/TirNativeType/index.d.ts +2 -0
- package/dist/compiler/tir/types/TirNativeType/index.js +2 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/data.d.ts +17 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/data.js +47 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/index.d.ts +3 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/index.js +3 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/isTirOptType.d.ts +4 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/isTirOptType.js +6 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/sop.d.ts +17 -0
- package/dist/compiler/tir/types/TirNativeType/native/Optional/sop.js +48 -0
- package/dist/compiler/tir/types/TirNativeType/native/bool.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/bool.js +12 -0
- package/dist/compiler/tir/types/TirNativeType/native/bytes.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/bytes.js +12 -0
- package/dist/compiler/tir/types/TirNativeType/native/data.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/data.js +12 -0
- package/dist/compiler/tir/types/TirNativeType/native/function.d.ts +16 -0
- package/dist/compiler/tir/types/TirNativeType/native/function.js +38 -0
- package/dist/compiler/tir/types/TirNativeType/native/index.d.ts +10 -0
- package/dist/compiler/tir/types/TirNativeType/native/index.js +10 -0
- package/dist/compiler/tir/types/TirNativeType/native/int.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/int.js +12 -0
- package/dist/compiler/tir/types/TirNativeType/native/linearMap.d.ts +17 -0
- package/dist/compiler/tir/types/TirNativeType/native/linearMap.js +44 -0
- package/dist/compiler/tir/types/TirNativeType/native/list.d.ts +16 -0
- package/dist/compiler/tir/types/TirNativeType/native/list.js +38 -0
- package/dist/compiler/tir/types/TirNativeType/native/string.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/string.js +12 -0
- package/dist/compiler/tir/types/TirNativeType/native/void.d.ts +13 -0
- package/dist/compiler/tir/types/TirNativeType/native/void.js +12 -0
- package/dist/compiler/tir/types/TirStructType.d.ts +68 -0
- package/dist/compiler/tir/types/TirStructType.js +128 -0
- package/dist/compiler/tir/types/TirType.d.ts +34 -0
- package/dist/compiler/tir/types/TirType.js +16 -0
- package/dist/compiler/tir/types/TirTypeParam.d.ts +18 -0
- package/dist/compiler/tir/types/TirTypeParam.js +39 -0
- package/dist/compiler/tir/types/utils/canAssignTo.d.ts +24 -0
- package/dist/compiler/tir/types/utils/canAssignTo.js +337 -0
- package/dist/compiler/tir/types/utils/canCastTo.d.ts +9 -0
- package/dist/compiler/tir/types/utils/canCastTo.js +155 -0
- package/dist/compiler/tir/types/utils/getDeconstructableType.d.ts +9 -0
- package/dist/compiler/tir/types/utils/getDeconstructableType.js +20 -0
- package/dist/compiler/tir/types/utils/getListTypeArg.d.ts +2 -0
- package/dist/compiler/tir/types/utils/getListTypeArg.js +9 -0
- package/dist/compiler/tir/types/utils/getOptTypeArg.d.ts +2 -0
- package/dist/compiler/tir/types/utils/getOptTypeArg.js +14 -0
- package/dist/compiler/tir/types/utils/getUnaliased.d.ts +3 -0
- package/dist/compiler/tir/types/utils/getUnaliased.js +9 -0
- package/dist/diagnostics/DiagnosticCategory.d.ts +16 -0
- package/dist/diagnostics/DiagnosticCategory.js +39 -0
- package/dist/diagnostics/DiagnosticEmitter.d.ts +32 -0
- package/dist/diagnostics/DiagnosticEmitter.js +95 -0
- package/dist/diagnostics/DiagnosticMessage.d.ts +37 -0
- package/dist/diagnostics/DiagnosticMessage.js +229 -0
- package/dist/diagnostics/diagnosticMessages.generated.d.ts +275 -0
- package/dist/diagnostics/diagnosticMessages.generated.js +551 -0
- package/dist/diagnostics/utils/types.d.ts +5 -0
- package/dist/diagnostics/utils/types.js +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13 -0
- package/dist/parser/Parser.d.ts +150 -0
- package/dist/parser/Parser.js +2416 -0
- package/dist/parser/Precedence.d.ts +38 -0
- package/dist/parser/Precedence.js +98 -0
- package/dist/parser/hoistStatementsInplace.d.ts +14 -0
- package/dist/parser/hoistStatementsInplace.js +94 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/index.js +1 -0
- package/dist/parser/parseFile.d.ts +3 -0
- package/dist/parser/parseFile.js +8 -0
- package/dist/tokenizer/IdentifierHandling.d.ts +5 -0
- package/dist/tokenizer/IdentifierHandling.js +6 -0
- package/dist/tokenizer/OnNewLine.d.ts +6 -0
- package/dist/tokenizer/OnNewLine.js +8 -0
- package/dist/tokenizer/Token.d.ts +160 -0
- package/dist/tokenizer/Token.js +213 -0
- package/dist/tokenizer/Tokenizer.d.ts +129 -0
- package/dist/tokenizer/Tokenizer.js +1323 -0
- package/dist/tokenizer/TokenizerState.d.ts +17 -0
- package/dist/tokenizer/TokenizerState.js +17 -0
- package/dist/tokenizer/index.d.ts +2 -0
- package/dist/tokenizer/index.js +2 -0
- package/dist/tokenizer/utils/isIllegalVariableIdentifier.d.ts +1 -0
- package/dist/tokenizer/utils/isIllegalVariableIdentifier.js +12 -0
- package/dist/tokenizer/utils/operatorTokenToString.d.ts +2 -0
- package/dist/tokenizer/utils/operatorTokenToString.js +57 -0
- package/dist/tokenizer/utils/tokenFromKeyword.d.ts +2 -0
- package/dist/tokenizer/utils/tokenFromKeyword.js +222 -0
- package/dist/tokenizer/utils/tokenIsAlsoIdentifier.d.ts +2 -0
- package/dist/tokenizer/utils/tokenIsAlsoIdentifier.js +24 -0
- package/dist/utils/BasePlutsError.d.ts +2 -0
- package/dist/utils/BasePlutsError.js +2 -0
- package/dist/utils/BitUtils/index.d.ts +30 -0
- package/dist/utils/BitUtils/index.js +60 -0
- package/dist/utils/CharCode.d.ts +125 -0
- package/dist/utils/CharCode.js +1 -0
- package/dist/utils/Cloneable.d.ts +6 -0
- package/dist/utils/Cloneable.js +4 -0
- package/dist/utils/InvalidCborFormatError.d.ts +3 -0
- package/dist/utils/InvalidCborFormatError.js +5 -0
- package/dist/utils/IsSingleKey.d.ts +7 -0
- package/dist/utils/IsSingleKey.js +1 -0
- package/dist/utils/MaybePromise.d.ts +2 -0
- package/dist/utils/MaybePromise.js +4 -0
- package/dist/utils/PlutusScriptType.d.ts +12 -0
- package/dist/utils/PlutusScriptType.js +1 -0
- package/dist/utils/ToJson.d.ts +4 -0
- package/dist/utils/ToJson.js +5 -0
- package/dist/utils/UPLCFlatUtils/index.d.ts +46 -0
- package/dist/utils/UPLCFlatUtils/index.js +124 -0
- package/dist/utils/array/filterSortedStrArrInplace.d.ts +7 -0
- package/dist/utils/array/filterSortedStrArrInplace.js +46 -0
- package/dist/utils/array/keepSortedArrInplace.d.ts +7 -0
- package/dist/utils/array/keepSortedArrInplace.js +49 -0
- package/dist/utils/array/mergeSortedStrArrInplace.d.ts +6 -0
- package/dist/utils/array/mergeSortedStrArrInplace.js +52 -0
- package/dist/utils/assert.d.ts +1 -0
- package/dist/utils/assert.js +5 -0
- package/dist/utils/capitalize.d.ts +1 -0
- package/dist/utils/capitalize.js +5 -0
- package/dist/utils/combinators.d.ts +37 -0
- package/dist/utils/combinators.js +76 -0
- package/dist/utils/getCallStackAt/index.d.ts +43 -0
- package/dist/utils/getCallStackAt/index.js +295 -0
- package/dist/utils/hex.d.ts +1 -0
- package/dist/utils/hex.js +6 -0
- package/dist/utils/ints.d.ts +4 -0
- package/dist/utils/ints.js +19 -0
- package/dist/utils/isNonEmpty.d.ts +1 -0
- package/dist/utils/isNonEmpty.js +3 -0
- package/dist/utils/maybeData.d.ts +4 -0
- package/dist/utils/maybeData.js +10 -0
- package/dist/utils/stringify.d.ts +2 -0
- package/dist/utils/stringify.js +31 -0
- package/dist/utils/terminal.d.ts +28 -0
- package/dist/utils/terminal.js +38 -0
- package/dist/utils/text.d.ts +172 -0
- package/dist/utils/text.js +672 -0
- package/dist/utils/types.d.ts +12 -0
- package/dist/utils/types.js +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { iterTree } from "../toUPLC/_internal/iterTree.js";
|
|
2
|
+
import { IRVar } from "./IRVar.js";
|
|
3
|
+
import { positiveIntAsBytes } from "../utils/positiveIntAsBytes.js";
|
|
4
|
+
import { freezeAll } from "@harmoniclabs/obj-utils";
|
|
5
|
+
import { BasePlutsError } from "../../utils/BasePlutsError.js";
|
|
6
|
+
import { concatUint8Arr } from "../utils/concatUint8Arr.js";
|
|
7
|
+
import { isIRTerm } from "../utils/isIRTerm.js";
|
|
8
|
+
import { IRApp } from "./IRApp.js";
|
|
9
|
+
import { IRDelayed } from "./IRDelayed.js";
|
|
10
|
+
import { IRForced } from "./IRForced.js";
|
|
11
|
+
import { IRFunc } from "./IRFunc.js";
|
|
12
|
+
import { IRHoisted } from "./IRHoisted.js";
|
|
13
|
+
import { isIRParentTerm } from "../utils/isIRParentTerm.js";
|
|
14
|
+
import { _modifyChildFromTo } from "../toUPLC/_internal/_modifyChildFromTo.js";
|
|
15
|
+
import { _getMinUnboundDbn } from "../toUPLC/subRoutines/handleLetted/groupByScope.js";
|
|
16
|
+
import { IRConstr } from "./IRConstr.js";
|
|
17
|
+
import { IRCase } from "./IRCase.js";
|
|
18
|
+
import { equalIrHash, hashIrData, irHashToHex, isIRHash } from "../IRHash.js";
|
|
19
|
+
import { shallowEqualIRTermHash } from "../utils/equalIRTerm.js";
|
|
20
|
+
import { IRNodeKind } from "../IRNodeKind.js";
|
|
21
|
+
import { IRRecursive } from "./IRRecursive.js";
|
|
22
|
+
import { IRSelfCall } from "./IRSelfCall.js";
|
|
23
|
+
export function jsonLettedSetEntry(entry) {
|
|
24
|
+
return {
|
|
25
|
+
letted: irHashToHex(entry.letted.hash),
|
|
26
|
+
nReferences: entry.nReferences
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function expandedJsonLettedSetEntry(entry) {
|
|
30
|
+
return {
|
|
31
|
+
letted: irHashToHex(entry.letted.hash),
|
|
32
|
+
// letted_value: prettyIR( entry.letted.value ).text.split("\n"),
|
|
33
|
+
nReferences: entry.nReferences
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const defaultLettedMeta = freezeAll({
|
|
37
|
+
forceHoist: false,
|
|
38
|
+
__src__: undefined,
|
|
39
|
+
isClosed: false
|
|
40
|
+
});
|
|
41
|
+
let n_hash_access = 0;
|
|
42
|
+
export class IRLetted {
|
|
43
|
+
_hash;
|
|
44
|
+
get hash() {
|
|
45
|
+
if (!isIRHash(this._hash)) {
|
|
46
|
+
/*
|
|
47
|
+
NOTE TO SELF:
|
|
48
|
+
|
|
49
|
+
NEVER
|
|
50
|
+
NEVER
|
|
51
|
+
NEVER
|
|
52
|
+
|
|
53
|
+
NEVER GET THE HASH BASED ON THE METADATA
|
|
54
|
+
|
|
55
|
+
NEVER
|
|
56
|
+
*/
|
|
57
|
+
const normalized = getNormalizedLettedArgs(this.dbn, this._value);
|
|
58
|
+
if (normalized === undefined) {
|
|
59
|
+
// `_value` doesn't includes any `IRVar`
|
|
60
|
+
// aka. there is nothing to normalize
|
|
61
|
+
// just use the value regardless of the
|
|
62
|
+
// `IRLetted` dbn instantiation
|
|
63
|
+
this._hash = hashIrData(concatUint8Arr(IRLetted.tag, this._value.hash));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this._hash = hashIrData(concatUint8Arr(IRLetted.tag, positiveIntAsBytes(normalized[0]), normalized[1].hash));
|
|
67
|
+
/*
|
|
68
|
+
const [ normalized_dbn, normalized_value] = normalized;
|
|
69
|
+
if( toHex( hash ) === "ee84fb036ed2726e01b0415109246927" )
|
|
70
|
+
{
|
|
71
|
+
const original_value = _value.clone();
|
|
72
|
+
const minDbn = getMinVarDbn( original_value );
|
|
73
|
+
const minUnb = _getMinUnboundDbn( original_value );
|
|
74
|
+
console.log(
|
|
75
|
+
"_ee84fb036ed2726e01b0415109246927_",
|
|
76
|
+
"\noriginal value:", prettyIRJsonStr( original_value, 2, { hoisted: false } ),
|
|
77
|
+
"\nmin dbn:", minDbn,
|
|
78
|
+
"\nmin unbound:", minUnb,
|
|
79
|
+
"\nnormalized dbn:", normalized_dbn,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
//*/
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return this._hash;
|
|
86
|
+
}
|
|
87
|
+
markHashAsInvalid() {
|
|
88
|
+
this._hash = undefined;
|
|
89
|
+
this._deps = undefined;
|
|
90
|
+
this.parent?.markHashAsInvalid();
|
|
91
|
+
}
|
|
92
|
+
isHashPresent() { return isIRHash(this._hash); }
|
|
93
|
+
_value;
|
|
94
|
+
get value() { return this._value; }
|
|
95
|
+
set value(newVal) {
|
|
96
|
+
if (!isIRTerm(newVal))
|
|
97
|
+
throw new BasePlutsError("letted term was not IRTerm");
|
|
98
|
+
if (!shallowEqualIRTermHash(this._value, newVal))
|
|
99
|
+
this.markHashAsInvalid();
|
|
100
|
+
// remove deps even if the value is the same
|
|
101
|
+
// newValue might be a clone of the current value
|
|
102
|
+
// and so have different (new) objects
|
|
103
|
+
this._deps = undefined;
|
|
104
|
+
// keep the parent reference in the old child, useful for compilation
|
|
105
|
+
// _value.parent = undefined;
|
|
106
|
+
this._value = newVal;
|
|
107
|
+
this._value.parent = this;
|
|
108
|
+
}
|
|
109
|
+
_dbn;
|
|
110
|
+
/**
|
|
111
|
+
* we need to keep track of the debruijn at which the `IRLetted` is instantiated
|
|
112
|
+
*
|
|
113
|
+
* this is because stuff like `new IRLetted( new IRVar(0) )` has different meaning
|
|
114
|
+
* at different DeBruijn levels
|
|
115
|
+
*
|
|
116
|
+
* knowing the DeBruijn we can differentiate them
|
|
117
|
+
*/
|
|
118
|
+
get dbn() { return this._dbn; }
|
|
119
|
+
set dbn(newDbn) {
|
|
120
|
+
if (!(Number.isSafeInteger(newDbn) && newDbn >= 0))
|
|
121
|
+
throw new BasePlutsError("invalid index for an `IRLetted` instance");
|
|
122
|
+
if (newDbn === this._dbn) {
|
|
123
|
+
// everything ok
|
|
124
|
+
// avoid calling `markHashAsInvalid`
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.markHashAsInvalid();
|
|
128
|
+
this._dbn = newDbn;
|
|
129
|
+
}
|
|
130
|
+
isClosedAtDbn(dbn) {
|
|
131
|
+
if (!Number.isSafeInteger(dbn))
|
|
132
|
+
throw new Error("unexpected unsafe dbn integer");
|
|
133
|
+
const minUnbound = _getMinUnboundDbn(this._value);
|
|
134
|
+
if (minUnbound === undefined)
|
|
135
|
+
return true;
|
|
136
|
+
return minUnbound < dbn;
|
|
137
|
+
}
|
|
138
|
+
_deps;
|
|
139
|
+
get dependencies() {
|
|
140
|
+
if (this._deps === undefined)
|
|
141
|
+
this._deps = getSortedLettedSet(getLettedTerms(this._value));
|
|
142
|
+
return this._deps;
|
|
143
|
+
}
|
|
144
|
+
_parent;
|
|
145
|
+
get parent() { return this._parent; }
|
|
146
|
+
set parent(newParent) {
|
|
147
|
+
if (!( // assert
|
|
148
|
+
// new parent value is different than current
|
|
149
|
+
this._parent !== newParent && (
|
|
150
|
+
// and the new parent value is valid
|
|
151
|
+
newParent === undefined ||
|
|
152
|
+
isIRParentTerm(newParent))))
|
|
153
|
+
return;
|
|
154
|
+
this._parent = newParent;
|
|
155
|
+
}
|
|
156
|
+
meta;
|
|
157
|
+
constructor(DeBruijn, toLet, metadata = {}, _unsafeHash = undefined) {
|
|
158
|
+
DeBruijn = typeof DeBruijn === "bigint" ? Number(DeBruijn) : DeBruijn;
|
|
159
|
+
if (!(Number.isSafeInteger(DeBruijn) && DeBruijn >= 0))
|
|
160
|
+
throw new BasePlutsError("invalid index for an `IRLetted` instance");
|
|
161
|
+
while (toLet instanceof IRLetted ||
|
|
162
|
+
toLet instanceof IRHoisted) {
|
|
163
|
+
toLet = toLet instanceof IRLetted ? toLet.value : toLet.hoisted;
|
|
164
|
+
}
|
|
165
|
+
if (!isIRTerm(toLet))
|
|
166
|
+
throw new BasePlutsError("letted value was not an IRTerm");
|
|
167
|
+
this._dbn = DeBruijn;
|
|
168
|
+
this._value = toLet;
|
|
169
|
+
this._value.parent = this;
|
|
170
|
+
// we need the has before setting dependecies
|
|
171
|
+
this._hash = isIRHash(_unsafeHash) ? _unsafeHash : undefined;
|
|
172
|
+
this._deps = undefined;
|
|
173
|
+
this._parent = undefined;
|
|
174
|
+
this.meta = {
|
|
175
|
+
...defaultLettedMeta,
|
|
176
|
+
...metadata,
|
|
177
|
+
// isClosed: metadata.isClosed || this.isClosedAtDbn( 0 )
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
static get kind() { return IRNodeKind.Letted; }
|
|
181
|
+
get kind() { return IRLetted.kind; }
|
|
182
|
+
static get tag() { return new Uint8Array([IRLetted.kind]); }
|
|
183
|
+
clone() {
|
|
184
|
+
return new IRLetted(this.dbn, this.value.clone(), { ...this.meta }, this.isHashPresent() ? this.hash : undefined);
|
|
185
|
+
}
|
|
186
|
+
toJSON() { return this.toJson(); }
|
|
187
|
+
toJson() {
|
|
188
|
+
return {
|
|
189
|
+
type: "IRLetted",
|
|
190
|
+
hash: irHashToHex(this.hash),
|
|
191
|
+
value: this.value.toJson()
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* basically an insertion sort;
|
|
197
|
+
*
|
|
198
|
+
* @param {LettedSetEntry[]} lettedTerms
|
|
199
|
+
* @returns {LettedSetEntry[]} a **new** array with ```IRLetted```s with no dependencies first, followed by the dependents
|
|
200
|
+
*/
|
|
201
|
+
export function getSortedLettedSet(lettedTerms) {
|
|
202
|
+
const set = [];
|
|
203
|
+
const hashesSet = [];
|
|
204
|
+
/**
|
|
205
|
+
* **O((n * m) * d)**
|
|
206
|
+
*
|
|
207
|
+
* where
|
|
208
|
+
*
|
|
209
|
+
* n = length of set
|
|
210
|
+
* m = number of terms passed
|
|
211
|
+
* d = number of unique dependencies among the passed terms
|
|
212
|
+
*/
|
|
213
|
+
function addToSet(_terms) {
|
|
214
|
+
for (let i = 0; i < _terms.length; i++) {
|
|
215
|
+
const thisLettedEntry = _terms[i];
|
|
216
|
+
const thisHash = thisLettedEntry.letted.hash;
|
|
217
|
+
const idxInSet = hashesSet.findIndex(hash => equalIrHash(hash, thisHash));
|
|
218
|
+
// if( !hashesSet.includes( hash ) )
|
|
219
|
+
// "includes" uses standard equality (===)
|
|
220
|
+
if (idxInSet < 0) // not present
|
|
221
|
+
{
|
|
222
|
+
// add dependencies first
|
|
223
|
+
// dependencies don't have references to the current letted
|
|
224
|
+
// (of course, wouldn't be much of a dependecy otherwhise)
|
|
225
|
+
//
|
|
226
|
+
// don't add dependecies of dependecies since `dependecies` proerty
|
|
227
|
+
// already calls `getSortedLettedSet( getLettedTerms( _value ) )`
|
|
228
|
+
// so repeating it here would count deps twice (exponentially for deps of deps)
|
|
229
|
+
addToSet(getLettedTerms(thisLettedEntry.letted.value));
|
|
230
|
+
hashesSet.push(thisHash);
|
|
231
|
+
set.push({
|
|
232
|
+
letted: thisLettedEntry.letted,
|
|
233
|
+
nReferences: thisLettedEntry.nReferences
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const entry = set[idxInSet];
|
|
238
|
+
entry.nReferences += thisLettedEntry.nReferences;
|
|
239
|
+
entry.letted.meta.forceHoist =
|
|
240
|
+
entry.letted.meta.forceHoist ||
|
|
241
|
+
thisLettedEntry.letted.meta.forceHoist;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
addToSet(lettedTerms);
|
|
246
|
+
return set;
|
|
247
|
+
}
|
|
248
|
+
export const default_getLettedTermsOptions = {
|
|
249
|
+
all: false,
|
|
250
|
+
includeHoisted: false
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
* @param {IRTerm} irTerm term to search in
|
|
255
|
+
* @returns direct letted terms (no possible dependencies)
|
|
256
|
+
*/
|
|
257
|
+
export function getLettedTerms(irTerm, options) {
|
|
258
|
+
const { all, includeHoisted } = {
|
|
259
|
+
...default_getLettedTermsOptions,
|
|
260
|
+
...options
|
|
261
|
+
};
|
|
262
|
+
const lettedTerms = [];
|
|
263
|
+
const stack = [irTerm];
|
|
264
|
+
while (stack.length > 0) {
|
|
265
|
+
const t = stack.pop();
|
|
266
|
+
if (t instanceof IRLetted) {
|
|
267
|
+
lettedTerms.push({ letted: t, nReferences: 1 });
|
|
268
|
+
if (all) {
|
|
269
|
+
stack.push(t.value);
|
|
270
|
+
}
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (t instanceof IRApp) {
|
|
274
|
+
stack.push(t.fn, t.arg);
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (t instanceof IRConstr) {
|
|
278
|
+
stack.push(...Array.from(t.fields));
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (t instanceof IRCase) {
|
|
282
|
+
stack.push(t.constrTerm, ...Array.from(t.continuations));
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (t instanceof IRFunc) {
|
|
286
|
+
stack.push(t.body);
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (t instanceof IRRecursive) {
|
|
290
|
+
stack.push(t.body);
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (t instanceof IRForced) {
|
|
294
|
+
stack.push(t.forced);
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
if (t instanceof IRDelayed) {
|
|
298
|
+
stack.push(t.delayed);
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
if (includeHoisted) {
|
|
302
|
+
if (t instanceof IRHoisted) {
|
|
303
|
+
stack.push(t.hoisted);
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return lettedTerms;
|
|
309
|
+
}
|
|
310
|
+
export function getNormalizedLettedArgs(lettedDbn, value) {
|
|
311
|
+
const normalized_value = value.clone();
|
|
312
|
+
const minDbn = getMinVarDbn(normalized_value);
|
|
313
|
+
if (minDbn === undefined)
|
|
314
|
+
return undefined;
|
|
315
|
+
if (minDbn !== 0)
|
|
316
|
+
iterTree(normalized_value, (node, relativeDbn) => {
|
|
317
|
+
if (node instanceof IRVar) {
|
|
318
|
+
node.dbn -= minDbn;
|
|
319
|
+
}
|
|
320
|
+
else if (node instanceof IRSelfCall) {
|
|
321
|
+
node.dbn -= minDbn;
|
|
322
|
+
}
|
|
323
|
+
//*
|
|
324
|
+
else if (node instanceof IRLetted) {
|
|
325
|
+
const max = getMaxVarDbn(node.value);
|
|
326
|
+
if (
|
|
327
|
+
// no vars
|
|
328
|
+
typeof max !== "number" ||
|
|
329
|
+
// defined outside of letted
|
|
330
|
+
max >= relativeDbn) {
|
|
331
|
+
node.dbn -= minDbn;
|
|
332
|
+
}
|
|
333
|
+
else // if depends on vars in this letted
|
|
334
|
+
{
|
|
335
|
+
// TODO: fix double checking already inlined values
|
|
336
|
+
//
|
|
337
|
+
// this is currently a workaround
|
|
338
|
+
//
|
|
339
|
+
// the real problem is that sometimes (when?)
|
|
340
|
+
// `iterTree` goes back checking some value that was already modified
|
|
341
|
+
// in the case of `IRApp` as parent, throwing an error
|
|
342
|
+
// because we don't know which value we should modify
|
|
343
|
+
if (node.parent instanceof IRApp) {
|
|
344
|
+
const parent = node.parent;
|
|
345
|
+
const currentChild = node;
|
|
346
|
+
if ( // parent is actually pointing to child
|
|
347
|
+
currentChild === parent.arg ||
|
|
348
|
+
currentChild === parent.fn ||
|
|
349
|
+
equalIrHash(parent.arg.hash, currentChild.hash) ||
|
|
350
|
+
equalIrHash(parent.fn.hash, currentChild.hash)) {
|
|
351
|
+
// inline
|
|
352
|
+
_modifyChildFromTo(node.parent, node, node.value);
|
|
353
|
+
return true; // modified parent
|
|
354
|
+
}
|
|
355
|
+
else
|
|
356
|
+
return false; // modified parent
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
if (node.parent) // only modify if not root
|
|
360
|
+
{
|
|
361
|
+
// inline
|
|
362
|
+
_modifyChildFromTo(node.parent, node, node.value);
|
|
363
|
+
return true; // modified parent
|
|
364
|
+
}
|
|
365
|
+
else
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
//*/
|
|
371
|
+
},
|
|
372
|
+
// shouldSkipNode ?
|
|
373
|
+
// hoisted terms are not really here
|
|
374
|
+
// will be substituted to variables when the time comes
|
|
375
|
+
// however now are here and we need to skip them
|
|
376
|
+
//
|
|
377
|
+
// !!! WARNING !! removing this causes strange uplc compilation BUGS
|
|
378
|
+
(node, dbn) => node instanceof IRHoisted);
|
|
379
|
+
// !!! IMPORTANT !!! _getMinUnboundDbn( value ) MUST be called on the original value; NOT the **modified** `normalized_value`
|
|
380
|
+
return [lettedDbn - (_getMinUnboundDbn(value) ?? minDbn), normalized_value];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
*
|
|
384
|
+
* @param term the ir term to iter to search for vars
|
|
385
|
+
* @returns {number | undefined}
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```ts
|
|
389
|
+
* let minDbn = getMinVarDbn( new IRVar(0) ); // 0
|
|
390
|
+
* minDbn = getMinVarDbn( IRConst.unit ); // undefined
|
|
391
|
+
* minDbn = getMinVarDbn( new IRFunc( 1, new IRVar( 0 ) ) ); // 0
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
export function getMinVarDbn(term) {
|
|
395
|
+
let min = undefined;
|
|
396
|
+
let foundAny = false;
|
|
397
|
+
iterTree(term, (node) => {
|
|
398
|
+
if (node instanceof IRVar ||
|
|
399
|
+
node instanceof IRSelfCall) {
|
|
400
|
+
if (foundAny) {
|
|
401
|
+
min = Math.min(min, node.dbn);
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
foundAny = true;
|
|
405
|
+
min = node.dbn;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
// shouldSkipNode ?
|
|
410
|
+
// hoisted terms are not really here
|
|
411
|
+
// will be substituted to variables when the time comes
|
|
412
|
+
// however now are here and we need to skip them
|
|
413
|
+
node => node instanceof IRHoisted // skip if hoisted
|
|
414
|
+
);
|
|
415
|
+
return min;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
*
|
|
419
|
+
* @param term the ir term to iter to search for vars
|
|
420
|
+
* @returns {number | undefined}
|
|
421
|
+
*/
|
|
422
|
+
function getMaxVarDbn(term) {
|
|
423
|
+
let max = undefined;
|
|
424
|
+
let foundAny = false;
|
|
425
|
+
iterTree(term, (node) => {
|
|
426
|
+
if (node instanceof IRVar ||
|
|
427
|
+
node instanceof IRSelfCall) {
|
|
428
|
+
if (foundAny) {
|
|
429
|
+
max = Math.max(max, node.dbn);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
foundAny = true;
|
|
433
|
+
max = node.dbn;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
// shouldSkipNode ?
|
|
438
|
+
// hoisted terms are not really here
|
|
439
|
+
// will be substituted to variables when the time comes
|
|
440
|
+
// however now are here and we need to skip them
|
|
441
|
+
node => node instanceof IRHoisted // skip if hoisted
|
|
442
|
+
);
|
|
443
|
+
return max;
|
|
444
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* we use positive for natives which map to `UPLCBuiltin`
|
|
3
|
+
* possibly keeping the same number
|
|
4
|
+
*
|
|
5
|
+
* we use negatives for natives of the `std::fn` family
|
|
6
|
+
* since there is no negative `UPLCBuiltin` tag
|
|
7
|
+
*/
|
|
8
|
+
export declare enum IRNativeTag {
|
|
9
|
+
addInteger = 0,
|
|
10
|
+
subtractInteger = 1,
|
|
11
|
+
multiplyInteger = 2,
|
|
12
|
+
divideInteger = 3,
|
|
13
|
+
quotientInteger = 4,
|
|
14
|
+
remainderInteger = 5,
|
|
15
|
+
modInteger = 6,
|
|
16
|
+
equalsInteger = 7,
|
|
17
|
+
lessThanInteger = 8,
|
|
18
|
+
lessThanEqualInteger = 9,
|
|
19
|
+
appendByteString = 10,
|
|
20
|
+
consByteString = 11,
|
|
21
|
+
sliceByteString = 12,
|
|
22
|
+
lengthOfByteString = 13,
|
|
23
|
+
indexByteString = 14,
|
|
24
|
+
equalsByteString = 15,
|
|
25
|
+
lessThanByteString = 16,
|
|
26
|
+
lessThanEqualsByteString = 17,
|
|
27
|
+
sha2_256 = 18,
|
|
28
|
+
sha3_256 = 19,
|
|
29
|
+
blake2b_256 = 20,
|
|
30
|
+
verifyEd25519Signature = 21,
|
|
31
|
+
appendString = 22,
|
|
32
|
+
equalsString = 23,
|
|
33
|
+
encodeUtf8 = 24,
|
|
34
|
+
decodeUtf8 = 25,
|
|
35
|
+
strictIfThenElse = 26,
|
|
36
|
+
chooseUnit = 27,
|
|
37
|
+
trace = 28,
|
|
38
|
+
fstPair = 29,
|
|
39
|
+
sndPair = 30,
|
|
40
|
+
strictChooseList = 31,
|
|
41
|
+
mkCons = 32,
|
|
42
|
+
headList = 33,
|
|
43
|
+
tailList = 34,
|
|
44
|
+
nullList = 35,
|
|
45
|
+
chooseData = 36,
|
|
46
|
+
constrData = 37,
|
|
47
|
+
mapData = 38,
|
|
48
|
+
listData = 39,
|
|
49
|
+
iData = 40,
|
|
50
|
+
bData = 41,
|
|
51
|
+
unConstrData = 42,
|
|
52
|
+
unMapData = 43,
|
|
53
|
+
unListData = 44,
|
|
54
|
+
unIData = 45,
|
|
55
|
+
unBData = 46,
|
|
56
|
+
equalsData = 47,
|
|
57
|
+
mkPairData = 48,
|
|
58
|
+
mkNilData = 49,
|
|
59
|
+
mkNilPairData = 50,
|
|
60
|
+
serialiseData = 51,
|
|
61
|
+
verifyEcdsaSecp256k1Signature = 52,
|
|
62
|
+
verifySchnorrSecp256k1Signature = 53,
|
|
63
|
+
bls12_381_G1_add = 54,
|
|
64
|
+
bls12_381_G1_neg = 55,
|
|
65
|
+
bls12_381_G1_scalarMul = 56,
|
|
66
|
+
bls12_381_G1_equal = 57,
|
|
67
|
+
bls12_381_G1_hashToGroup = 58,
|
|
68
|
+
bls12_381_G1_compress = 59,
|
|
69
|
+
bls12_381_G1_uncompress = 60,
|
|
70
|
+
bls12_381_G2_add = 61,
|
|
71
|
+
bls12_381_G2_neg = 62,
|
|
72
|
+
bls12_381_G2_scalarMul = 63,
|
|
73
|
+
bls12_381_G2_equal = 64,
|
|
74
|
+
bls12_381_G2_hashToGroup = 65,
|
|
75
|
+
bls12_381_G2_compress = 66,
|
|
76
|
+
bls12_381_G2_uncompress = 67,
|
|
77
|
+
bls12_381_millerLoop = 68,
|
|
78
|
+
bls12_381_mulMlResult = 69,
|
|
79
|
+
bls12_381_finalVerify = 70,
|
|
80
|
+
keccak_256 = 71,
|
|
81
|
+
blake2b_224 = 72,
|
|
82
|
+
integerToByteString = 73,
|
|
83
|
+
byteStringToInteger = 74,
|
|
84
|
+
andByteString = 75,
|
|
85
|
+
orByteString = 76,
|
|
86
|
+
xorByteString = 77,
|
|
87
|
+
complementByteString = 78,
|
|
88
|
+
readBit = 79,
|
|
89
|
+
writeBits = 80,
|
|
90
|
+
replicateByte = 81,
|
|
91
|
+
shiftByteString = 82,
|
|
92
|
+
rotateByteString = 83,
|
|
93
|
+
countSetBits = 84,
|
|
94
|
+
findFirstSetBit = 85,
|
|
95
|
+
ripemd_160 = 86,
|
|
96
|
+
_dropList = -4,
|
|
97
|
+
_foldr = -6,
|
|
98
|
+
_foldl = -7,
|
|
99
|
+
_mkFindDataOptional = -8,
|
|
100
|
+
_length = -9,
|
|
101
|
+
_some = -10,
|
|
102
|
+
_every = -11,
|
|
103
|
+
_mkFilter = -12,
|
|
104
|
+
_id = -15,
|
|
105
|
+
_not = -16,
|
|
106
|
+
_strictAnd = -17,
|
|
107
|
+
_and = -18,
|
|
108
|
+
_strictOr = -19,
|
|
109
|
+
_or = -20,
|
|
110
|
+
_gtBS = -21,
|
|
111
|
+
_gtEqBS = -22,
|
|
112
|
+
_gtInt = -23,
|
|
113
|
+
_gtEqInt = -24,
|
|
114
|
+
_strToData = -25,
|
|
115
|
+
_pairDataToData = -26,
|
|
116
|
+
_strFromData = -27,
|
|
117
|
+
_pairDataFromData = -28,
|
|
118
|
+
_mkEqualsList = -31,
|
|
119
|
+
_equalPairData = -32,
|
|
120
|
+
/**
|
|
121
|
+
* function eqBool( a: boolean, b: boolean ): boolean
|
|
122
|
+
* {
|
|
123
|
+
* return a ? ( b ? true : false ) : ( b ? false : true );
|
|
124
|
+
* }
|
|
125
|
+
**/
|
|
126
|
+
_equalBoolean = -33,
|
|
127
|
+
_negateInt = -34,
|
|
128
|
+
_mkMapList = -35,
|
|
129
|
+
_bytesToIntBE = -36,
|
|
130
|
+
_boolToInt = -37,
|
|
131
|
+
_intToBytesBE = -38,
|
|
132
|
+
_intToBool = -39,
|
|
133
|
+
_exponentiateInteger = -40,
|
|
134
|
+
_amountOfValue = -41,
|
|
135
|
+
_isZero = -42,
|
|
136
|
+
_sortedValueLovelaces = -43
|
|
137
|
+
}
|
|
138
|
+
export declare function nativeTagToString(nativeTag: IRNativeTag): string;
|