@harmoniclabs/pebble 0.1.0-dev5 → 0.1.0-dev6
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 +3 -3
- package/dist/IR/IRHash.js +47 -52
- package/dist/IR/IRNodes/IRApp.d.ts +12 -8
- package/dist/IR/IRNodes/IRApp.js +34 -20
- package/dist/IR/IRNodes/IRCase.d.ts +11 -7
- package/dist/IR/IRNodes/IRCase.js +33 -32
- package/dist/IR/IRNodes/IRConst.d.ts +7 -5
- package/dist/IR/IRNodes/IRConst.js +23 -13
- package/dist/IR/IRNodes/IRConstr.d.ts +11 -7
- package/dist/IR/IRNodes/IRConstr.js +34 -37
- package/dist/IR/IRNodes/IRDelayed.d.ts +12 -9
- package/dist/IR/IRNodes/IRDelayed.js +22 -18
- package/dist/IR/IRNodes/IRError.d.ts +9 -6
- package/dist/IR/IRNodes/IRError.js +12 -5
- package/dist/IR/IRNodes/IRForced.d.ts +9 -6
- package/dist/IR/IRNodes/IRForced.js +22 -18
- package/dist/IR/IRNodes/IRFunc.d.ts +14 -10
- package/dist/IR/IRNodes/IRFunc.js +35 -38
- package/dist/IR/IRNodes/IRHoisted.d.ts +16 -9
- package/dist/IR/IRNodes/IRHoisted.js +36 -18
- package/dist/IR/IRNodes/IRLetted.d.ts +14 -34
- package/dist/IR/IRNodes/IRLetted.js +65 -297
- package/dist/IR/IRNodes/IRNative/IRNativeTag.d.ts +0 -2
- package/dist/IR/IRNodes/IRNative/IRNativeTag.js +0 -4
- package/dist/IR/IRNodes/IRNative/index.d.ts +9 -8
- package/dist/IR/IRNodes/IRNative/index.js +55 -18
- package/dist/IR/IRNodes/IRNative/isForcedNative.d.ts +2 -0
- package/dist/IR/IRNodes/IRNative/isForcedNative.js +1 -1
- package/dist/IR/IRNodes/IRRecursive.d.ts +18 -10
- package/dist/IR/IRNodes/IRRecursive.js +36 -44
- package/dist/IR/IRNodes/IRSelfCall.d.ts +10 -24
- package/dist/IR/IRNodes/IRSelfCall.js +25 -87
- package/dist/IR/IRNodes/IRVar.d.ts +11 -19
- package/dist/IR/IRNodes/IRVar.js +26 -54
- package/dist/IR/IRNodes/utils/dependsByDbns.d.ts +1 -1
- package/dist/IR/IRNodes/utils/dependsByDbns.js +5 -11
- package/dist/IR/IRNodes/utils/hashVarSym.d.ts +1 -0
- package/dist/IR/IRNodes/utils/hashVarSym.js +37 -0
- package/dist/IR/IRNodes/utils/makeArrayLikeProxy.d.ts +2 -1
- package/dist/IR/IRTerm.d.ts +7 -0
- package/dist/IR/toUPLC/_internal/_modifyChildFromTo.js +3 -0
- package/dist/IR/toUPLC/_internal/findAll.js +2 -73
- package/dist/IR/toUPLC/_internal/getDebruijnInTerm.js +7 -34
- package/dist/IR/toUPLC/_internal/iterTree.js +3 -17
- package/dist/IR/toUPLC/common_hoisted.d.ts +2 -0
- package/dist/IR/toUPLC/common_hoisted.js +4 -0
- package/dist/IR/toUPLC/compileIRToUPLC.d.ts +1 -1
- package/dist/IR/toUPLC/compileIRToUPLC.js +91 -14
- package/dist/IR/toUPLC/ctx/ToUplcCtx.d.ts +16 -0
- package/dist/IR/toUPLC/ctx/ToUplcCtx.js +75 -0
- package/dist/IR/toUPLC/subRoutines/_comptimeDropN.d.ts +8 -0
- package/dist/IR/toUPLC/subRoutines/_comptimeDropN.js +95 -0
- package/dist/IR/toUPLC/subRoutines/handleHoistedAndReturnRoot/index.js +7 -54
- package/dist/IR/toUPLC/subRoutines/handleLetted/groupByScope.d.ts +6 -13
- package/dist/IR/toUPLC/subRoutines/handleLetted/groupByScope.js +67 -71
- package/dist/IR/toUPLC/subRoutines/handleLetted/index.js +44 -170
- package/dist/IR/toUPLC/subRoutines/handleRecursiveTerms.js +7 -3
- package/dist/IR/toUPLC/subRoutines/hoistForcedNatives.js +3 -2
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseAndReturnRoot/InlineSingleUseCtx.d.ts +22 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseAndReturnRoot/InlineSingleUseCtx.js +59 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseAndReturnRoot/inlineSingleUseAndReturnRoot.d.ts +0 -0
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseAndReturnRoot/inlineSingleUseAndReturnRoot.js +217 -0
- package/dist/IR/toUPLC/subRoutines/markRecursiveHoistsAsForced.js +12 -49
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/expandFuncsAndReturnRoot.d.ts +1 -1
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/expandFuncsAndReturnRoot.js +11 -14
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/{index.d.ts → performUplcOptimizationsAndReturnRoot.d.ts} +0 -2
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/performUplcOptimizationsAndReturnRoot.js +151 -0
- package/dist/IR/toUPLC/subRoutines/removeUnusuedVarsAndReturnRoot/RemoveUnusedVarsCtx.d.ts +11 -0
- package/dist/IR/toUPLC/subRoutines/removeUnusuedVarsAndReturnRoot/RemoveUnusedVarsCtx.js +46 -0
- package/dist/IR/toUPLC/subRoutines/removeUnusuedVarsAndReturnRoot/removeUnusuedVarsAndReturnRoot.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/removeUnusuedVarsAndReturnRoot/removeUnusuedVarsAndReturnRoot.js +80 -0
- package/dist/IR/toUPLC/subRoutines/replaceHoistedWithLetted.js +18 -11
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.d.ts +43 -0
- package/dist/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.js +255 -478
- package/dist/IR/toUPLC/subRoutines/rewriteNativesAppliedToConstantsAndReturnRoot.d.ts +2 -0
- package/dist/IR/toUPLC/subRoutines/rewriteNativesAppliedToConstantsAndReturnRoot.js +85 -0
- package/dist/IR/toUPLC/subRoutines/sanifyTree.js +1 -0
- package/dist/IR/toUPLC/utils/getApplicationTerms.d.ts +6 -0
- package/dist/IR/toUPLC/utils/getApplicationTerms.js +37 -0
- package/dist/IR/tree_utils/_ir_lazyChooseList.d.ts +2 -2
- package/dist/IR/tree_utils/_ir_lazyChooseList.js +4 -2
- package/dist/IR/tree_utils/_ir_lazyIfThenElse.d.ts +1 -1
- package/dist/IR/tree_utils/_ir_lazyIfThenElse.js +4 -2
- package/dist/IR/tree_utils/_ir_let.d.ts +2 -1
- package/dist/IR/tree_utils/_ir_let.js +6 -2
- package/dist/IR/utils/isClosedIRTerm.d.ts +1 -0
- package/dist/IR/utils/isClosedIRTerm.js +39 -25
- package/dist/IR/utils/positiveIntAsBytes.d.ts +1 -0
- package/dist/IR/utils/positiveIntAsBytes.js +4 -0
- package/dist/IR/utils/showIR.d.ts +10 -21
- package/dist/IR/utils/showIR.js +66 -64
- package/dist/ast/nodes/common/Identifier.d.ts +1 -0
- package/dist/ast/nodes/common/Identifier.js +3 -0
- package/dist/ast/nodes/expr/CaseExpr.d.ts +5 -5
- package/dist/ast/nodes/expr/ElemAccessExpr.d.ts +2 -2
- package/dist/ast/nodes/expr/ParentesizedExpr.d.ts +1 -1
- package/dist/ast/nodes/expr/PebbleExpr.d.ts +2 -1
- package/dist/ast/nodes/expr/PropAccessExpr.d.ts +3 -3
- package/dist/ast/nodes/expr/TernaryExpr.d.ts +3 -3
- package/dist/ast/nodes/expr/TypeConversionExpr.d.ts +2 -1
- package/dist/ast/nodes/expr/TypeConversionExpr.js +2 -0
- package/dist/ast/nodes/expr/binary/BinaryExpr.d.ts +42 -42
- package/dist/ast/nodes/expr/functions/CallExpr.d.ts +1 -1
- package/dist/ast/nodes/expr/functions/FuncExpr.d.ts +2 -1
- package/dist/ast/nodes/expr/functions/FuncExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitContextExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitContextExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitFailExpr.d.ts +6 -0
- package/dist/ast/nodes/expr/litteral/LitFailExpr.js +6 -0
- package/dist/ast/nodes/expr/litteral/LitteralExpr.d.ts +3 -1
- package/dist/ast/nodes/expr/litteral/LitteralExpr.js +5 -1
- package/dist/ast/nodes/statements/AssertStmt.d.ts +2 -2
- package/dist/ast/nodes/statements/AssignmentStmt.d.ts +1 -1
- package/dist/ast/nodes/statements/BlockStmt.d.ts +1 -1
- package/dist/ast/nodes/statements/FailStmt.d.ts +1 -1
- package/dist/ast/nodes/statements/ForOfStmt.d.ts +4 -2
- package/dist/ast/nodes/statements/ForOfStmt.js +6 -0
- package/dist/ast/nodes/statements/ForStmt.d.ts +6 -4
- package/dist/ast/nodes/statements/ForStmt.js +6 -0
- package/dist/ast/nodes/statements/IfStmt.d.ts +8 -5
- package/dist/ast/nodes/statements/IfStmt.js +13 -0
- package/dist/ast/nodes/statements/MatchStmt.d.ts +13 -4
- package/dist/ast/nodes/statements/MatchStmt.js +22 -1
- package/dist/ast/nodes/statements/PebbleStmt.d.ts +2 -1
- package/dist/ast/nodes/statements/PebbleStmt.js +3 -1
- package/dist/ast/nodes/statements/ReturnStmt.d.ts +1 -1
- package/dist/ast/nodes/statements/WhileStmt.d.ts +4 -2
- package/dist/ast/nodes/statements/WhileStmt.js +6 -0
- package/dist/ast/nodes/statements/declarations/ContractDecl.d.ts +17 -0
- package/dist/ast/nodes/statements/declarations/ContractDecl.js +22 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/ArrayLikeDeconstr.d.ts +1 -1
- package/dist/ast/nodes/statements/declarations/VarDecl/HasInit.d.ts +1 -1
- package/dist/ast/nodes/statements/declarations/VarDecl/NamedDeconstructVarDecl.d.ts +1 -1
- package/dist/ast/nodes/statements/declarations/VarDecl/SimpleVarDecl.d.ts +2 -1
- package/dist/ast/nodes/statements/declarations/VarDecl/SimpleVarDecl.js +6 -0
- package/dist/ast/nodes/statements/declarations/VarDecl/SingleDeconstructVarDecl.d.ts +1 -1
- package/dist/compiler/AstCompiler/AstCompiler.d.ts +6 -2
- package/dist/compiler/AstCompiler/AstCompiler.js +91 -24
- package/dist/compiler/AstCompiler/internal/_deriveContractBody/_deriveContractBody.d.ts +10 -0
- package/dist/compiler/AstCompiler/internal/_deriveContractBody/_deriveContractBody.js +777 -0
- package/dist/compiler/AstCompiler/internal/exprs/_compileBinaryExpr.js +1 -1
- package/dist/compiler/AstCompiler/internal/exprs/_compileExpr.js +1 -1
- package/dist/compiler/AstCompiler/internal/exprs/_compileLitteralExpr.js +8 -2
- package/dist/compiler/AstCompiler/internal/exprs/_compilePropAccessExpr.js +1 -1
- package/dist/compiler/AstCompiler/internal/exprs/_compileTypeConversionExpr.js +3 -1
- package/dist/compiler/AstCompiler/internal/exprs/_compileUnaryPrefixExpr.js +1 -1
- package/dist/compiler/AstCompiler/internal/statements/_compileAssignmentStmt.js +2 -2
- package/dist/compiler/AstCompiler/internal/statements/_compileMatchStmt.d.ts +2 -2
- package/dist/compiler/AstCompiler/internal/statements/_compileMatchStmt.js +48 -24
- package/dist/compiler/AstCompiler/internal/statements/_compileStatement.js +4 -1
- package/dist/compiler/AstCompiler/internal/statements/_compileVarStmt.js +2 -2
- package/dist/compiler/AstCompiler/internal/types/_compileDataEncodedConcreteType.js +1 -1
- package/dist/compiler/AstCompiler/internal/types/_compileSopEncodedConcreteType.js +4 -1
- package/dist/compiler/AstCompiler/scope/AstScope.js +4 -3
- package/dist/compiler/AstCompiler/utils/getPropAccessReturnType.js +6 -4
- package/dist/compiler/Compiler.js +3 -1
- package/dist/compiler/TirCompiler/compileTirProgram.js +3 -1
- package/dist/compiler/TirCompiler/expressify/ExpressifyCtx.d.ts +13 -3
- package/dist/compiler/TirCompiler/expressify/ExpressifyCtx.js +41 -37
- package/dist/compiler/TirCompiler/expressify/determineReassignedVariablesAndReturn.js +11 -2
- package/dist/compiler/TirCompiler/expressify/expressify.d.ts +2 -1
- package/dist/compiler/TirCompiler/expressify/expressify.js +82 -36
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.d.ts +2 -1
- package/dist/compiler/TirCompiler/expressify/expressifyForStmt.js +57 -8
- package/dist/compiler/TirCompiler/expressify/expressifyIfBranch.js +1 -1
- package/dist/compiler/TirCompiler/expressify/expressifyVarAssignmentStmt.js +1 -1
- package/dist/compiler/TirCompiler/expressify/expressifyVarDecl.js +1 -0
- package/dist/compiler/TirCompiler/expressify/expressifyVars.js +131 -9
- package/dist/compiler/TirCompiler/internal/_compileHoistedDeps.js +3 -1
- package/dist/compiler/io/IOutputStream.d.ts +1 -0
- package/dist/compiler/io/IOutputStream.js +18 -3
- package/dist/compiler/path/getAbsolutePath.js +4 -6
- package/dist/compiler/tir/expressions/ITirExpr.d.ts +2 -0
- package/dist/compiler/tir/expressions/TirAssertAndContinueExpr.d.ts +4 -2
- package/dist/compiler/tir/expressions/TirAssertAndContinueExpr.js +16 -2
- package/dist/compiler/tir/expressions/TirCallExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirCallExpr.js +16 -1
- package/dist/compiler/tir/expressions/TirCaseExpr.d.ts +6 -1
- package/dist/compiler/tir/expressions/TirCaseExpr.js +103 -60
- package/dist/compiler/tir/expressions/TirElemAccessExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirElemAccessExpr.js +9 -1
- package/dist/compiler/tir/expressions/TirFailExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirFailExpr.js +9 -1
- package/dist/compiler/tir/expressions/TirFromDataExpr.d.ts +3 -2
- package/dist/compiler/tir/expressions/TirFromDataExpr.js +85 -56
- package/dist/compiler/tir/expressions/TirFuncExpr.d.ts +4 -10
- package/dist/compiler/tir/expressions/TirFuncExpr.js +30 -13
- package/dist/compiler/tir/expressions/TirHoistedExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirHoistedExpr.js +8 -0
- package/dist/compiler/tir/expressions/TirInlineClosedIR.d.ts +4 -1
- package/dist/compiler/tir/expressions/TirInlineClosedIR.js +8 -0
- package/dist/compiler/tir/expressions/TirLettedExpr.d.ts +5 -2
- package/dist/compiler/tir/expressions/TirLettedExpr.js +19 -4
- package/dist/compiler/tir/expressions/TirNativeFunc.d.ts +8 -5
- package/dist/compiler/tir/expressions/TirNativeFunc.js +50 -22
- package/dist/compiler/tir/expressions/TirParentesizedExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirParentesizedExpr.js +6 -0
- package/dist/compiler/tir/expressions/TirPropAccessExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirPropAccessExpr.js +9 -0
- package/dist/compiler/tir/expressions/TirTernaryExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirTernaryExpr.js +16 -5
- package/dist/compiler/tir/expressions/TirToDataExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirToDataExpr.js +56 -25
- package/dist/compiler/tir/expressions/TirTraceIfFalseExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirTraceIfFalseExpr.js +21 -4
- package/dist/compiler/tir/expressions/TirTypeConversionExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/TirTypeConversionExpr.js +9 -1
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.d.ts +7 -3
- package/dist/compiler/tir/expressions/TirVariableAccessExpr.js +17 -7
- package/dist/compiler/tir/expressions/ToIRTermCtx.d.ts +16 -20
- package/dist/compiler/tir/expressions/ToIRTermCtx.js +67 -50
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.d.ts +40 -0
- package/dist/compiler/tir/expressions/binary/TirBinaryExpr.js +174 -3
- package/dist/compiler/tir/expressions/litteral/TirLitArrExpr.d.ts +4 -2
- package/dist/compiler/tir/expressions/litteral/TirLitArrExpr.js +8 -2
- package/dist/compiler/tir/expressions/litteral/TirLitFailExpr.d.ts +17 -0
- package/dist/compiler/tir/expressions/litteral/TirLitFailExpr.js +21 -0
- package/dist/compiler/tir/expressions/litteral/TirLitFalseExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitFalseExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitHexBytesExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitHexBytesExpr.js +5 -0
- package/dist/compiler/tir/expressions/litteral/TirLitIntExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitIntExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitNamedObjExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/litteral/TirLitNamedObjExpr.js +5 -0
- package/dist/compiler/tir/expressions/litteral/TirLitObjExpr.d.ts +3 -1
- package/dist/compiler/tir/expressions/litteral/TirLitObjExpr.js +5 -0
- package/dist/compiler/tir/expressions/litteral/TirLitStrExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitStrExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitThisExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitThisExpr.js +7 -3
- package/dist/compiler/tir/expressions/litteral/TirLitTrueExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitTrueExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitUndefExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitUndefExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitVoidExpr.d.ts +4 -1
- package/dist/compiler/tir/expressions/litteral/TirLitVoidExpr.js +4 -0
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.d.ts +2 -1
- package/dist/compiler/tir/expressions/litteral/TirLitteralExpr.js +3 -1
- package/dist/compiler/tir/expressions/unary/TirUnaryExclamation.d.ts +4 -2
- package/dist/compiler/tir/expressions/unary/TirUnaryExclamation.js +8 -3
- package/dist/compiler/tir/expressions/unary/TirUnaryMinus.d.ts +4 -2
- package/dist/compiler/tir/expressions/unary/TirUnaryMinus.js +8 -2
- package/dist/compiler/tir/expressions/unary/TirUnaryPlus.d.ts +3 -1
- package/dist/compiler/tir/expressions/unary/TirUnaryPlus.js +6 -0
- package/dist/compiler/tir/expressions/unary/TirUnaryTilde.d.ts +4 -2
- package/dist/compiler/tir/expressions/unary/TirUnaryTilde.js +8 -2
- package/dist/compiler/tir/program/TypedProgram.d.ts +1 -0
- package/dist/compiler/tir/program/TypedProgram.js +9 -0
- package/dist/compiler/tir/program/stdScope/stdScope.js +126 -126
- package/dist/compiler/tir/statements/TirAssertStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirAssertStmt.js +10 -0
- package/dist/compiler/tir/statements/TirAssignmentStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirAssignmentStmt.js +8 -0
- package/dist/compiler/tir/statements/TirBlockStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirBlockStmt.js +16 -0
- package/dist/compiler/tir/statements/TirBreakStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirBreakStmt.js +8 -0
- package/dist/compiler/tir/statements/TirContinueStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirContinueStmt.js +8 -0
- package/dist/compiler/tir/statements/TirFailStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirFailStmt.js +8 -0
- package/dist/compiler/tir/statements/TirForOfStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirForOfStmt.js +14 -0
- package/dist/compiler/tir/statements/TirForStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirForStmt.js +21 -0
- package/dist/compiler/tir/statements/TirIfStmt.d.ts +3 -0
- package/dist/compiler/tir/statements/TirIfStmt.js +19 -0
- package/dist/compiler/tir/statements/TirMatchStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirMatchStmt.js +30 -0
- package/dist/compiler/tir/statements/TirReturnStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirReturnStmt.js +8 -0
- package/dist/compiler/tir/statements/TirStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirArrayLikeDeconstr.d.ts +2 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirArrayLikeDeconstr.js +30 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirNamedDeconstructVarDecl.d.ts +3 -1
- package/dist/compiler/tir/statements/TirVarDecl/TirNamedDeconstructVarDecl.js +28 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSimpleVarDecl.d.ts +3 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSimpleVarDecl.js +13 -0
- package/dist/compiler/tir/statements/TirVarDecl/TirSingleDeconstructVarDecl.d.ts +3 -1
- package/dist/compiler/tir/statements/TirVarDecl/TirSingleDeconstructVarDecl.js +28 -0
- package/dist/compiler/tir/statements/TirWhileStmt.d.ts +2 -0
- package/dist/compiler/tir/statements/TirWhileStmt.js +14 -0
- package/dist/compiler/tir/types/utils/canAssignTo.js +1 -1
- package/dist/diagnostics/DiagnosticEmitter.js +1 -1
- package/dist/diagnostics/diagnosticMessages.generated.d.ts +10 -1
- package/dist/diagnostics/diagnosticMessages.generated.js +20 -2
- package/dist/parser/Parser.d.ts +8 -3
- package/dist/parser/Parser.js +162 -30
- package/dist/tokenizer/Token.d.ts +81 -72
- package/dist/tokenizer/Token.js +82 -72
- package/dist/tokenizer/utils/tokenFromKeyword.js +32 -10
- package/dist/tokenizer/utils/tokenIsAlsoIdentifier.js +10 -0
- package/dist/utils/BitUtils/index.js +1 -1
- package/dist/utils/UPLCFlatUtils/index.js +1 -1
- package/package.json +2 -1
- package/dist/IR/IRNodes/utils/isClosedAtDbn.d.ts +0 -2
- package/dist/IR/IRNodes/utils/isClosedAtDbn.js +0 -22
- package/dist/IR/toUPLC/_internal/_irToUplc.d.ts +0 -9
- package/dist/IR/toUPLC/_internal/_irToUplc.js +0 -156
- package/dist/IR/toUPLC/subRoutines/handleLetted/incrementUnboundDbns.d.ts +0 -9
- package/dist/IR/toUPLC/subRoutines/handleLetted/incrementUnboundDbns.js +0 -73
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseApplications.d.ts +0 -1
- package/dist/IR/toUPLC/subRoutines/inlineSingleUseApplications.js +0 -12
- package/dist/IR/toUPLC/subRoutines/performUplcOptimizationsAndReturnRoot/index.js +0 -227
- package/dist/IR/tree_utils/_ir_apps.d.ts +0 -3
- package/dist/IR/tree_utils/_ir_apps.js +0 -8
|
@@ -9,6 +9,10 @@ export class TirLitIntExpr {
|
|
|
9
9
|
this.integer = integer;
|
|
10
10
|
this.range = range;
|
|
11
11
|
}
|
|
12
|
+
pretty() { return this.toString(); }
|
|
13
|
+
toString() {
|
|
14
|
+
return this.integer.toString();
|
|
15
|
+
}
|
|
12
16
|
clone() {
|
|
13
17
|
return new TirLitIntExpr(this.integer, this.range.clone());
|
|
14
18
|
}
|
|
@@ -16,7 +16,9 @@ export declare class TirLitNamedObjExpr implements ITirExpr, ITirLitObjExpr {
|
|
|
16
16
|
readonly range: SourceRange;
|
|
17
17
|
get isConstant(): boolean;
|
|
18
18
|
constructor(name: Identifier, fieldNames: Identifier[], values: TirExpr[], type: TirSoPStructType | TirDataStructType | TirSopOptT | TirDataOptT, range: SourceRange);
|
|
19
|
-
|
|
19
|
+
pretty(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
clone(): TirExpr;
|
|
20
22
|
deps(): string[];
|
|
21
23
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
22
24
|
}
|
|
@@ -31,6 +31,11 @@ export class TirLitNamedObjExpr {
|
|
|
31
31
|
this.type = type;
|
|
32
32
|
this.range = range;
|
|
33
33
|
}
|
|
34
|
+
pretty() { return this.toString(); }
|
|
35
|
+
toString() {
|
|
36
|
+
const fields = this.fieldNames.map((f, i) => `${f.text}: ${this.values[i].toString()}`);
|
|
37
|
+
return `${this.name.text}{ ${fields.join(", ")} }`;
|
|
38
|
+
}
|
|
34
39
|
clone() {
|
|
35
40
|
return new TirLitNamedObjExpr(this.name, this.fieldNames.map(f => f), this.values.map(v => v.clone()), this.type.clone(), this.range.clone());
|
|
36
41
|
}
|
|
@@ -16,7 +16,9 @@ export declare class TirLitObjExpr implements ITirExpr, ITirLitObjExpr {
|
|
|
16
16
|
readonly range: SourceRange;
|
|
17
17
|
get isConstant(): boolean;
|
|
18
18
|
constructor(fieldNames: Identifier[], values: TirExpr[], type: TirSoPStructType | TirDataStructType, range: SourceRange);
|
|
19
|
-
|
|
19
|
+
pretty(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
clone(): TirExpr;
|
|
20
22
|
deps(): string[];
|
|
21
23
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
22
24
|
}
|
|
@@ -29,6 +29,11 @@ export class TirLitObjExpr {
|
|
|
29
29
|
this.type = type;
|
|
30
30
|
this.range = range;
|
|
31
31
|
}
|
|
32
|
+
pretty() { return this.toString(); }
|
|
33
|
+
toString() {
|
|
34
|
+
const fields = this.fieldNames.map((f, i) => `${f.text}: ${this.values[i].toString()}`);
|
|
35
|
+
return `{ ${fields.join(", ")} }`;
|
|
36
|
+
}
|
|
32
37
|
clone() {
|
|
33
38
|
return new TirLitObjExpr(this.fieldNames.map(f => f), this.values.map(v => v.clone()), this.type.clone(), this.range.clone());
|
|
34
39
|
}
|
|
@@ -3,13 +3,16 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
3
3
|
import { TirType } from "../../types/TirType.js";
|
|
4
4
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
5
5
|
import { IRTerm } from "../../../../IR/index.js";
|
|
6
|
+
import { TirExpr } from "../TirExpr.js";
|
|
6
7
|
export declare class TirLitStrExpr implements ITirExpr {
|
|
7
8
|
readonly string: string;
|
|
8
9
|
readonly range: SourceRange;
|
|
9
10
|
readonly type: TirType;
|
|
10
11
|
readonly isConstant: boolean;
|
|
11
12
|
constructor(string: string, range: SourceRange);
|
|
12
|
-
|
|
13
|
+
pretty(): string;
|
|
14
|
+
toString(): string;
|
|
15
|
+
clone(): TirExpr;
|
|
13
16
|
deps(): string[];
|
|
14
17
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
15
18
|
}
|
|
@@ -3,12 +3,15 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
3
3
|
import { TirType } from "../../types/TirType.js";
|
|
4
4
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
5
5
|
import { IRTerm } from "../../../../IR/index.js";
|
|
6
|
+
import { TirExpr } from "../TirExpr.js";
|
|
6
7
|
export declare class TirLitThisExpr implements ITirExpr {
|
|
7
8
|
readonly type: TirType;
|
|
8
9
|
readonly range: SourceRange;
|
|
9
10
|
readonly isConstant: boolean;
|
|
10
11
|
constructor(type: TirType, range: SourceRange);
|
|
11
|
-
|
|
12
|
+
pretty(): string;
|
|
13
|
+
toString(): string;
|
|
14
|
+
clone(): TirExpr;
|
|
12
15
|
deps(): string[];
|
|
13
16
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
14
17
|
}
|
|
@@ -7,14 +7,18 @@ export class TirLitThisExpr {
|
|
|
7
7
|
this.type = type;
|
|
8
8
|
this.range = range;
|
|
9
9
|
}
|
|
10
|
+
pretty() { return this.toString(); }
|
|
11
|
+
toString() {
|
|
12
|
+
return `this`;
|
|
13
|
+
}
|
|
10
14
|
clone() {
|
|
11
15
|
return new TirLitThisExpr(this.type.clone(), this.range.clone());
|
|
12
16
|
}
|
|
13
17
|
deps() { return []; }
|
|
14
18
|
toIR(ctx) {
|
|
15
|
-
const
|
|
16
|
-
if (typeof
|
|
19
|
+
const sym = ctx.getVarAccessSym("this");
|
|
20
|
+
if (typeof sym !== "symbol")
|
|
17
21
|
throw new Error("Missing 'this' variable declaration in context");
|
|
18
|
-
return new IRVar(
|
|
22
|
+
return new IRVar(sym);
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -3,12 +3,15 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
3
3
|
import { TirType } from "../../types/TirType.js";
|
|
4
4
|
import { IRTerm } from "../../../../IR/index.js";
|
|
5
5
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
6
|
+
import { TirExpr } from "../TirExpr.js";
|
|
6
7
|
export declare class TirLitTrueExpr implements ITirExpr {
|
|
7
8
|
readonly range: SourceRange;
|
|
8
9
|
readonly type: TirType;
|
|
9
10
|
readonly isConstant: boolean;
|
|
10
11
|
constructor(range: SourceRange);
|
|
11
|
-
|
|
12
|
+
pretty(): string;
|
|
13
|
+
toString(): string;
|
|
14
|
+
clone(): TirExpr;
|
|
12
15
|
deps(): string[];
|
|
13
16
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
14
17
|
}
|
|
@@ -4,6 +4,7 @@ import { IRTerm } from "../../../../IR/index.js";
|
|
|
4
4
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
5
5
|
import { TirDataOptT } from "../../types/TirNativeType/native/Optional/data.js";
|
|
6
6
|
import { TirSopOptT } from "../../types/TirNativeType/native/Optional/sop.js";
|
|
7
|
+
import { TirExpr } from "../TirExpr.js";
|
|
7
8
|
export declare class TirLitUndefExpr implements ITirExpr {
|
|
8
9
|
/** must be an optional */
|
|
9
10
|
readonly type: TirSopOptT | TirDataOptT;
|
|
@@ -12,7 +13,9 @@ export declare class TirLitUndefExpr implements ITirExpr {
|
|
|
12
13
|
constructor(
|
|
13
14
|
/** must be an optional */
|
|
14
15
|
type: TirSopOptT | TirDataOptT, range: SourceRange);
|
|
15
|
-
|
|
16
|
+
pretty(): string;
|
|
17
|
+
toString(): string;
|
|
18
|
+
clone(): TirExpr;
|
|
16
19
|
deps(): string[];
|
|
17
20
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
18
21
|
}
|
|
@@ -2,13 +2,16 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
2
2
|
import { IRTerm } from "../../../../IR/index.js";
|
|
3
3
|
import { TirType } from "../../types/TirType.js";
|
|
4
4
|
import { ITirExpr } from "../ITirExpr.js";
|
|
5
|
+
import { TirExpr } from "../TirExpr.js";
|
|
5
6
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
6
7
|
export declare class TirLitVoidExpr implements ITirExpr {
|
|
7
8
|
readonly range: SourceRange;
|
|
8
9
|
readonly type: TirType;
|
|
9
10
|
readonly isConstant: boolean;
|
|
10
11
|
constructor(range: SourceRange);
|
|
11
|
-
|
|
12
|
+
pretty(): string;
|
|
13
|
+
toString(): string;
|
|
14
|
+
clone(): TirExpr;
|
|
12
15
|
deps(): string[];
|
|
13
16
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
14
17
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TirLitArrExpr } from "./TirLitArrExpr.js";
|
|
2
|
+
import { TirLitFailExpr } from "./TirLitFailExpr.js";
|
|
2
3
|
import { TirLitFalseExpr } from "./TirLitFalseExpr.js";
|
|
3
4
|
import { TirLitHexBytesExpr } from "./TirLitHexBytesExpr.js";
|
|
4
5
|
import { TirLitIntExpr } from "./TirLitIntExpr.js";
|
|
@@ -9,5 +10,5 @@ import { TirLitThisExpr } from "./TirLitThisExpr.js";
|
|
|
9
10
|
import { TirLitTrueExpr } from "./TirLitTrueExpr.js";
|
|
10
11
|
import { TirLitUndefExpr } from "./TirLitUndefExpr.js";
|
|
11
12
|
import { TirLitVoidExpr } from "./TirLitVoidExpr.js";
|
|
12
|
-
export type TirLitteralExpr = TirLitVoidExpr | TirLitUndefExpr | TirLitTrueExpr | TirLitFalseExpr | TirLitStrExpr | TirLitIntExpr | TirLitHexBytesExpr | TirLitThisExpr | TirLitArrExpr | TirLitObjExpr | TirLitNamedObjExpr;
|
|
13
|
+
export type TirLitteralExpr = TirLitVoidExpr | TirLitUndefExpr | TirLitTrueExpr | TirLitFalseExpr | TirLitStrExpr | TirLitIntExpr | TirLitHexBytesExpr | TirLitThisExpr | TirLitArrExpr | TirLitObjExpr | TirLitNamedObjExpr | TirLitFailExpr;
|
|
13
14
|
export declare function isTirLitteralExpr(thing: any): thing is TirLitteralExpr;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TirLitArrExpr } from "./TirLitArrExpr.js";
|
|
2
|
+
import { TirLitFailExpr } from "./TirLitFailExpr.js";
|
|
2
3
|
import { TirLitFalseExpr } from "./TirLitFalseExpr.js";
|
|
3
4
|
import { TirLitHexBytesExpr } from "./TirLitHexBytesExpr.js";
|
|
4
5
|
import { TirLitIntExpr } from "./TirLitIntExpr.js";
|
|
@@ -20,5 +21,6 @@ export function isTirLitteralExpr(thing) {
|
|
|
20
21
|
|| thing instanceof TirLitNamedObjExpr
|
|
21
22
|
|| thing instanceof TirLitStrExpr
|
|
22
23
|
|| thing instanceof TirLitIntExpr
|
|
23
|
-
|| thing instanceof TirLitHexBytesExpr
|
|
24
|
+
|| thing instanceof TirLitHexBytesExpr
|
|
25
|
+
|| thing instanceof TirLitFailExpr);
|
|
24
26
|
}
|
|
@@ -3,14 +3,16 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
3
3
|
import { TirExpr } from "../TirExpr.js";
|
|
4
4
|
import { ITirUnaryExpression } from "./ITirUnaryExpression.js";
|
|
5
5
|
import { TirType } from "../../types/TirType.js";
|
|
6
|
-
import { IRTerm } from "../../../../IR/index.js";
|
|
7
6
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
7
|
+
import type { IRTerm } from "../../../../IR/IRTerm.js";
|
|
8
8
|
export declare class TirUnaryExclamation implements ITirExpr, ITirUnaryExpression {
|
|
9
9
|
operand: TirExpr;
|
|
10
10
|
readonly type: TirType;
|
|
11
11
|
readonly range: SourceRange;
|
|
12
12
|
constructor(operand: TirExpr, type: TirType, range: SourceRange);
|
|
13
|
-
|
|
13
|
+
toString(): string;
|
|
14
|
+
pretty(indent: number): string;
|
|
15
|
+
clone(): TirExpr;
|
|
14
16
|
deps(): string[];
|
|
15
17
|
get isConstant(): boolean;
|
|
16
18
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ir_apps } from "../../../../IR/IRNodes/IRApp.js";
|
|
2
|
+
import { IRNative } from "../../../../IR/IRNodes/IRNative/index.js";
|
|
3
3
|
export class TirUnaryExclamation {
|
|
4
4
|
operand;
|
|
5
5
|
type;
|
|
@@ -9,7 +9,12 @@ export class TirUnaryExclamation {
|
|
|
9
9
|
this.type = type;
|
|
10
10
|
this.range = range;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
toString() {
|
|
13
|
+
return `!${this.operand.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
pretty(indent) {
|
|
16
|
+
return `!${this.operand.pretty(indent)}`;
|
|
17
|
+
}
|
|
13
18
|
clone() {
|
|
14
19
|
return new TirUnaryExclamation(this.operand.clone(), this.type.clone(), this.range.clone());
|
|
15
20
|
}
|
|
@@ -4,13 +4,15 @@ import { TirExpr } from "../TirExpr.js";
|
|
|
4
4
|
import { ITirUnaryExpression } from "./ITirUnaryExpression.js";
|
|
5
5
|
import { TirType } from "../../types/TirType.js";
|
|
6
6
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
7
|
-
import { IRTerm } from "../../../../IR/
|
|
7
|
+
import type { IRTerm } from "../../../../IR/IRTerm.js";
|
|
8
8
|
export declare class TirUnaryMinus implements ITirExpr, ITirUnaryExpression {
|
|
9
9
|
operand: TirExpr;
|
|
10
10
|
readonly type: TirType;
|
|
11
11
|
readonly range: SourceRange;
|
|
12
12
|
constructor(operand: TirExpr, type: TirType, range: SourceRange);
|
|
13
|
-
|
|
13
|
+
toString(): string;
|
|
14
|
+
pretty(indent: number): string;
|
|
15
|
+
clone(): TirExpr;
|
|
14
16
|
deps(): string[];
|
|
15
17
|
get isConstant(): boolean;
|
|
16
18
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ir_apps } from "../../../../IR/IRNodes/IRApp.js";
|
|
2
|
+
import { IRNative } from "../../../../IR/IRNodes/IRNative/index.js";
|
|
3
3
|
export class TirUnaryMinus {
|
|
4
4
|
operand;
|
|
5
5
|
type;
|
|
@@ -9,6 +9,12 @@ export class TirUnaryMinus {
|
|
|
9
9
|
this.type = type;
|
|
10
10
|
this.range = range;
|
|
11
11
|
}
|
|
12
|
+
toString() {
|
|
13
|
+
return `-${this.operand.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
pretty(indent) {
|
|
16
|
+
return `-${this.operand.pretty(indent)}`;
|
|
17
|
+
}
|
|
12
18
|
clone() {
|
|
13
19
|
return new TirUnaryMinus(this.operand.clone(), this.type.clone(), this.range.clone());
|
|
14
20
|
}
|
|
@@ -8,7 +8,9 @@ export declare class TirUnaryPlus implements ITirExpr, ITirUnaryExpression {
|
|
|
8
8
|
readonly type: TirType;
|
|
9
9
|
readonly range: SourceRange;
|
|
10
10
|
constructor(operand: TirExpr, type: TirType, range: SourceRange);
|
|
11
|
-
|
|
11
|
+
toString(): string;
|
|
12
|
+
pretty(indent: number): string;
|
|
13
|
+
clone(): TirExpr;
|
|
12
14
|
deps(): string[];
|
|
13
15
|
get isConstant(): boolean;
|
|
14
16
|
toIR(ctx: any): any;
|
|
@@ -7,6 +7,12 @@ export class TirUnaryPlus {
|
|
|
7
7
|
this.type = type;
|
|
8
8
|
this.range = range;
|
|
9
9
|
}
|
|
10
|
+
toString() {
|
|
11
|
+
return `+${this.operand.toString()}`;
|
|
12
|
+
}
|
|
13
|
+
pretty(indent) {
|
|
14
|
+
return `+${this.operand.pretty(indent)}`;
|
|
15
|
+
}
|
|
10
16
|
clone() {
|
|
11
17
|
return new TirUnaryPlus(this.operand.clone(), this.type.clone(), this.range.clone());
|
|
12
18
|
}
|
|
@@ -3,14 +3,16 @@ import { SourceRange } from "../../../../ast/Source/SourceRange.js";
|
|
|
3
3
|
import { TirExpr } from "../TirExpr.js";
|
|
4
4
|
import { ITirUnaryExpression } from "./ITirUnaryExpression.js";
|
|
5
5
|
import { TirType } from "../../types/TirType.js";
|
|
6
|
-
import { IRTerm } from "../../../../IR/index.js";
|
|
7
6
|
import { ToIRTermCtx } from "../ToIRTermCtx.js";
|
|
7
|
+
import type { IRTerm } from "../../../../IR/IRTerm.js";
|
|
8
8
|
export declare class TirUnaryTilde implements ITirExpr, ITirUnaryExpression {
|
|
9
9
|
operand: TirExpr;
|
|
10
10
|
readonly type: TirType;
|
|
11
11
|
readonly range: SourceRange;
|
|
12
12
|
constructor(operand: TirExpr, type: TirType, range: SourceRange);
|
|
13
|
-
|
|
13
|
+
toString(): string;
|
|
14
|
+
pretty(indent: number): string;
|
|
15
|
+
clone(): TirExpr;
|
|
14
16
|
deps(): string[];
|
|
15
17
|
get isConstant(): boolean;
|
|
16
18
|
toIR(ctx: ToIRTermCtx): IRTerm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ir_apps } from "../../../../IR/
|
|
2
|
-
import { IRNative } from "../../../../IR/index.js";
|
|
1
|
+
import { _ir_apps } from "../../../../IR/IRNodes/IRApp.js";
|
|
2
|
+
import { IRNative } from "../../../../IR/IRNodes/IRNative/index.js";
|
|
3
3
|
export class TirUnaryTilde {
|
|
4
4
|
operand;
|
|
5
5
|
type;
|
|
@@ -9,6 +9,12 @@ export class TirUnaryTilde {
|
|
|
9
9
|
this.type = type;
|
|
10
10
|
this.range = range;
|
|
11
11
|
}
|
|
12
|
+
toString() {
|
|
13
|
+
return `~${this.operand.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
pretty(indent) {
|
|
16
|
+
return `~${this.operand.pretty(indent)}`;
|
|
17
|
+
}
|
|
12
18
|
clone() {
|
|
13
19
|
return new TirUnaryTilde(this.operand.clone(), this.type.clone(), this.range.clone());
|
|
14
20
|
}
|
|
@@ -32,6 +32,7 @@ export declare class TypedProgram extends DiagnosticEmitter {
|
|
|
32
32
|
readonly stdScope: AstScope;
|
|
33
33
|
readonly preludeScope: AstScope;
|
|
34
34
|
constructor(diagnostics?: DiagnosticMessage[]);
|
|
35
|
+
registerType(tirType: TirType): boolean;
|
|
35
36
|
getMainOrThrow(): TirFuncExpr;
|
|
36
37
|
getFilePrefix(path: string): string;
|
|
37
38
|
defineGenericType(tirKey: string, arity: number, mkApplied: (tyArgs: TirType[]) => TirType): boolean;
|
|
@@ -39,6 +39,15 @@ export class TypedProgram extends DiagnosticEmitter {
|
|
|
39
39
|
this.preludeScope = new AstScope(this.stdScope, this, { isFunctionDeclScope: false, isMethodScope: false });
|
|
40
40
|
populatePreludeScope(this);
|
|
41
41
|
}
|
|
42
|
+
registerType(tirType) {
|
|
43
|
+
if (!isTirType(tirType))
|
|
44
|
+
return false;
|
|
45
|
+
const tirTypeName = tirType.toConcreteTirTypeName();
|
|
46
|
+
if (this.types.has(tirTypeName))
|
|
47
|
+
return false;
|
|
48
|
+
this.types.set(tirTypeName, tirType);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
42
51
|
getMainOrThrow() {
|
|
43
52
|
if (this.contractTirFuncName === "")
|
|
44
53
|
throw new Error("TypedProgram: main function name not set");
|