ticbuild 1.0.21 → 1.0.23
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/README.md +1057 -199
- package/dist/backend/ImportedResourceTypes.d.ts +22 -10
- package/dist/backend/ImportedResourceTypes.d.ts.map +1 -1
- package/dist/backend/ImportedResourceTypes.js +42 -13
- package/dist/backend/ImportedResourceTypes.js.map +1 -1
- package/dist/backend/assembly.d.ts +11 -0
- package/dist/backend/assembly.d.ts.map +1 -0
- package/dist/backend/assembly.js +150 -0
- package/dist/backend/assembly.js.map +1 -0
- package/dist/backend/assetBanking.test.d.ts +2 -0
- package/dist/backend/assetBanking.test.d.ts.map +1 -0
- package/dist/backend/assetBanking.test.js +242 -0
- package/dist/backend/assetBanking.test.js.map +1 -0
- package/dist/backend/codeBanking.test.js +7 -5
- package/dist/backend/codeBanking.test.js.map +1 -1
- package/dist/backend/codeSnippetProcessor.d.ts +78 -0
- package/dist/backend/codeSnippetProcessor.d.ts.map +1 -0
- package/dist/backend/codeSnippetProcessor.js +241 -0
- package/dist/backend/codeSnippetProcessor.js.map +1 -0
- package/dist/backend/codeSnippetProcessor.test.d.ts +2 -0
- package/dist/backend/codeSnippetProcessor.test.d.ts.map +1 -0
- package/dist/backend/codeSnippetProcessor.test.js +221 -0
- package/dist/backend/codeSnippetProcessor.test.js.map +1 -0
- package/dist/backend/importReference.d.ts +4 -0
- package/dist/backend/importReference.d.ts.map +1 -0
- package/dist/backend/importReference.js +43 -0
- package/dist/backend/importReference.js.map +1 -0
- package/dist/backend/importResources.d.ts +3 -1
- package/dist/backend/importResources.d.ts.map +1 -1
- package/dist/backend/importResources.js +124 -36
- package/dist/backend/importResources.js.map +1 -1
- package/dist/backend/importResources.test.d.ts +2 -0
- package/dist/backend/importResources.test.d.ts.map +1 -0
- package/dist/backend/importResources.test.js +87 -0
- package/dist/backend/importResources.test.js.map +1 -0
- package/dist/backend/importSources.d.ts +51 -0
- package/dist/backend/importSources.d.ts.map +1 -0
- package/dist/backend/importSources.js +261 -0
- package/dist/backend/importSources.js.map +1 -0
- package/dist/backend/importSources.test.d.ts +2 -0
- package/dist/backend/importSources.test.d.ts.map +1 -0
- package/dist/backend/importSources.test.js +271 -0
- package/dist/backend/importSources.test.js.map +1 -0
- package/dist/backend/importUtils.d.ts +5 -10
- package/dist/backend/importUtils.d.ts.map +1 -1
- package/dist/backend/importUtils.js +13 -48
- package/dist/backend/importUtils.js.map +1 -1
- package/dist/backend/importers/CodeDeclarationAnalysis.d.ts +37 -0
- package/dist/backend/importers/CodeDeclarationAnalysis.d.ts.map +1 -0
- package/dist/backend/importers/CodeDeclarationAnalysis.js +288 -0
- package/dist/backend/importers/CodeDeclarationAnalysis.js.map +1 -0
- package/dist/backend/importers/CodeResource.d.ts +90 -0
- package/dist/backend/importers/CodeResource.d.ts.map +1 -0
- package/dist/backend/importers/CodeResource.js +480 -0
- package/dist/backend/importers/CodeResource.js.map +1 -0
- package/dist/backend/importers/CodeResource.test.d.ts +2 -0
- package/dist/backend/importers/CodeResource.test.d.ts.map +1 -0
- package/dist/backend/importers/CodeResource.test.js +106 -0
- package/dist/backend/importers/CodeResource.test.js.map +1 -0
- package/dist/backend/importers/LuaAssetTypeScriptModules.d.ts +38 -0
- package/dist/backend/importers/LuaAssetTypeScriptModules.d.ts.map +1 -0
- package/dist/backend/importers/LuaAssetTypeScriptModules.js +437 -0
- package/dist/backend/importers/LuaAssetTypeScriptModules.js.map +1 -0
- package/dist/backend/importers/LuaCodeImporter.d.ts +9 -49
- package/dist/backend/importers/LuaCodeImporter.d.ts.map +1 -1
- package/dist/backend/importers/LuaCodeImporter.js +28 -255
- package/dist/backend/importers/LuaCodeImporter.js.map +1 -1
- package/dist/backend/importers/LuaCodeImporter.test.js +89 -46
- package/dist/backend/importers/LuaCodeImporter.test.js.map +1 -1
- package/dist/backend/importers/LuaTypeCatalog.d.ts +26 -0
- package/dist/backend/importers/LuaTypeCatalog.d.ts.map +1 -0
- package/dist/backend/importers/LuaTypeCatalog.js +185 -0
- package/dist/backend/importers/LuaTypeCatalog.js.map +1 -0
- package/dist/backend/importers/ManifestCodeTypeScriptModules.d.ts +10 -0
- package/dist/backend/importers/ManifestCodeTypeScriptModules.d.ts.map +1 -0
- package/dist/backend/importers/ManifestCodeTypeScriptModules.js +31 -0
- package/dist/backend/importers/ManifestCodeTypeScriptModules.js.map +1 -0
- package/dist/backend/importers/TypeScriptBuildConstants.d.ts +6 -0
- package/dist/backend/importers/TypeScriptBuildConstants.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptBuildConstants.js +79 -0
- package/dist/backend/importers/TypeScriptBuildConstants.js.map +1 -0
- package/dist/backend/importers/TypeScriptCodeImporter.d.ts +26 -0
- package/dist/backend/importers/TypeScriptCodeImporter.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptCodeImporter.js +57 -0
- package/dist/backend/importers/TypeScriptCodeImporter.js.map +1 -0
- package/dist/backend/importers/TypeScriptCodeImporter.test.d.ts +2 -0
- package/dist/backend/importers/TypeScriptCodeImporter.test.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptCodeImporter.test.js +1795 -0
- package/dist/backend/importers/TypeScriptCodeImporter.test.js.map +1 -0
- package/dist/backend/importers/TypeScriptConstantPlugin.d.ts +8 -0
- package/dist/backend/importers/TypeScriptConstantPlugin.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptConstantPlugin.js +412 -0
- package/dist/backend/importers/TypeScriptConstantPlugin.js.map +1 -0
- package/dist/backend/importers/TypeScriptDeclarationSources.d.ts +19 -0
- package/dist/backend/importers/TypeScriptDeclarationSources.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptDeclarationSources.js +119 -0
- package/dist/backend/importers/TypeScriptDeclarationSources.js.map +1 -0
- package/dist/backend/importers/TypeScriptDeclarationSyntax.d.ts +8 -0
- package/dist/backend/importers/TypeScriptDeclarationSyntax.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptDeclarationSyntax.js +29 -0
- package/dist/backend/importers/TypeScriptDeclarationSyntax.js.map +1 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.d.ts +23 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.js +553 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.js.map +1 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.test.d.ts +2 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.test.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.test.js +29 -0
- package/dist/backend/importers/TypeScriptLuaDeclarations.test.js.map +1 -0
- package/dist/backend/importers/TypeScriptManifestModules.d.ts +36 -0
- package/dist/backend/importers/TypeScriptManifestModules.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptManifestModules.js +347 -0
- package/dist/backend/importers/TypeScriptManifestModules.js.map +1 -0
- package/dist/backend/importers/TypeScriptNamedTypes.d.ts +22 -0
- package/dist/backend/importers/TypeScriptNamedTypes.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptNamedTypes.js +193 -0
- package/dist/backend/importers/TypeScriptNamedTypes.js.map +1 -0
- package/dist/backend/importers/TypeScriptProgram.d.ts +24 -0
- package/dist/backend/importers/TypeScriptProgram.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptProgram.js +141 -0
- package/dist/backend/importers/TypeScriptProgram.js.map +1 -0
- package/dist/backend/importers/TypeScriptStaticLinker.d.ts +17 -0
- package/dist/backend/importers/TypeScriptStaticLinker.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptStaticLinker.js +702 -0
- package/dist/backend/importers/TypeScriptStaticLinker.js.map +1 -0
- package/dist/backend/importers/TypeScriptTranspilationOptions.d.ts +3 -0
- package/dist/backend/importers/TypeScriptTranspilationOptions.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptTranspilationOptions.js +82 -0
- package/dist/backend/importers/TypeScriptTranspilationOptions.js.map +1 -0
- package/dist/backend/importers/TypeScriptTranspiler.d.ts +13 -0
- package/dist/backend/importers/TypeScriptTranspiler.d.ts.map +1 -0
- package/dist/backend/importers/TypeScriptTranspiler.js +241 -0
- package/dist/backend/importers/TypeScriptTranspiler.js.map +1 -0
- package/dist/backend/importers/binaryResourceImporter.d.ts +5 -14
- package/dist/backend/importers/binaryResourceImporter.d.ts.map +1 -1
- package/dist/backend/importers/binaryResourceImporter.js +6 -34
- package/dist/backend/importers/binaryResourceImporter.js.map +1 -1
- package/dist/backend/importers/textResourceImporter.d.ts +5 -15
- package/dist/backend/importers/textResourceImporter.d.ts.map +1 -1
- package/dist/backend/importers/textResourceImporter.js +6 -36
- package/dist/backend/importers/textResourceImporter.js.map +1 -1
- package/dist/backend/importers/tic80CartImporter.d.ts +12 -15
- package/dist/backend/importers/tic80CartImporter.d.ts.map +1 -1
- package/dist/backend/importers/tic80CartImporter.js +49 -84
- package/dist/backend/importers/tic80CartImporter.js.map +1 -1
- package/dist/backend/importers/tsconfigUtils.d.ts +10 -0
- package/dist/backend/importers/tsconfigUtils.d.ts.map +1 -0
- package/dist/backend/importers/tsconfigUtils.js +152 -0
- package/dist/backend/importers/tsconfigUtils.js.map +1 -0
- package/dist/backend/luaEncode.d.ts +4 -4
- package/dist/backend/luaEncode.d.ts.map +1 -1
- package/dist/backend/luaEncode.js +39 -39
- package/dist/backend/luaEncode.js.map +1 -1
- package/dist/backend/luaEncode.test.js +68 -0
- package/dist/backend/luaEncode.test.js.map +1 -1
- package/dist/backend/luaPreprocessor.d.ts +18 -1
- package/dist/backend/luaPreprocessor.d.ts.map +1 -1
- package/dist/backend/luaPreprocessor.js +581 -232
- package/dist/backend/luaPreprocessor.js.map +1 -1
- package/dist/backend/luaPreprocessor.test.js +293 -12
- package/dist/backend/luaPreprocessor.test.js.map +1 -1
- package/dist/backend/luaPreprocessorSyntax.d.ts +25 -0
- package/dist/backend/luaPreprocessorSyntax.d.ts.map +1 -0
- package/dist/backend/luaPreprocessorSyntax.js +74 -0
- package/dist/backend/luaPreprocessorSyntax.js.map +1 -0
- package/dist/backend/luaPreprocessorSyntax.test.d.ts +2 -0
- package/dist/backend/luaPreprocessorSyntax.test.d.ts.map +1 -0
- package/dist/backend/luaPreprocessorSyntax.test.js +30 -0
- package/dist/backend/luaPreprocessorSyntax.test.js.map +1 -0
- package/dist/backend/manifestLoader.test.js +174 -1
- package/dist/backend/manifestLoader.test.js.map +1 -1
- package/dist/backend/manifestTypes.d.ts +127 -65
- package/dist/backend/manifestTypes.d.ts.map +1 -1
- package/dist/backend/manifestTypes.js +3 -0
- package/dist/backend/manifestTypes.js.map +1 -1
- package/dist/backend/preprocessorDefines.d.ts +4 -0
- package/dist/backend/preprocessorDefines.d.ts.map +1 -0
- package/dist/backend/preprocessorDefines.js +15 -0
- package/dist/backend/preprocessorDefines.js.map +1 -0
- package/dist/backend/project.d.ts +8 -2
- package/dist/backend/project.d.ts.map +1 -1
- package/dist/backend/project.js +159 -115
- package/dist/backend/project.js.map +1 -1
- package/dist/backend/project.test.d.ts +2 -0
- package/dist/backend/project.test.d.ts.map +1 -0
- package/dist/backend/project.test.js +196 -0
- package/dist/backend/project.test.js.map +1 -0
- package/dist/backend/projectCore.d.ts +6 -4
- package/dist/backend/projectCore.d.ts.map +1 -1
- package/dist/backend/projectCore.js +36 -44
- package/dist/backend/projectCore.js.map +1 -1
- package/dist/backend/projectCore.test.d.ts +2 -0
- package/dist/backend/projectCore.test.d.ts.map +1 -0
- package/dist/backend/projectCore.test.js +12 -0
- package/dist/backend/projectCore.test.js.map +1 -0
- package/dist/backend/projectEnvironment.d.ts +8 -0
- package/dist/backend/projectEnvironment.d.ts.map +1 -0
- package/dist/backend/projectEnvironment.js +70 -0
- package/dist/backend/projectEnvironment.js.map +1 -0
- package/dist/backend/projectEnvironment.test.d.ts +2 -0
- package/dist/backend/projectEnvironment.test.d.ts.map +1 -0
- package/dist/backend/projectEnvironment.test.js +90 -0
- package/dist/backend/projectEnvironment.test.js.map +1 -0
- package/dist/backend/projectFiles.d.ts +32 -0
- package/dist/backend/projectFiles.d.ts.map +1 -0
- package/dist/backend/projectFiles.js +148 -0
- package/dist/backend/projectFiles.js.map +1 -0
- package/dist/backend/projectFiles.test.d.ts +2 -0
- package/dist/backend/projectFiles.test.d.ts.map +1 -0
- package/dist/backend/projectFiles.test.js +136 -0
- package/dist/backend/projectFiles.test.js.map +1 -0
- package/dist/backend/sourceMap.d.ts +40 -3
- package/dist/backend/sourceMap.d.ts.map +1 -1
- package/dist/backend/sourceMap.js +333 -64
- package/dist/backend/sourceMap.js.map +1 -1
- package/dist/backend/sourceMap.test.js +81 -0
- package/dist/backend/sourceMap.test.js.map +1 -1
- package/dist/backend/sourceMapLookup.d.ts +36 -0
- package/dist/backend/sourceMapLookup.d.ts.map +1 -0
- package/dist/backend/sourceMapLookup.js +170 -0
- package/dist/backend/sourceMapLookup.js.map +1 -0
- package/dist/backend/sourceMapLookup.test.d.ts +2 -0
- package/dist/backend/sourceMapLookup.test.d.ts.map +1 -0
- package/dist/backend/sourceMapLookup.test.js +132 -0
- package/dist/backend/sourceMapLookup.test.js.map +1 -0
- package/dist/backend/sourceMapV3.d.ts +8 -0
- package/dist/backend/sourceMapV3.d.ts.map +1 -0
- package/dist/backend/sourceMapV3.js +212 -0
- package/dist/backend/sourceMapV3.js.map +1 -0
- package/dist/backend/sourceMapV3.test.d.ts +2 -0
- package/dist/backend/sourceMapV3.test.d.ts.map +1 -0
- package/dist/backend/sourceMapV3.test.js +109 -0
- package/dist/backend/sourceMapV3.test.js.map +1 -0
- package/dist/backend/symbolIndex.d.ts +2 -12
- package/dist/backend/symbolIndex.d.ts.map +1 -1
- package/dist/backend/symbolIndex.js +18 -107
- package/dist/backend/symbolIndex.js.map +1 -1
- package/dist/backend/symbolIndex.test.js +6 -1
- package/dist/backend/symbolIndex.test.js.map +1 -1
- package/dist/backend/tic80Controller/customController.d.ts +7 -1
- package/dist/backend/tic80Controller/customController.d.ts.map +1 -1
- package/dist/backend/tic80Controller/customController.js +25 -11
- package/dist/backend/tic80Controller/customController.js.map +1 -1
- package/dist/backend/tic80Controller/customController.test.js +17 -4
- package/dist/backend/tic80Controller/customController.test.js.map +1 -1
- package/dist/backend/tic80Controller/remotingClient.d.ts.map +1 -1
- package/dist/backend/tic80Controller/remotingClient.js +2 -1
- package/dist/backend/tic80Controller/remotingClient.js.map +1 -1
- package/dist/backend/tic80Controller/remotingProtocol.d.ts +2 -0
- package/dist/backend/tic80Controller/remotingProtocol.d.ts.map +1 -1
- package/dist/backend/tic80Controller/remotingProtocol.js +19 -0
- package/dist/backend/tic80Controller/remotingProtocol.js.map +1 -1
- package/dist/backend/tic80Controller/remotingProtocol.test.js +16 -0
- package/dist/backend/tic80Controller/remotingProtocol.test.js.map +1 -1
- package/dist/backend/tic80Controller/scriptErrorProtocol.d.ts +41 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.d.ts.map +1 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.js +98 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.js.map +1 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.test.d.ts +2 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.test.d.ts.map +1 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.test.js +78 -0
- package/dist/backend/tic80Controller/scriptErrorProtocol.test.js.map +1 -0
- package/dist/backend/tic80Controller/tic80Controller.d.ts +7 -0
- package/dist/backend/tic80Controller/tic80Controller.d.ts.map +1 -1
- package/dist/backend/tic80Controller/vanillaController.d.ts +3 -5
- package/dist/backend/tic80Controller/vanillaController.d.ts.map +1 -1
- package/dist/backend/tic80Controller/vanillaController.js +19 -18
- package/dist/backend/tic80Controller/vanillaController.js.map +1 -1
- package/dist/backend/tic80Controller/vanillaController.test.d.ts +2 -0
- package/dist/backend/tic80Controller/vanillaController.test.d.ts.map +1 -0
- package/dist/backend/tic80Controller/vanillaController.test.js +36 -0
- package/dist/backend/tic80Controller/vanillaController.test.js.map +1 -0
- package/dist/backend/tic80Resolver.d.ts +2 -0
- package/dist/backend/tic80Resolver.d.ts.map +1 -1
- package/dist/backend/tic80Resolver.js +15 -47
- package/dist/backend/tic80Resolver.js.map +1 -1
- package/dist/backend/tic80Resolver.test.d.ts +2 -0
- package/dist/backend/tic80Resolver.test.d.ts.map +1 -0
- package/dist/backend/tic80Resolver.test.js +34 -0
- package/dist/backend/tic80Resolver.test.js.map +1 -0
- package/dist/benchmarks/luaMinifiers.d.ts +50 -0
- package/dist/benchmarks/luaMinifiers.d.ts.map +1 -0
- package/dist/benchmarks/luaMinifiers.js +219 -0
- package/dist/benchmarks/luaMinifiers.js.map +1 -0
- package/dist/benchmarks/luaMinifiers.test.d.ts +2 -0
- package/dist/benchmarks/luaMinifiers.test.d.ts.map +1 -0
- package/dist/benchmarks/luaMinifiers.test.js +68 -0
- package/dist/benchmarks/luaMinifiers.test.js.map +1 -0
- package/dist/buildInfo.d.ts +8 -5
- package/dist/buildInfo.d.ts.map +1 -1
- package/dist/buildInfo.js +8 -5
- package/dist/buildInfo.js.map +1 -1
- package/dist/frontend/build.d.ts.map +1 -1
- package/dist/frontend/build.js +3 -5
- package/dist/frontend/build.js.map +1 -1
- package/dist/frontend/buildReporter.d.ts +10 -2
- package/dist/frontend/buildReporter.d.ts.map +1 -1
- package/dist/frontend/buildReporter.js +4 -1
- package/dist/frontend/buildReporter.js.map +1 -1
- package/dist/frontend/buildReporter.test.js +51 -2
- package/dist/frontend/buildReporter.test.js.map +1 -1
- package/dist/frontend/cartUsage.d.ts +20 -0
- package/dist/frontend/cartUsage.d.ts.map +1 -0
- package/dist/frontend/cartUsage.js +103 -0
- package/dist/frontend/cartUsage.js.map +1 -0
- package/dist/frontend/codeBankPlacement.test.d.ts +2 -0
- package/dist/frontend/codeBankPlacement.test.d.ts.map +1 -0
- package/dist/frontend/codeBankPlacement.test.js +89 -0
- package/dist/frontend/codeBankPlacement.test.js.map +1 -0
- package/dist/frontend/codeBankWarnings.test.js +1 -0
- package/dist/frontend/codeBankWarnings.test.js.map +1 -1
- package/dist/frontend/core.d.ts +7 -2
- package/dist/frontend/core.d.ts.map +1 -1
- package/dist/frontend/core.js +301 -300
- package/dist/frontend/core.js.map +1 -1
- package/dist/frontend/init.d.ts +1 -0
- package/dist/frontend/init.d.ts.map +1 -1
- package/dist/frontend/init.js +34 -11
- package/dist/frontend/init.js.map +1 -1
- package/dist/frontend/init.test.d.ts +2 -0
- package/dist/frontend/init.test.d.ts.map +1 -0
- package/dist/frontend/init.test.js +190 -0
- package/dist/frontend/init.test.js.map +1 -0
- package/dist/frontend/inspect.d.ts +2 -0
- package/dist/frontend/inspect.d.ts.map +1 -0
- package/dist/frontend/inspect.js +62 -0
- package/dist/frontend/inspect.js.map +1 -0
- package/dist/frontend/inspect.test.d.ts +2 -0
- package/dist/frontend/inspect.test.d.ts.map +1 -0
- package/dist/frontend/inspect.test.js +126 -0
- package/dist/frontend/inspect.test.js.map +1 -0
- package/dist/frontend/luaCodeArtifacts.test.js +39 -1
- package/dist/frontend/luaCodeArtifacts.test.js.map +1 -1
- package/dist/frontend/packageInstaller.d.ts +2 -0
- package/dist/frontend/packageInstaller.d.ts.map +1 -0
- package/dist/frontend/packageInstaller.js +59 -0
- package/dist/frontend/packageInstaller.js.map +1 -0
- package/dist/frontend/parseOptions.d.ts +4 -1
- package/dist/frontend/parseOptions.d.ts.map +1 -1
- package/dist/frontend/parseOptions.js +13 -8
- package/dist/frontend/parseOptions.js.map +1 -1
- package/dist/frontend/parseOptions.test.d.ts +2 -0
- package/dist/frontend/parseOptions.test.d.ts.map +1 -0
- package/dist/frontend/parseOptions.test.js +65 -0
- package/dist/frontend/parseOptions.test.js.map +1 -0
- package/dist/frontend/projectFiles.d.ts +4 -0
- package/dist/frontend/projectFiles.d.ts.map +1 -0
- package/dist/frontend/projectFiles.js +95 -0
- package/dist/frontend/projectFiles.js.map +1 -0
- package/dist/frontend/projectFiles.test.d.ts +2 -0
- package/dist/frontend/projectFiles.test.d.ts.map +1 -0
- package/dist/frontend/projectFiles.test.js +106 -0
- package/dist/frontend/projectFiles.test.js.map +1 -0
- package/dist/frontend/run.d.ts.map +1 -1
- package/dist/frontend/run.js +3 -1
- package/dist/frontend/run.js.map +1 -1
- package/dist/frontend/scriptErrorPresentation.d.ts +9 -0
- package/dist/frontend/scriptErrorPresentation.d.ts.map +1 -0
- package/dist/frontend/scriptErrorPresentation.js +76 -0
- package/dist/frontend/scriptErrorPresentation.js.map +1 -0
- package/dist/frontend/scriptErrorPresentation.test.d.ts +2 -0
- package/dist/frontend/scriptErrorPresentation.test.d.ts.map +1 -0
- package/dist/frontend/scriptErrorPresentation.test.js +137 -0
- package/dist/frontend/scriptErrorPresentation.test.js.map +1 -0
- package/dist/frontend/scriptErrorSourceMapper.d.ts +15 -0
- package/dist/frontend/scriptErrorSourceMapper.d.ts.map +1 -0
- package/dist/frontend/scriptErrorSourceMapper.js +177 -0
- package/dist/frontend/scriptErrorSourceMapper.js.map +1 -0
- package/dist/frontend/scriptErrorSourceMapper.test.d.ts +2 -0
- package/dist/frontend/scriptErrorSourceMapper.test.d.ts.map +1 -0
- package/dist/frontend/scriptErrorSourceMapper.test.js +189 -0
- package/dist/frontend/scriptErrorSourceMapper.test.js.map +1 -0
- package/dist/frontend/terminal.d.ts +28 -2
- package/dist/frontend/terminal.d.ts.map +1 -1
- package/dist/frontend/terminal.js +465 -25
- package/dist/frontend/terminal.js.map +1 -1
- package/dist/frontend/terminal.test.js +563 -0
- package/dist/frontend/terminal.test.js.map +1 -1
- package/dist/frontend/typescriptExample.test.d.ts +2 -0
- package/dist/frontend/typescriptExample.test.d.ts.map +1 -0
- package/dist/frontend/typescriptExample.test.js +92 -0
- package/dist/frontend/typescriptExample.test.js.map +1 -0
- package/dist/frontend/watch.d.ts.map +1 -1
- package/dist/frontend/watch.js +160 -39
- package/dist/frontend/watch.js.map +1 -1
- package/dist/frontend/watch.test.js +3 -1
- package/dist/frontend/watch.test.js.map +1 -1
- package/dist/index.js +61 -20
- package/dist/index.js.map +1 -1
- package/dist/obj/build.jsonl +5 -0
- package/dist/obj/build.log +11 -5
- package/dist/obj/build.trace.json +89 -0
- package/dist/obj/resolvedManifest.ticbuild.jsonc +4 -3
- package/dist/obj/variables.json +2 -2
- package/dist/projectFileInventory.d.ts +40 -0
- package/dist/projectFileInventory.d.ts.map +1 -0
- package/dist/projectFileInventory.js +36 -0
- package/dist/projectFileInventory.js.map +1 -0
- package/dist/utils/console.d.ts +1 -1
- package/dist/utils/console.d.ts.map +1 -1
- package/dist/utils/console.js +1 -1
- package/dist/utils/console.js.map +1 -1
- package/dist/utils/encoding/base64.d.ts +3 -0
- package/dist/utils/encoding/base64.d.ts.map +1 -0
- package/dist/utils/encoding/base64.js +51 -0
- package/dist/utils/encoding/base64.js.map +1 -0
- package/dist/utils/encoding/codecRegistry.d.ts +69 -12
- package/dist/utils/encoding/codecRegistry.d.ts.map +1 -1
- package/dist/utils/encoding/codecRegistry.js +6 -0
- package/dist/utils/encoding/codecRegistry.js.map +1 -1
- package/dist/utils/encoding/hex.d.ts.map +1 -1
- package/dist/utils/encoding/hex.js +3 -0
- package/dist/utils/encoding/hex.js.map +1 -1
- package/dist/utils/encoding/lz.d.ts +25 -5
- package/dist/utils/encoding/lz.d.ts.map +1 -1
- package/dist/utils/encoding/lz.js +160 -48
- package/dist/utils/encoding/lz.js.map +1 -1
- package/dist/utils/encoding/lz.test.d.ts +2 -0
- package/dist/utils/encoding/lz.test.d.ts.map +1 -0
- package/dist/utils/encoding/lz.test.js +95 -0
- package/dist/utils/encoding/lz.test.js.map +1 -0
- package/dist/utils/encoding/payloadOutput.d.ts +4 -0
- package/dist/utils/encoding/payloadOutput.d.ts.map +1 -0
- package/dist/utils/encoding/payloadOutput.js +12 -0
- package/dist/utils/encoding/payloadOutput.js.map +1 -0
- package/dist/utils/encoding/payloadOutput.test.d.ts +2 -0
- package/dist/utils/encoding/payloadOutput.test.d.ts.map +1 -0
- package/dist/utils/encoding/payloadOutput.test.js +21 -0
- package/dist/utils/encoding/payloadOutput.test.js.map +1 -0
- package/dist/utils/encoding/payloadTextEncoding.d.ts +6 -0
- package/dist/utils/encoding/payloadTextEncoding.d.ts.map +1 -0
- package/dist/utils/encoding/payloadTextEncoding.js +39 -0
- package/dist/utils/encoding/payloadTextEncoding.js.map +1 -0
- package/dist/utils/encoding/payloadTextEncoding.test.d.ts +2 -0
- package/dist/utils/encoding/payloadTextEncoding.test.d.ts.map +1 -0
- package/dist/utils/encoding/payloadTextEncoding.test.js +31 -0
- package/dist/utils/encoding/payloadTextEncoding.test.js.map +1 -0
- package/dist/utils/errorHandling.d.ts +1 -0
- package/dist/utils/errorHandling.d.ts.map +1 -1
- package/dist/utils/errorHandling.js +4 -0
- package/dist/utils/errorHandling.js.map +1 -1
- package/dist/utils/errorHandling.test.d.ts +2 -0
- package/dist/utils/errorHandling.test.d.ts.map +1 -0
- package/dist/utils/errorHandling.test.js +17 -0
- package/dist/utils/errorHandling.test.js.map +1 -0
- package/dist/utils/fileSystem.d.ts +3 -1
- package/dist/utils/fileSystem.d.ts.map +1 -1
- package/dist/utils/fileSystem.js +16 -16
- package/dist/utils/fileSystem.js.map +1 -1
- package/dist/utils/help.d.ts +2 -1
- package/dist/utils/help.d.ts.map +1 -1
- package/dist/utils/help.js +8 -3
- package/dist/utils/help.js.map +1 -1
- package/dist/utils/lua/LuaCATS.d.ts +31 -0
- package/dist/utils/lua/LuaCATS.d.ts.map +1 -0
- package/dist/utils/lua/LuaCATS.js +159 -0
- package/dist/utils/lua/LuaCATS.js.map +1 -0
- package/dist/utils/lua/LuaCATS_declarations.d.ts +22 -0
- package/dist/utils/lua/LuaCATS_declarations.d.ts.map +1 -0
- package/dist/utils/lua/LuaCATS_declarations.js +107 -0
- package/dist/utils/lua/LuaCATS_declarations.js.map +1 -0
- package/dist/utils/lua/LuaCATS_declarations.test.d.ts +2 -0
- package/dist/utils/lua/LuaCATS_declarations.test.d.ts.map +1 -0
- package/dist/utils/lua/LuaCATS_declarations.test.js +38 -0
- package/dist/utils/lua/LuaCATS_declarations.test.js.map +1 -0
- package/dist/utils/lua/LuaCATS_types.d.ts +52 -0
- package/dist/utils/lua/LuaCATS_types.d.ts.map +1 -0
- package/dist/utils/lua/LuaCATS_types.js +202 -0
- package/dist/utils/lua/LuaCATS_types.js.map +1 -0
- package/dist/utils/lua/LuaCATS_types.test.d.ts +2 -0
- package/dist/utils/lua/LuaCATS_types.test.d.ts.map +1 -0
- package/dist/utils/lua/LuaCATS_types.test.js +38 -0
- package/dist/utils/lua/LuaCATS_types.test.js.map +1 -0
- package/dist/utils/lua/lua_alias_expressions.d.ts +2 -0
- package/dist/utils/lua/lua_alias_expressions.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_expressions.js +12 -1
- package/dist/utils/lua/lua_alias_expressions.js.map +1 -1
- package/dist/utils/lua/lua_alias_literals.d.ts +2 -0
- package/dist/utils/lua/lua_alias_literals.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_literals.js +12 -1
- package/dist/utils/lua/lua_alias_literals.js.map +1 -1
- package/dist/utils/lua/lua_alias_shared.d.ts +0 -1
- package/dist/utils/lua/lua_alias_shared.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_shared.js +60 -56
- package/dist/utils/lua/lua_alias_shared.js.map +1 -1
- package/dist/utils/lua/lua_ast.d.ts +0 -1
- package/dist/utils/lua/lua_ast.d.ts.map +1 -1
- package/dist/utils/lua/lua_ast.js +0 -6
- package/dist/utils/lua/lua_ast.js.map +1 -1
- package/dist/utils/lua/lua_ast_printer.d.ts +55 -0
- package/dist/utils/lua/lua_ast_printer.d.ts.map +1 -0
- package/dist/utils/lua/lua_ast_printer.js +1043 -0
- package/dist/utils/lua/lua_ast_printer.js.map +1 -0
- package/dist/utils/lua/lua_ast_provenance.d.ts +13 -0
- package/dist/utils/lua/lua_ast_provenance.d.ts.map +1 -0
- package/dist/utils/lua/lua_ast_provenance.js +67 -0
- package/dist/utils/lua/lua_ast_provenance.js.map +1 -0
- package/dist/utils/lua/lua_ast_rewrite.d.ts +20 -0
- package/dist/utils/lua/lua_ast_rewrite.d.ts.map +1 -0
- package/dist/utils/lua/lua_ast_rewrite.js +198 -0
- package/dist/utils/lua/lua_ast_rewrite.js.map +1 -0
- package/dist/utils/lua/lua_binding_optimizations.test.d.ts +2 -0
- package/dist/utils/lua/lua_binding_optimizations.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_binding_optimizations.test.js +247 -0
- package/dist/utils/lua/lua_binding_optimizations.test.js.map +1 -0
- package/dist/utils/lua/lua_canonicalization_rules.test.d.ts +2 -0
- package/dist/utils/lua/lua_canonicalization_rules.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_canonicalization_rules.test.js +194 -0
- package/dist/utils/lua/lua_canonicalization_rules.test.js.map +1 -0
- package/dist/utils/lua/lua_constant_literals.d.ts +7 -0
- package/dist/utils/lua/lua_constant_literals.d.ts.map +1 -0
- package/dist/utils/lua/lua_constant_literals.js +39 -0
- package/dist/utils/lua/lua_constant_literals.js.map +1 -0
- package/dist/utils/lua/lua_control_flow_invert_negated_if.d.ts +3 -0
- package/dist/utils/lua/lua_control_flow_invert_negated_if.d.ts.map +1 -0
- package/dist/utils/lua/lua_control_flow_invert_negated_if.js +37 -0
- package/dist/utils/lua/lua_control_flow_invert_negated_if.js.map +1 -0
- package/dist/utils/lua/lua_control_flow_remove_false_while.d.ts +3 -0
- package/dist/utils/lua/lua_control_flow_remove_false_while.d.ts.map +1 -0
- package/dist/utils/lua/lua_control_flow_remove_false_while.js +26 -0
- package/dist/utils/lua/lua_control_flow_remove_false_while.js.map +1 -0
- package/dist/utils/lua/lua_control_flow_resolve_constant_if.d.ts +3 -0
- package/dist/utils/lua/lua_control_flow_resolve_constant_if.d.ts.map +1 -0
- package/dist/utils/lua/lua_control_flow_resolve_constant_if.js +83 -0
- package/dist/utils/lua/lua_control_flow_resolve_constant_if.js.map +1 -0
- package/dist/utils/lua/lua_debug.d.ts +16 -0
- package/dist/utils/lua/lua_debug.d.ts.map +1 -0
- package/dist/utils/lua/lua_debug.js +42 -0
- package/dist/utils/lua/lua_debug.js.map +1 -0
- package/dist/utils/lua/lua_debug.test.d.ts +2 -0
- package/dist/utils/lua/lua_debug.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_debug.test.js +24 -0
- package/dist/utils/lua/lua_debug.test.js.map +1 -0
- package/dist/utils/lua/lua_doc.d.ts +15 -0
- package/dist/utils/lua/lua_doc.d.ts.map +1 -1
- package/dist/utils/lua/lua_doc.js +96 -0
- package/dist/utils/lua/lua_doc.js.map +1 -1
- package/dist/utils/lua/lua_doc_types.d.ts +36 -0
- package/dist/utils/lua/lua_doc_types.d.ts.map +1 -0
- package/dist/utils/lua/lua_doc_types.js +122 -0
- package/dist/utils/lua/lua_doc_types.js.map +1 -0
- package/dist/utils/lua/lua_doc_types.test.d.ts +2 -0
- package/dist/utils/lua/lua_doc_types.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_doc_types.test.js +33 -0
- package/dist/utils/lua/lua_doc_types.test.js.map +1 -0
- package/dist/utils/lua/lua_expression_effects.d.ts +3 -0
- package/dist/utils/lua/lua_expression_effects.d.ts.map +1 -0
- package/dist/utils/lua/lua_expression_effects.js +33 -0
- package/dist/utils/lua/lua_expression_effects.js.map +1 -0
- package/dist/utils/lua/lua_fundamentals.d.ts +4 -0
- package/dist/utils/lua/lua_fundamentals.d.ts.map +1 -1
- package/dist/utils/lua/lua_fundamentals.js +35 -3
- package/dist/utils/lua/lua_fundamentals.js.map +1 -1
- package/dist/utils/lua/lua_inline_immutable_aliases.d.ts +3 -0
- package/dist/utils/lua/lua_inline_immutable_aliases.d.ts.map +1 -0
- package/dist/utils/lua/lua_inline_immutable_aliases.js +124 -0
- package/dist/utils/lua/lua_inline_immutable_aliases.js.map +1 -0
- package/dist/utils/lua/lua_inline_immutable_scalars.d.ts +3 -0
- package/dist/utils/lua/lua_inline_immutable_scalars.d.ts.map +1 -0
- package/dist/utils/lua/lua_inline_immutable_scalars.js +230 -0
- package/dist/utils/lua/lua_inline_immutable_scalars.js.map +1 -0
- package/dist/utils/lua/lua_inline_single_use_expressions.d.ts +3 -0
- package/dist/utils/lua/lua_inline_single_use_expressions.d.ts.map +1 -0
- package/dist/utils/lua/lua_inline_single_use_expressions.js +105 -0
- package/dist/utils/lua/lua_inline_single_use_expressions.js.map +1 -0
- package/dist/utils/lua/lua_lexical_bindings.d.ts +25 -0
- package/dist/utils/lua/lua_lexical_bindings.d.ts.map +1 -0
- package/dist/utils/lua/lua_lexical_bindings.js +233 -0
- package/dist/utils/lua/lua_lexical_bindings.js.map +1 -0
- package/dist/utils/lua/lua_local_budget.test.js +12 -1
- package/dist/utils/lua/lua_local_budget.test.js.map +1 -1
- package/dist/utils/lua/lua_optimizer.d.ts +10 -0
- package/dist/utils/lua/lua_optimizer.d.ts.map +1 -0
- package/dist/utils/lua/lua_optimizer.js +128 -0
- package/dist/utils/lua/lua_optimizer.js.map +1 -0
- package/dist/utils/lua/lua_optimizer.test.d.ts +2 -0
- package/dist/utils/lua/lua_optimizer.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_optimizer.test.js +262 -0
- package/dist/utils/lua/lua_optimizer.test.js.map +1 -0
- package/dist/utils/lua/lua_optimizer_fingerprint.d.ts +3 -0
- package/dist/utils/lua/lua_optimizer_fingerprint.d.ts.map +1 -0
- package/dist/utils/lua/lua_optimizer_fingerprint.js +50 -0
- package/dist/utils/lua/lua_optimizer_fingerprint.js.map +1 -0
- package/dist/utils/lua/lua_optimizer_rules.d.ts +3 -0
- package/dist/utils/lua/lua_optimizer_rules.d.ts.map +1 -0
- package/dist/utils/lua/lua_optimizer_rules.js +57 -0
- package/dist/utils/lua/lua_optimizer_rules.js.map +1 -0
- package/dist/utils/lua/lua_optimizer_types.d.ts +55 -0
- package/dist/utils/lua/lua_optimizer_types.d.ts.map +1 -0
- package/dist/utils/lua/lua_optimizer_types.js +31 -0
- package/dist/utils/lua/lua_optimizer_types.js.map +1 -0
- package/dist/utils/lua/lua_pack_locals.d.ts +2 -0
- package/dist/utils/lua/lua_pack_locals.d.ts.map +1 -1
- package/dist/utils/lua/lua_pack_locals.js +58 -14
- package/dist/utils/lua/lua_pack_locals.js.map +1 -1
- package/dist/utils/lua/lua_print_trace.d.ts +4 -0
- package/dist/utils/lua/lua_print_trace.d.ts.map +1 -0
- package/dist/utils/lua/lua_print_trace.js +166 -0
- package/dist/utils/lua/lua_print_trace.js.map +1 -0
- package/dist/utils/lua/lua_printer.d.ts +11 -0
- package/dist/utils/lua/lua_printer.d.ts.map +1 -0
- package/dist/utils/lua/lua_printer.js +105 -0
- package/dist/utils/lua/lua_printer.js.map +1 -0
- package/dist/utils/lua/lua_printer_lexemes.d.ts +22 -0
- package/dist/utils/lua/lua_printer_lexemes.d.ts.map +1 -0
- package/dist/utils/lua/lua_printer_lexemes.js +111 -0
- package/dist/utils/lua/lua_printer_lexemes.js.map +1 -0
- package/dist/utils/lua/lua_printer_tight2.d.ts +2 -0
- package/dist/utils/lua/lua_printer_tight2.d.ts.map +1 -0
- package/dist/utils/lua/lua_printer_tight2.js +64 -0
- package/dist/utils/lua/lua_printer_tight2.js.map +1 -0
- package/dist/utils/lua/lua_printer_traceable.d.ts +2 -0
- package/dist/utils/lua/lua_printer_traceable.d.ts.map +1 -0
- package/dist/utils/lua/lua_printer_traceable.js +107 -0
- package/dist/utils/lua/lua_printer_traceable.js.map +1 -0
- package/dist/utils/lua/lua_printer_types.d.ts +7 -0
- package/dist/utils/lua/lua_printer_types.d.ts.map +1 -0
- package/dist/utils/lua/lua_printer_types.js +3 -0
- package/dist/utils/lua/lua_printer_types.js.map +1 -0
- package/dist/utils/lua/lua_processor.d.ts +15 -72
- package/dist/utils/lua/lua_processor.d.ts.map +1 -1
- package/dist/utils/lua/lua_processor.js +177 -1205
- package/dist/utils/lua/lua_processor.js.map +1 -1
- package/dist/utils/lua/lua_processor.test.js +450 -101
- package/dist/utils/lua/lua_processor.test.js.map +1 -1
- package/dist/utils/lua/lua_remove_dead_stores.d.ts +3 -0
- package/dist/utils/lua/lua_remove_dead_stores.d.ts.map +1 -0
- package/dist/utils/lua/lua_remove_dead_stores.js +108 -0
- package/dist/utils/lua/lua_remove_dead_stores.js.map +1 -0
- package/dist/utils/lua/lua_remove_self_assignments.d.ts +3 -0
- package/dist/utils/lua/lua_remove_self_assignments.d.ts.map +1 -0
- package/dist/utils/lua/lua_remove_self_assignments.js +40 -0
- package/dist/utils/lua/lua_remove_self_assignments.js.map +1 -0
- package/dist/utils/lua/lua_remove_unused_for_variables.d.ts +3 -0
- package/dist/utils/lua/lua_remove_unused_for_variables.d.ts.map +1 -0
- package/dist/utils/lua/lua_remove_unused_for_variables.js +40 -0
- package/dist/utils/lua/lua_remove_unused_for_variables.js.map +1 -0
- package/dist/utils/lua/lua_remove_unused_functions.d.ts +2 -0
- package/dist/utils/lua/lua_remove_unused_functions.d.ts.map +1 -1
- package/dist/utils/lua/lua_remove_unused_functions.js +29 -6
- package/dist/utils/lua/lua_remove_unused_functions.js.map +1 -1
- package/dist/utils/lua/lua_remove_unused_locals.d.ts +2 -0
- package/dist/utils/lua/lua_remove_unused_locals.d.ts.map +1 -1
- package/dist/utils/lua/lua_remove_unused_locals.js +72 -289
- package/dist/utils/lua/lua_remove_unused_locals.js.map +1 -1
- package/dist/utils/lua/lua_remove_unused_parameters.d.ts +3 -0
- package/dist/utils/lua/lua_remove_unused_parameters.d.ts.map +1 -0
- package/dist/utils/lua/lua_remove_unused_parameters.js +124 -0
- package/dist/utils/lua/lua_remove_unused_parameters.js.map +1 -0
- package/dist/utils/lua/lua_rename_allowed_globals.d.ts +3 -0
- package/dist/utils/lua/lua_rename_allowed_globals.d.ts.map +1 -1
- package/dist/utils/lua/lua_rename_allowed_globals.js +78 -41
- package/dist/utils/lua/lua_rename_allowed_globals.js.map +1 -1
- package/dist/utils/lua/lua_rename_allowed_table_keys.d.ts +2 -0
- package/dist/utils/lua/lua_rename_allowed_table_keys.d.ts.map +1 -1
- package/dist/utils/lua/lua_rename_allowed_table_keys.js +57 -20
- package/dist/utils/lua/lua_rename_allowed_table_keys.js.map +1 -1
- package/dist/utils/lua/lua_rename_table_fields.d.ts +2 -0
- package/dist/utils/lua/lua_rename_table_fields.d.ts.map +1 -1
- package/dist/utils/lua/lua_rename_table_fields.js +15 -2
- package/dist/utils/lua/lua_rename_table_fields.js.map +1 -1
- package/dist/utils/lua/lua_renamer.d.ts +2 -0
- package/dist/utils/lua/lua_renamer.d.ts.map +1 -1
- package/dist/utils/lua/lua_renamer.js +146 -157
- package/dist/utils/lua/lua_renamer.js.map +1 -1
- package/dist/utils/lua/lua_scalar_simplification.test.d.ts +2 -0
- package/dist/utils/lua/lua_scalar_simplification.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_scalar_simplification.test.js +293 -0
- package/dist/utils/lua/lua_scalar_simplification.test.js.map +1 -0
- package/dist/utils/lua/lua_scope_name_reuse.test.d.ts +2 -0
- package/dist/utils/lua/lua_scope_name_reuse.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_scope_name_reuse.test.js +159 -0
- package/dist/utils/lua/lua_scope_name_reuse.test.js.map +1 -0
- package/dist/utils/lua/lua_simplify.d.ts +2 -0
- package/dist/utils/lua/lua_simplify.d.ts.map +1 -1
- package/dist/utils/lua/lua_simplify.js +236 -500
- package/dist/utils/lua/lua_simplify.js.map +1 -1
- package/dist/utils/lua/lua_source_mapping.test.d.ts +2 -0
- package/dist/utils/lua/lua_source_mapping.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_source_mapping.test.js +182 -0
- package/dist/utils/lua/lua_source_mapping.test.js.map +1 -0
- package/dist/utils/lua/lua_string_literal.test.d.ts +2 -0
- package/dist/utils/lua/lua_string_literal.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_string_literal.test.js +70 -0
- package/dist/utils/lua/lua_string_literal.test.js.map +1 -0
- package/dist/utils/lua/lua_strip_comments.d.ts +3 -0
- package/dist/utils/lua/lua_strip_comments.d.ts.map +1 -0
- package/dist/utils/lua/lua_strip_comments.js +15 -0
- package/dist/utils/lua/lua_strip_comments.js.map +1 -0
- package/dist/utils/lua/lua_symbol_collision.test.d.ts +2 -0
- package/dist/utils/lua/lua_symbol_collision.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_symbol_collision.test.js +55 -0
- package/dist/utils/lua/lua_symbol_collision.test.js.map +1 -0
- package/dist/utils/lua/lua_symbols.d.ts +19 -0
- package/dist/utils/lua/lua_symbols.d.ts.map +1 -0
- package/dist/utils/lua/lua_symbols.js +258 -0
- package/dist/utils/lua/lua_symbols.js.map +1 -0
- package/dist/utils/lua/lua_symbols.test.d.ts +2 -0
- package/dist/utils/lua/lua_symbols.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_symbols.test.js +75 -0
- package/dist/utils/lua/lua_symbols.test.js.map +1 -0
- package/dist/utils/lua/lua_syntax_bare_table_key.d.ts +3 -0
- package/dist/utils/lua/lua_syntax_bare_table_key.d.ts.map +1 -0
- package/dist/utils/lua/lua_syntax_bare_table_key.js +55 -0
- package/dist/utils/lua/lua_syntax_bare_table_key.js.map +1 -0
- package/dist/utils/lua/lua_syntax_member_access.d.ts +3 -0
- package/dist/utils/lua/lua_syntax_member_access.d.ts.map +1 -0
- package/dist/utils/lua/lua_syntax_member_access.js +40 -0
- package/dist/utils/lua/lua_syntax_member_access.js.map +1 -0
- package/dist/utils/lua/lua_syntax_omit_local_nil.d.ts +3 -0
- package/dist/utils/lua/lua_syntax_omit_local_nil.d.ts.map +1 -0
- package/dist/utils/lua/lua_syntax_omit_local_nil.js +32 -0
- package/dist/utils/lua/lua_syntax_omit_local_nil.js.map +1 -0
- package/dist/utils/lua/lua_syntax_remove_redundant_do.d.ts +3 -0
- package/dist/utils/lua/lua_syntax_remove_redundant_do.d.ts.map +1 -0
- package/dist/utils/lua/lua_syntax_remove_redundant_do.js +50 -0
- package/dist/utils/lua/lua_syntax_remove_redundant_do.js.map +1 -0
- package/dist/utils/lua/lua_transform_map.d.ts +36 -0
- package/dist/utils/lua/lua_transform_map.d.ts.map +1 -0
- package/dist/utils/lua/lua_transform_map.js +205 -0
- package/dist/utils/lua/lua_transform_map.js.map +1 -0
- package/dist/utils/lua/lua_utils.d.ts +2 -4
- package/dist/utils/lua/lua_utils.d.ts.map +1 -1
- package/dist/utils/lua/lua_utils.js +100 -37
- package/dist/utils/lua/lua_utils.js.map +1 -1
- package/dist/utils/templates.d.ts +1 -0
- package/dist/utils/templates.d.ts.map +1 -1
- package/dist/utils/templates.js +4 -0
- package/dist/utils/templates.js.map +1 -1
- package/dist/utils/tic80/cartLoader.d.ts.map +1 -1
- package/dist/utils/tic80/cartLoader.js +7 -5
- package/dist/utils/tic80/cartLoader.js.map +1 -1
- package/dist/utils/tic80/cartLoader.test.d.ts +2 -0
- package/dist/utils/tic80/cartLoader.test.d.ts.map +1 -0
- package/dist/utils/tic80/cartLoader.test.js +100 -0
- package/dist/utils/tic80/cartLoader.test.js.map +1 -0
- package/dist/utils/tic80/cartWriter.d.ts +2 -2
- package/dist/utils/tic80/cartWriter.d.ts.map +1 -1
- package/dist/utils/tic80/cartWriter.js +22 -17
- package/dist/utils/tic80/cartWriter.js.map +1 -1
- package/dist/utils/tic80/launch.d.ts +1 -1
- package/dist/utils/tic80/launch.d.ts.map +1 -1
- package/dist/utils/tic80/launch.js +2 -1
- package/dist/utils/tic80/launch.js.map +1 -1
- package/dist/utils/tic80/tic80.d.ts +52 -50
- package/dist/utils/tic80/tic80.d.ts.map +1 -1
- package/dist/utils/tic80/tic80.js +11 -7
- package/dist/utils/tic80/tic80.js.map +1 -1
- package/dist/utils/traceProfiler.d.ts +86 -0
- package/dist/utils/traceProfiler.d.ts.map +1 -0
- package/dist/utils/traceProfiler.js +241 -0
- package/dist/utils/traceProfiler.js.map +1 -0
- package/dist/utils/traceProfiler.test.d.ts +2 -0
- package/dist/utils/traceProfiler.test.d.ts.map +1 -0
- package/dist/utils/traceProfiler.test.js +236 -0
- package/dist/utils/traceProfiler.test.js.map +1 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +35 -0
- package/dist/utils/utils.js.map +1 -1
- package/dist/utils/windowPosition.d.ts.map +1 -1
- package/dist/utils/windowPosition.js +2 -1
- package/dist/utils/windowPosition.js.map +1 -1
- package/package.json +31 -4
- package/scripts/benchmark-lua-minifiers.js +221 -0
- package/scripts/benchmark-lz-configs.js +247 -0
- package/scripts/gen-build-info.js +6 -0
- package/templates/TIC-80-ticbuild/tic80.exe +0 -0
- package/templates/declarations/tic80.d.ts +233 -0
- package/templates/env.template +11 -0
- package/templates/gitignore.template +7 -3
- package/templates/help/build.txt +2 -0
- package/templates/help/init.txt +3 -1
- package/templates/help/inspect.txt +14 -0
- package/templates/help/main.txt +3 -1
- package/templates/help/project.txt +27 -0
- package/templates/help/run.txt +4 -3
- package/templates/help/terminal.txt +32 -18
- package/templates/help/watch.txt +19 -5
- package/templates/minimal/project.ticbuild.jsonc +2 -1
- package/templates/piggybossa/project.ticbuild.jsonc +2 -1
- package/templates/pointsphere/project.ticbuild.jsonc +9 -15
- package/templates/pointsphere/src/palette.lua +5 -3
- package/templates/typescript/.luarc.json +5 -0
- package/templates/typescript/.vscode/extensions.json +3 -0
- package/templates/typescript/eslint.config.mjs +28 -0
- package/templates/typescript/package.json +22 -0
- package/templates/typescript/project.ticbuild.jsonc +28 -0
- package/templates/typescript/src/main.ts +6 -0
- package/templates/typescript/tsconfig.json +10 -0
- package/templates/vscode_extensions.template.json +3 -0
- package/templates/vscode_settings.template.json +3 -0
- package/ticbuild.schema.json +274 -110
- package/dist/backend/ImportedResource.d.ts +0 -11
- package/dist/backend/ImportedResource.d.ts.map +0 -1
- package/dist/backend/ImportedResource.js +0 -53
- package/dist/backend/ImportedResource.js.map +0 -1
- package/dist/backend/importers/luaImporter.d.ts +0 -1
- package/dist/backend/importers/luaImporter.d.ts.map +0 -1
- package/dist/backend/importers/luaImporter.js +0 -3
- package/dist/backend/importers/luaImporter.js.map +0 -1
- package/dist/backend/loadAllImports.d.ts +0 -1
- package/dist/backend/loadAllImports.d.ts.map +0 -1
- package/dist/backend/loadAllImports.js +0 -3
- package/dist/backend/loadAllImports.js.map +0 -1
- package/dist/backend/tic80Controller/externalController.d.ts +0 -18
- package/dist/backend/tic80Controller/externalController.d.ts.map +0 -1
- package/dist/backend/tic80Controller/externalController.js +0 -68
- package/dist/backend/tic80Controller/externalController.js.map +0 -1
- package/dist/backend/tic80Controller/internalController.d.ts +0 -13
- package/dist/backend/tic80Controller/internalController.d.ts.map +0 -1
- package/dist/backend/tic80Controller/internalController.js +0 -44
- package/dist/backend/tic80Controller/internalController.js.map +0 -1
- package/dist/frontend/manifestSchemaSync.test.d.ts +0 -2
- package/dist/frontend/manifestSchemaSync.test.d.ts.map +0 -1
- package/dist/frontend/manifestSchemaSync.test.js +0 -127
- package/dist/frontend/manifestSchemaSync.test.js.map +0 -1
- package/dist/frontend/repl.d.ts +0 -7
- package/dist/frontend/repl.d.ts.map +0 -1
- package/dist/frontend/repl.js +0 -271
- package/dist/frontend/repl.js.map +0 -1
- package/dist/utils/lua/luaUtils.d.ts +0 -1
- package/dist/utils/lua/luaUtils.d.ts.map +0 -1
- package/dist/utils/lua/luaUtils.js +0 -3
- package/dist/utils/lua/luaUtils.js.map +0 -1
- package/templates/help/repl.txt +0 -46
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const luaparse = __importStar(require("luaparse"));
|
|
3
37
|
const lua_processor_1 = require("./lua_processor");
|
|
4
38
|
describe("Lua base language support", () => {
|
|
5
39
|
it("should parse integer division operator without errors", () => {
|
|
@@ -24,6 +58,207 @@ describe("Lua base language support", () => {
|
|
|
24
58
|
expect(output).toContain("5//2");
|
|
25
59
|
});
|
|
26
60
|
});
|
|
61
|
+
describe("Lua numeric concatenation preparation", () => {
|
|
62
|
+
const options = {
|
|
63
|
+
stripComments: false,
|
|
64
|
+
maxIndentLevel: 1,
|
|
65
|
+
lineBehavior: "tight",
|
|
66
|
+
maxLineLength: 180,
|
|
67
|
+
renameLocalVariables: false,
|
|
68
|
+
aliasRepeatedExpressions: false,
|
|
69
|
+
aliasLiterals: false,
|
|
70
|
+
packLocalDeclarations: false,
|
|
71
|
+
simplifyExpressions: false,
|
|
72
|
+
removeUnusedLocals: false,
|
|
73
|
+
removeUnusedFunctions: false,
|
|
74
|
+
functionNamesToKeep: [],
|
|
75
|
+
renameTableFields: false,
|
|
76
|
+
tableEntryKeysToRename: [],
|
|
77
|
+
canonicalizeSyntax: false,
|
|
78
|
+
simplifyControlFlow: false,
|
|
79
|
+
};
|
|
80
|
+
function semanticAst(source) {
|
|
81
|
+
const ast = luaparse.parse(source, { luaVersion: "5.3", comments: true, encodingMode: "x-user-defined" });
|
|
82
|
+
return JSON.parse(JSON.stringify(ast, (key, value) => key === "raw" ? undefined : value));
|
|
83
|
+
}
|
|
84
|
+
it.each([
|
|
85
|
+
String.raw `"0..1 and .15..1"`,
|
|
86
|
+
String.raw `'it\'s 0..1 and 2..3'`,
|
|
87
|
+
String.raw `"a \"quote\" 0..1 and \\ 2..3"`,
|
|
88
|
+
String.raw `[[0..1 "quotes" -- text 2..3]]`,
|
|
89
|
+
String.raw `[==[0..1 ]] ]=] 2..3]==]`,
|
|
90
|
+
])("preserves string values while repairing adjacent code: %s", (literal) => {
|
|
91
|
+
const prefix = `local text=${literal}\n`;
|
|
92
|
+
const result = (0, lua_processor_1.processLuaWithReport)(prefix + 'print(15..text,.15..text,1e3..text)', options, { parseFailure: "throw" });
|
|
93
|
+
expect(semanticAst(result.code)).toEqual(semanticAst(prefix + 'print(15 ..text,.15 ..text,1e3 ..text)'));
|
|
94
|
+
});
|
|
95
|
+
it.each([
|
|
96
|
+
'-- 0..1 "quotes" and [[ delimiters\r\n',
|
|
97
|
+
'--[[0..1\n"quotes" and 2..3]]\n',
|
|
98
|
+
'--[==[0..1 ]] ]=]\n2..3]==]\n',
|
|
99
|
+
])("preserves comment text while repairing adjacent code: %s", (comment) => {
|
|
100
|
+
const result = (0, lua_processor_1.processLuaWithReport)(comment + 'print(15.."x")', options, { parseFailure: "throw" });
|
|
101
|
+
expect(semanticAst(result.code)).toEqual(semanticAst(comment + 'print(15 .."x")'));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe("Lua traceable printer", () => {
|
|
105
|
+
const traceableOptions = {
|
|
106
|
+
stripComments: false,
|
|
107
|
+
maxIndentLevel: 1,
|
|
108
|
+
lineBehavior: "traceable",
|
|
109
|
+
maxLineLength: 180,
|
|
110
|
+
renameLocalVariables: false,
|
|
111
|
+
aliasRepeatedExpressions: false,
|
|
112
|
+
aliasLiterals: false,
|
|
113
|
+
packLocalDeclarations: false,
|
|
114
|
+
simplifyExpressions: false,
|
|
115
|
+
removeUnusedLocals: false,
|
|
116
|
+
removeUnusedFunctions: false,
|
|
117
|
+
functionNamesToKeep: [],
|
|
118
|
+
renameTableFields: false,
|
|
119
|
+
tableEntryKeysToRename: [],
|
|
120
|
+
};
|
|
121
|
+
it("keeps one diagnostic anchor per line while grouping structural punctuation", () => {
|
|
122
|
+
const input = [
|
|
123
|
+
"-- keep this",
|
|
124
|
+
"function TIC(a,b)",
|
|
125
|
+
" local x=lut[9]",
|
|
126
|
+
" poke(x+1,42)",
|
|
127
|
+
"end",
|
|
128
|
+
].join("\n");
|
|
129
|
+
expect((0, lua_processor_1.processLua)(input, traceableOptions).trimEnd().split("\n")).toEqual([
|
|
130
|
+
"-- keep this",
|
|
131
|
+
"function TIC(",
|
|
132
|
+
"a,",
|
|
133
|
+
"b)",
|
|
134
|
+
"local x=",
|
|
135
|
+
"lut[",
|
|
136
|
+
"9",
|
|
137
|
+
"]",
|
|
138
|
+
"poke(",
|
|
139
|
+
"x",
|
|
140
|
+
"+",
|
|
141
|
+
"1,",
|
|
142
|
+
"42)",
|
|
143
|
+
"end",
|
|
144
|
+
]);
|
|
145
|
+
});
|
|
146
|
+
it("groups call and member scaffolding without grouping parenthesized expressions", () => {
|
|
147
|
+
const input = [
|
|
148
|
+
"local function apply(value)",
|
|
149
|
+
" return (value+1).field:method(value)",
|
|
150
|
+
"end",
|
|
151
|
+
].join("\n");
|
|
152
|
+
expect((0, lua_processor_1.processLua)(input, traceableOptions).trimEnd().split("\n")).toEqual([
|
|
153
|
+
"local function apply(",
|
|
154
|
+
"value)",
|
|
155
|
+
"return",
|
|
156
|
+
"(",
|
|
157
|
+
"value",
|
|
158
|
+
"+",
|
|
159
|
+
"1",
|
|
160
|
+
")",
|
|
161
|
+
".field",
|
|
162
|
+
":method(",
|
|
163
|
+
"value)",
|
|
164
|
+
"end",
|
|
165
|
+
]);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
describe("Lua tight2 printer", () => {
|
|
169
|
+
const tight2Options = {
|
|
170
|
+
stripComments: false,
|
|
171
|
+
maxIndentLevel: 1,
|
|
172
|
+
lineBehavior: "tight2",
|
|
173
|
+
maxLineLength: 180,
|
|
174
|
+
renameLocalVariables: false,
|
|
175
|
+
aliasRepeatedExpressions: false,
|
|
176
|
+
aliasLiterals: false,
|
|
177
|
+
packLocalDeclarations: false,
|
|
178
|
+
simplifyExpressions: false,
|
|
179
|
+
removeUnusedLocals: false,
|
|
180
|
+
removeUnusedFunctions: false,
|
|
181
|
+
functionNamesToKeep: [],
|
|
182
|
+
renameTableFields: false,
|
|
183
|
+
tableEntryKeysToRename: [],
|
|
184
|
+
};
|
|
185
|
+
const lexicalTokens = (source) => {
|
|
186
|
+
const lexer = luaparse.parse({
|
|
187
|
+
wait: true,
|
|
188
|
+
luaVersion: "5.3",
|
|
189
|
+
comments: false,
|
|
190
|
+
locations: false,
|
|
191
|
+
ranges: true,
|
|
192
|
+
});
|
|
193
|
+
const tokens = [];
|
|
194
|
+
lexer.write(source);
|
|
195
|
+
while (true) {
|
|
196
|
+
const token = lexer.lex();
|
|
197
|
+
if (token.range[0] === token.range[1]) {
|
|
198
|
+
return tokens;
|
|
199
|
+
}
|
|
200
|
+
tokens.push(`${token.type}:${source.slice(token.range[0], token.range[1])}`);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
it("removes optional whitespace between statements without changing tight", () => {
|
|
204
|
+
const input = "f()\nlocal a=1\ng()";
|
|
205
|
+
expect((0, lua_processor_1.processLua)(input, tight2Options)).toBe("f()local a=1 g()\n");
|
|
206
|
+
expect((0, lua_processor_1.processLua)(input, { ...tight2Options, lineBehavior: "tight" })).toBe("f() local a=1 g()\n");
|
|
207
|
+
});
|
|
208
|
+
it.each([
|
|
209
|
+
["return x == 7 and ready", "return x==7 and ready"],
|
|
210
|
+
["return x == 1.5 and ready", "return x==1.5 and ready"],
|
|
211
|
+
["return x == .5 and ready", "return x==.5 and ready"],
|
|
212
|
+
["return x == 1e3 and ready", "return x==1e3 and ready"],
|
|
213
|
+
["return x == 0x10 and ready", "return x==16 and ready"],
|
|
214
|
+
["return x == 7 or ready", "return x==7 or ready"],
|
|
215
|
+
["if x == 7 then f() end", "if x==7 then f()end"],
|
|
216
|
+
["function f() return 7 end", "function f()return 7 end"],
|
|
217
|
+
["for i=1,7 do f(i) end", "for i=1,7 do f(i)end"],
|
|
218
|
+
["local x=7 apple()", "local x=7 apple()"],
|
|
219
|
+
["local x=7 G()", "local x=7 G()"],
|
|
220
|
+
["local x=7 _g()", "local x=7 _g()"],
|
|
221
|
+
])("preserves numeric-to-name separators: %s", (input, expected) => {
|
|
222
|
+
// Check the text explicitly: luaparse also accepts the invalid Lua 5.3
|
|
223
|
+
// spelling "7and", so reparsing or comparing its tokens cannot catch this.
|
|
224
|
+
expect((0, lua_processor_1.processLua)(input, tight2Options)).toBe(expected + "\n");
|
|
225
|
+
});
|
|
226
|
+
it("still removes spaces between numbers and punctuation", () => {
|
|
227
|
+
expect((0, lua_processor_1.processLua)("return 7 + 2, f(3), {4}", tight2Options)).toBe("return 7+2,f(3),{4}\n");
|
|
228
|
+
});
|
|
229
|
+
it("allows a line break to separate a number from a keyword", () => {
|
|
230
|
+
expect((0, lua_processor_1.processLua)("return 7 and ready", { ...tight2Options, maxLineLength: 8 })).toBe("return 7\nand\nready\n");
|
|
231
|
+
});
|
|
232
|
+
it("keeps only whitespace required to preserve the Lua token stream", () => {
|
|
233
|
+
const input = [
|
|
234
|
+
"local function calculate(a,b)",
|
|
235
|
+
" return a- -b,- -a",
|
|
236
|
+
"end",
|
|
237
|
+
"return calculate(1,2)",
|
|
238
|
+
].join("\n");
|
|
239
|
+
const canonical = (0, lua_processor_1.processLua)(input, { ...tight2Options, lineBehavior: "pretty" });
|
|
240
|
+
const packed = (0, lua_processor_1.processLua)(input, tight2Options);
|
|
241
|
+
expect(packed).toBe("local function calculate(a,b)return a- -b,- -a end return calculate(1,2)\n");
|
|
242
|
+
expect(lexicalTokens(packed)).toEqual(lexicalTokens(canonical));
|
|
243
|
+
});
|
|
244
|
+
it("uses hard comment boundaries and wraps only between tokens", () => {
|
|
245
|
+
const input = [
|
|
246
|
+
"f()",
|
|
247
|
+
"-- keep this",
|
|
248
|
+
"local value=12345",
|
|
249
|
+
"g(value)",
|
|
250
|
+
].join("\n");
|
|
251
|
+
const packed = (0, lua_processor_1.processLua)(input, { ...tight2Options, maxLineLength: 14 });
|
|
252
|
+
expect(packed).toBe([
|
|
253
|
+
"f()",
|
|
254
|
+
"-- keep this",
|
|
255
|
+
"local value=",
|
|
256
|
+
"12345 g(value)",
|
|
257
|
+
"",
|
|
258
|
+
].join("\n"));
|
|
259
|
+
expect(packed.trimEnd().split("\n").every((line) => line.length <= 14)).toBe(true);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
27
262
|
describe("Lua printer numeric literal formatting with simplifyExpressions", () => {
|
|
28
263
|
it("should keep leading zero after string concatenation", () => {
|
|
29
264
|
const options = {
|
|
@@ -225,19 +460,19 @@ describe("Lua expression simplification", () => {
|
|
|
225
460
|
tableEntryKeysToRename: [],
|
|
226
461
|
};
|
|
227
462
|
it("should preserve named table field names while simplifying their values", () => {
|
|
228
|
-
const input = `
|
|
229
|
-
local key = "close"
|
|
230
|
-
local lines = {}
|
|
231
|
-
lines[#lines + 1] = { key = key, value = key }
|
|
463
|
+
const input = `
|
|
464
|
+
local key = "close"
|
|
465
|
+
local lines = {}
|
|
466
|
+
lines[#lines + 1] = { key = key, value = key }
|
|
232
467
|
`;
|
|
233
468
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
234
469
|
expect(output).toContain('lines[#lines+1]={key="close",value="close"}');
|
|
235
470
|
});
|
|
236
471
|
it("should still simplify computed table keys", () => {
|
|
237
|
-
const input = `
|
|
238
|
-
local key = "close"
|
|
239
|
-
local value = "line"
|
|
240
|
-
local entry = { [key] = value }
|
|
472
|
+
const input = `
|
|
473
|
+
local key = "close"
|
|
474
|
+
local value = "line"
|
|
475
|
+
local entry = { [key] = value }
|
|
241
476
|
`;
|
|
242
477
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
243
478
|
expect(output).toContain('entry={["close"]="line"}');
|
|
@@ -335,21 +570,21 @@ describe("Lua aliasing table constructor keys", () => {
|
|
|
335
570
|
const options = aliasOptions({
|
|
336
571
|
aliasRepeatedExpressions: true,
|
|
337
572
|
});
|
|
338
|
-
const input = `
|
|
339
|
-
local somatic_transport = {
|
|
340
|
-
time = {
|
|
341
|
-
demoMillis = 0,
|
|
342
|
-
},
|
|
343
|
-
prevWallMillis = time(),
|
|
344
|
-
}
|
|
345
|
-
local a = time()
|
|
346
|
-
local b = time()
|
|
347
|
-
local c = time()
|
|
348
|
-
local d = time()
|
|
349
|
-
local e = time()
|
|
350
|
-
local f = time()
|
|
351
|
-
local g = time()
|
|
352
|
-
somatic_transport.time.demoMillis = somatic_transport.time.demoMillis + 1
|
|
573
|
+
const input = `
|
|
574
|
+
local somatic_transport = {
|
|
575
|
+
time = {
|
|
576
|
+
demoMillis = 0,
|
|
577
|
+
},
|
|
578
|
+
prevWallMillis = time(),
|
|
579
|
+
}
|
|
580
|
+
local a = time()
|
|
581
|
+
local b = time()
|
|
582
|
+
local c = time()
|
|
583
|
+
local d = time()
|
|
584
|
+
local e = time()
|
|
585
|
+
local f = time()
|
|
586
|
+
local g = time()
|
|
587
|
+
somatic_transport.time.demoMillis = somatic_transport.time.demoMillis + 1
|
|
353
588
|
`;
|
|
354
589
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
355
590
|
expect(output).toContain("local _a=time");
|
|
@@ -361,15 +596,15 @@ somatic_transport.time.demoMillis = somatic_transport.time.demoMillis + 1
|
|
|
361
596
|
const options = aliasOptions({
|
|
362
597
|
aliasRepeatedExpressions: true,
|
|
363
598
|
});
|
|
364
|
-
const input = `
|
|
365
|
-
local a = { time = 1 }
|
|
366
|
-
local b = { time = 2 }
|
|
367
|
-
local c = { time = 3 }
|
|
368
|
-
local d = { time = 4 }
|
|
369
|
-
local e = { time = 5 }
|
|
370
|
-
local f = { time = 6 }
|
|
371
|
-
local g = { time = 7 }
|
|
372
|
-
return a.time + b.time + c.time + d.time + e.time + f.time + g.time
|
|
599
|
+
const input = `
|
|
600
|
+
local a = { time = 1 }
|
|
601
|
+
local b = { time = 2 }
|
|
602
|
+
local c = { time = 3 }
|
|
603
|
+
local d = { time = 4 }
|
|
604
|
+
local e = { time = 5 }
|
|
605
|
+
local f = { time = 6 }
|
|
606
|
+
local g = { time = 7 }
|
|
607
|
+
return a.time + b.time + c.time + d.time + e.time + f.time + g.time
|
|
373
608
|
`;
|
|
374
609
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
375
610
|
expect(output).not.toContain("local _a=time");
|
|
@@ -380,15 +615,15 @@ return a.time + b.time + c.time + d.time + e.time + f.time + g.time
|
|
|
380
615
|
const options = aliasOptions({
|
|
381
616
|
aliasRepeatedExpressions: true,
|
|
382
617
|
});
|
|
383
|
-
const input = `
|
|
384
|
-
local a = { [time] = 1 }
|
|
385
|
-
local b = { [time] = 2 }
|
|
386
|
-
local c = { [time] = 3 }
|
|
387
|
-
local d = { [time] = 4 }
|
|
388
|
-
local e = { [time] = 5 }
|
|
389
|
-
local f = { [time] = 6 }
|
|
390
|
-
local g = { [time] = 7 }
|
|
391
|
-
return a[time] + b[time] + c[time] + d[time] + e[time] + f[time] + g[time]
|
|
618
|
+
const input = `
|
|
619
|
+
local a = { [time] = 1 }
|
|
620
|
+
local b = { [time] = 2 }
|
|
621
|
+
local c = { [time] = 3 }
|
|
622
|
+
local d = { [time] = 4 }
|
|
623
|
+
local e = { [time] = 5 }
|
|
624
|
+
local f = { [time] = 6 }
|
|
625
|
+
local g = { [time] = 7 }
|
|
626
|
+
return a[time] + b[time] + c[time] + d[time] + e[time] + f[time] + g[time]
|
|
392
627
|
`;
|
|
393
628
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
394
629
|
expect(output).toContain("local _a=time");
|
|
@@ -399,14 +634,14 @@ return a[time] + b[time] + c[time] + d[time] + e[time] + f[time] + g[time]
|
|
|
399
634
|
const options = aliasOptions({
|
|
400
635
|
aliasLiterals: true,
|
|
401
636
|
});
|
|
402
|
-
const input = `
|
|
403
|
-
local t = {
|
|
404
|
-
label = "shared-value",
|
|
405
|
-
other = "shared-value",
|
|
406
|
-
}
|
|
407
|
-
local a = "shared-value"
|
|
408
|
-
local b = "shared-value"
|
|
409
|
-
return t.label .. t.other .. a .. b
|
|
637
|
+
const input = `
|
|
638
|
+
local t = {
|
|
639
|
+
label = "shared-value",
|
|
640
|
+
other = "shared-value",
|
|
641
|
+
}
|
|
642
|
+
local a = "shared-value"
|
|
643
|
+
local b = "shared-value"
|
|
644
|
+
return t.label .. t.other .. a .. b
|
|
410
645
|
`;
|
|
411
646
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
412
647
|
expect(output).toContain('local La="shared-value"');
|
|
@@ -418,13 +653,13 @@ return t.label .. t.other .. a .. b
|
|
|
418
653
|
const options = aliasOptions({
|
|
419
654
|
aliasLiterals: true,
|
|
420
655
|
});
|
|
421
|
-
const input = `
|
|
422
|
-
local t = {
|
|
423
|
-
["shared-value"] = "shared-value",
|
|
424
|
-
}
|
|
425
|
-
local a = "shared-value"
|
|
426
|
-
local b = "shared-value"
|
|
427
|
-
return t["shared-value"] .. a .. b
|
|
656
|
+
const input = `
|
|
657
|
+
local t = {
|
|
658
|
+
["shared-value"] = "shared-value",
|
|
659
|
+
}
|
|
660
|
+
local a = "shared-value"
|
|
661
|
+
local b = "shared-value"
|
|
662
|
+
return t["shared-value"] .. a .. b
|
|
428
663
|
`;
|
|
429
664
|
const output = (0, lua_processor_1.processLua)(input, options);
|
|
430
665
|
expect(output).toContain('local La="shared-value"');
|
|
@@ -452,39 +687,78 @@ describe("Lua allowed global symbol renaming", () => {
|
|
|
452
687
|
...overrides,
|
|
453
688
|
};
|
|
454
689
|
}
|
|
455
|
-
it("should
|
|
690
|
+
it("should remain opt-in when no global renaming mode is specified", () => {
|
|
456
691
|
const input = `
|
|
457
|
-
function Demo_LongName(
|
|
458
|
-
|
|
459
|
-
return Demo_LongName(n - 1)
|
|
460
|
-
end
|
|
461
|
-
return 0
|
|
692
|
+
function Demo_LongName()
|
|
693
|
+
return 1
|
|
462
694
|
end
|
|
463
|
-
return Demo_LongName(
|
|
695
|
+
return Demo_LongName()
|
|
696
|
+
`;
|
|
697
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions());
|
|
698
|
+
expect(output).toContain("function Demo_LongName()");
|
|
699
|
+
expect(output).toContain("return Demo_LongName()");
|
|
700
|
+
});
|
|
701
|
+
it("should automatically rename globals defined in opt-out mode", () => {
|
|
702
|
+
const input = `
|
|
703
|
+
function Internal_LongFunction()
|
|
704
|
+
return Internal_LongValue
|
|
705
|
+
end
|
|
706
|
+
Internal_LongValue = 3
|
|
707
|
+
return Internal_LongFunction()
|
|
464
708
|
`;
|
|
465
709
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
466
|
-
|
|
710
|
+
globalSymbolRenaming: "opt-out",
|
|
467
711
|
}));
|
|
468
|
-
expect(output).toContain("
|
|
469
|
-
expect(output).toContain("
|
|
470
|
-
expect(output).
|
|
471
|
-
expect(output).not.toContain("Demo_LongName");
|
|
712
|
+
expect(output).not.toContain("Internal_LongFunction");
|
|
713
|
+
expect(output).not.toContain("Internal_LongValue");
|
|
714
|
+
expect(output).toMatch(/function [A-Za-z_][A-Za-z0-9_]*\(\)/);
|
|
472
715
|
});
|
|
473
|
-
it("should rename
|
|
716
|
+
it("should not rename read-only runtime globals in opt-out mode", () => {
|
|
474
717
|
const input = `
|
|
475
|
-
|
|
718
|
+
function Internal_LongHelper()
|
|
719
|
+
return math.floor(time())
|
|
720
|
+
end
|
|
721
|
+
return Internal_LongHelper() + cls()
|
|
722
|
+
`;
|
|
723
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
724
|
+
globalSymbolRenaming: "opt-out",
|
|
725
|
+
}));
|
|
726
|
+
expect(output).not.toContain("Internal_LongHelper");
|
|
727
|
+
expect(output).toContain("math.floor(time())");
|
|
728
|
+
expect(output).toContain("cls()");
|
|
729
|
+
});
|
|
730
|
+
it("should preserve selected globals in opt-out mode", () => {
|
|
731
|
+
const input = `
|
|
732
|
+
function Public_LongApi()
|
|
733
|
+
return Internal_LongHelper()
|
|
734
|
+
end
|
|
735
|
+
function Internal_LongHelper()
|
|
476
736
|
return 1
|
|
477
737
|
end
|
|
478
|
-
return
|
|
738
|
+
return Public_LongApi()
|
|
479
739
|
`;
|
|
480
740
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
481
|
-
|
|
741
|
+
globalSymbolRenaming: "opt-out",
|
|
742
|
+
globalSymbolsToKeep: ["Public_LongApi"],
|
|
482
743
|
}));
|
|
483
|
-
expect(output).toContain("
|
|
484
|
-
expect(output).toContain("return
|
|
485
|
-
expect(output).not.toContain("
|
|
744
|
+
expect(output).toContain("function Public_LongApi()");
|
|
745
|
+
expect(output).toContain("return Public_LongApi()");
|
|
746
|
+
expect(output).not.toContain("Internal_LongHelper");
|
|
747
|
+
});
|
|
748
|
+
it("should keep protected callbacks in opt-out mode", () => {
|
|
749
|
+
const input = `
|
|
750
|
+
function TIC()
|
|
751
|
+
Internal_LongHelper()
|
|
752
|
+
end
|
|
753
|
+
function Internal_LongHelper() end
|
|
754
|
+
`;
|
|
755
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
756
|
+
globalSymbolRenaming: "opt-out",
|
|
757
|
+
}));
|
|
758
|
+
expect(output).toContain("function TIC()");
|
|
759
|
+
expect(output).not.toContain("Internal_LongHelper");
|
|
486
760
|
});
|
|
487
|
-
it("should not rename
|
|
761
|
+
it("should not rename globals when global symbol renaming is off", () => {
|
|
488
762
|
const input = `
|
|
489
763
|
function Demo_LongName()
|
|
490
764
|
return 1
|
|
@@ -492,26 +766,85 @@ end
|
|
|
492
766
|
return Demo_LongName()
|
|
493
767
|
`;
|
|
494
768
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
495
|
-
|
|
769
|
+
globalSymbolRenaming: "off",
|
|
496
770
|
globalSymbolsToRename: ["Demo_LongName"],
|
|
497
771
|
}));
|
|
498
772
|
expect(output).toContain("function Demo_LongName()");
|
|
499
773
|
expect(output).toContain("return Demo_LongName()");
|
|
500
|
-
expect(output).not.toContain("function a()");
|
|
501
774
|
});
|
|
502
|
-
it("should
|
|
775
|
+
it("should not treat assignments to locals as global definitions in opt-out mode", () => {
|
|
503
776
|
const input = `
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
777
|
+
local Local_LongName = 0
|
|
778
|
+
Local_LongName = 1
|
|
779
|
+
Global_LongName = 2
|
|
780
|
+
return Local_LongName + Global_LongName
|
|
781
|
+
`;
|
|
782
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
783
|
+
globalSymbolRenaming: "opt-out",
|
|
784
|
+
}));
|
|
785
|
+
expect(output).toContain("local Local_LongName=0 Local_LongName=1");
|
|
786
|
+
expect(output).not.toContain("Global_LongName");
|
|
787
|
+
});
|
|
788
|
+
it("gives the shortest name to the most frequently referenced allowed global", () => {
|
|
789
|
+
const infrequentNames = Array.from({ length: 53 }, (_, index) => `InfrequentGlobal${index}`);
|
|
790
|
+
const namesToRename = [...infrequentNames, "FrequentGlobal"];
|
|
791
|
+
const input = `
|
|
792
|
+
${namesToRename.map(name => `${name}=0`).join("\n")}
|
|
793
|
+
local function useShadow(InfrequentGlobal0)
|
|
794
|
+
return InfrequentGlobal0 + InfrequentGlobal0 + InfrequentGlobal0 + InfrequentGlobal0
|
|
513
795
|
end
|
|
514
|
-
return
|
|
796
|
+
return FrequentGlobal + FrequentGlobal + FrequentGlobal
|
|
797
|
+
`;
|
|
798
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({ globalSymbolsToRename: namesToRename }));
|
|
799
|
+
expect(output).toContain("b=0 c=0");
|
|
800
|
+
expect(output).toContain("aa=0 a=0 local function useShadow(InfrequentGlobal0)");
|
|
801
|
+
expect(output).toContain("return a+a+a");
|
|
802
|
+
});
|
|
803
|
+
it("should rename explicitly allowed global function declarations and references", () => {
|
|
804
|
+
const input = `
|
|
805
|
+
function Demo_LongName(n)
|
|
806
|
+
if n > 0 then
|
|
807
|
+
return Demo_LongName(n - 1)
|
|
808
|
+
end
|
|
809
|
+
return 0
|
|
810
|
+
end
|
|
811
|
+
return Demo_LongName(3)
|
|
812
|
+
`;
|
|
813
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
814
|
+
globalSymbolsToRename: ["Demo_LongName"],
|
|
815
|
+
}));
|
|
816
|
+
expect(output).toContain("function a(n)");
|
|
817
|
+
expect(output).toContain("return a(n-1)");
|
|
818
|
+
expect(output).toContain("return a(3)");
|
|
819
|
+
expect(output).not.toContain("Demo_LongName");
|
|
820
|
+
});
|
|
821
|
+
it("should rename explicitly allowed global assignments and references", () => {
|
|
822
|
+
const input = `
|
|
823
|
+
Demo_AssignedLongName = function()
|
|
824
|
+
return 1
|
|
825
|
+
end
|
|
826
|
+
return Demo_AssignedLongName()
|
|
827
|
+
`;
|
|
828
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
829
|
+
globalSymbolsToRename: ["Demo_AssignedLongName"],
|
|
830
|
+
}));
|
|
831
|
+
expect(output).toContain("a=function()");
|
|
832
|
+
expect(output).toContain("return a()");
|
|
833
|
+
expect(output).not.toContain("Demo_AssignedLongName");
|
|
834
|
+
});
|
|
835
|
+
it("should respect local and parameter shadowing", () => {
|
|
836
|
+
const input = `
|
|
837
|
+
function Demo_LongName()
|
|
838
|
+
return 1
|
|
839
|
+
end
|
|
840
|
+
local function useLocal()
|
|
841
|
+
local Demo_LongName = 2
|
|
842
|
+
return Demo_LongName
|
|
843
|
+
end
|
|
844
|
+
local function useParam(Demo_LongName)
|
|
845
|
+
return Demo_LongName
|
|
846
|
+
end
|
|
847
|
+
return Demo_LongName() + useLocal() + useParam(3)
|
|
515
848
|
`;
|
|
516
849
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
517
850
|
globalSymbolsToRename: ["Demo_LongName"],
|
|
@@ -521,15 +854,31 @@ return Demo_LongName() + useLocal() + useParam(3)
|
|
|
521
854
|
expect(output).toContain("local function useParam(Demo_LongName)");
|
|
522
855
|
expect(output).toContain("return a()+useLocal()+useParam(3)");
|
|
523
856
|
});
|
|
524
|
-
it("should
|
|
857
|
+
it("should keep repeat locals shadowing an allowed global through until", () => {
|
|
525
858
|
const input = `
|
|
526
|
-
function Demo_LongName()
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return
|
|
859
|
+
function Demo_LongName()
|
|
860
|
+
return 1
|
|
861
|
+
end
|
|
862
|
+
repeat
|
|
863
|
+
local Demo_LongName = nextValue()
|
|
864
|
+
until Demo_LongName
|
|
865
|
+
return Demo_LongName()
|
|
866
|
+
`;
|
|
867
|
+
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
868
|
+
globalSymbolsToRename: ["Demo_LongName"],
|
|
869
|
+
}));
|
|
870
|
+
expect(output).toContain("repeat local Demo_LongName=nextValue() until Demo_LongName");
|
|
871
|
+
expect(output).toContain("return a()");
|
|
872
|
+
});
|
|
873
|
+
it("should not rewrite table field names or member names", () => {
|
|
874
|
+
const input = `
|
|
875
|
+
function Demo_LongName() end
|
|
876
|
+
local t = {
|
|
877
|
+
Demo_LongName = Demo_LongName,
|
|
878
|
+
[Demo_LongName] = Demo_LongName,
|
|
879
|
+
}
|
|
880
|
+
obj.Demo_LongName = Demo_LongName
|
|
881
|
+
return t.Demo_LongName + t[Demo_LongName]
|
|
533
882
|
`;
|
|
534
883
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
535
884
|
globalSymbolsToRename: ["Demo_LongName"],
|
|
@@ -540,10 +889,10 @@ return t.Demo_LongName + t[Demo_LongName]
|
|
|
540
889
|
expect(output).toContain("return t.Demo_LongName+t[a]");
|
|
541
890
|
});
|
|
542
891
|
it("should keep protected entrypoint names even when explicitly allowed", () => {
|
|
543
|
-
const input = `
|
|
544
|
-
function TIC()
|
|
545
|
-
end
|
|
546
|
-
TIC()
|
|
892
|
+
const input = `
|
|
893
|
+
function TIC()
|
|
894
|
+
end
|
|
895
|
+
TIC()
|
|
547
896
|
`;
|
|
548
897
|
const output = (0, lua_processor_1.processLua)(input, renameGlobalOptions({
|
|
549
898
|
functionNamesToKeep: ["TIC"],
|