@jackctaylor/roblox-ts 3.0.0-projectrefs.0
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/CHANGELOG.md +716 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/include/Promise.lua +2068 -0
- package/include/RuntimeLib.lua +258 -0
- package/out/CLI/cli.d.ts +2 -0
- package/out/CLI/cli.js +41 -0
- package/out/CLI/commands/build.d.ts +7 -0
- package/out/CLI/commands/build.js +438 -0
- package/out/CLI/errors/CLIError.d.ts +4 -0
- package/out/CLI/errors/CLIError.js +12 -0
- package/out/CLI/index.d.ts +3 -0
- package/out/CLI/index.js +22 -0
- package/out/CLI/test.d.ts +1 -0
- package/out/CLI/test.js +82 -0
- package/out/CLI/util/patchFs.d.ts +1 -0
- package/out/CLI/util/patchFs.js +26 -0
- package/out/Project/classes/VirtualFileSystem.d.ts +14 -0
- package/out/Project/classes/VirtualFileSystem.js +102 -0
- package/out/Project/classes/VirtualProject.d.ts +15 -0
- package/out/Project/classes/VirtualProject.js +121 -0
- package/out/Project/functions/buildProject.d.ts +18 -0
- package/out/Project/functions/buildProject.js +48 -0
- package/out/Project/functions/buildProjectReferences.d.ts +3 -0
- package/out/Project/functions/buildProjectReferences.js +78 -0
- package/out/Project/functions/buildSolution.d.ts +10 -0
- package/out/Project/functions/buildSolution.js +97 -0
- package/out/Project/functions/checkFileName.d.ts +1 -0
- package/out/Project/functions/checkFileName.js +18 -0
- package/out/Project/functions/checkRojoConfig.d.ts +4 -0
- package/out/Project/functions/checkRojoConfig.js +26 -0
- package/out/Project/functions/cleanup.d.ts +2 -0
- package/out/Project/functions/cleanup.js +30 -0
- package/out/Project/functions/compileFiles.d.ts +4 -0
- package/out/Project/functions/compileFiles.js +160 -0
- package/out/Project/functions/compileProject.d.ts +14 -0
- package/out/Project/functions/compileProject.js +71 -0
- package/out/Project/functions/copyFiles.d.ts +3 -0
- package/out/Project/functions/copyFiles.js +13 -0
- package/out/Project/functions/copyInclude.d.ts +2 -0
- package/out/Project/functions/copyInclude.js +17 -0
- package/out/Project/functions/copyItem.d.ts +3 -0
- package/out/Project/functions/copyItem.js +27 -0
- package/out/Project/functions/createNodeModulesPathMapping.d.ts +1 -0
- package/out/Project/functions/createNodeModulesPathMapping.js +31 -0
- package/out/Project/functions/createPathTranslator.d.ts +4 -0
- package/out/Project/functions/createPathTranslator.js +22 -0
- package/out/Project/functions/createProgramFactory.d.ts +3 -0
- package/out/Project/functions/createProgramFactory.js +31 -0
- package/out/Project/functions/createProjectData.d.ts +2 -0
- package/out/Project/functions/createProjectData.js +102 -0
- package/out/Project/functions/createProjectProgram.d.ts +3 -0
- package/out/Project/functions/createProjectProgram.js +11 -0
- package/out/Project/functions/getChangedFilePaths.d.ts +2 -0
- package/out/Project/functions/getChangedFilePaths.js +47 -0
- package/out/Project/functions/getChangedSourceFiles.d.ts +2 -0
- package/out/Project/functions/getChangedSourceFiles.js +19 -0
- package/out/Project/functions/getParsedCommandLine.d.ts +3 -0
- package/out/Project/functions/getParsedCommandLine.js +41 -0
- package/out/Project/functions/getProjectReferences.d.ts +2 -0
- package/out/Project/functions/getProjectReferences.js +65 -0
- package/out/Project/functions/getResolvedProjectReferences.d.ts +3 -0
- package/out/Project/functions/getResolvedProjectReferences.js +43 -0
- package/out/Project/functions/setupProjectWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupProjectWatchProgram.js +352 -0
- package/out/Project/functions/setupSolutionWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupSolutionWatchProgram.js +355 -0
- package/out/Project/functions/tryRemoveOutput.d.ts +2 -0
- package/out/Project/functions/tryRemoveOutput.js +30 -0
- package/out/Project/functions/validateCompilerOptions.d.ts +2 -0
- package/out/Project/functions/validateCompilerOptions.js +87 -0
- package/out/Project/index.d.ts +4 -0
- package/out/Project/index.js +20 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.d.ts +3 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.js +28 -0
- package/out/Project/transformers/builtin/transformPaths.d.ts +5 -0
- package/out/Project/transformers/builtin/transformPaths.js +129 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.d.ts +2 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.js +23 -0
- package/out/Project/transformers/createTransformerList.d.ts +4 -0
- package/out/Project/transformers/createTransformerList.js +87 -0
- package/out/Project/transformers/createTransformerWatcher.d.ts +3 -0
- package/out/Project/transformers/createTransformerWatcher.js +59 -0
- package/out/Project/transformers/getPluginConfigs.d.ts +2 -0
- package/out/Project/transformers/getPluginConfigs.js +34 -0
- package/out/Project/util/createReadBuildProgramHost.d.ts +5 -0
- package/out/Project/util/createReadBuildProgramHost.js +15 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.d.ts +4 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.js +13 -0
- package/out/Project/util/isCompilableFile.d.ts +1 -0
- package/out/Project/util/isCompilableFile.js +18 -0
- package/out/Project/util/walkDirectorySync.d.ts +1 -0
- package/out/Project/util/walkDirectorySync.js +22 -0
- package/out/Shared/classes/Lazy.d.ts +8 -0
- package/out/Shared/classes/Lazy.js +22 -0
- package/out/Shared/classes/LogService.d.ts +9 -0
- package/out/Shared/classes/LogService.js +37 -0
- package/out/Shared/constants.d.ts +23 -0
- package/out/Shared/constants.js +50 -0
- package/out/Shared/diagnostics.d.ts +79 -0
- package/out/Shared/diagnostics.js +140 -0
- package/out/Shared/errors/DiagnosticError.d.ts +7 -0
- package/out/Shared/errors/DiagnosticError.js +16 -0
- package/out/Shared/errors/LoggableError.d.ts +5 -0
- package/out/Shared/errors/LoggableError.js +14 -0
- package/out/Shared/errors/ProjectError.d.ts +4 -0
- package/out/Shared/errors/ProjectError.js +12 -0
- package/out/Shared/index.d.ts +0 -0
- package/out/Shared/index.js +2 -0
- package/out/Shared/types.d.ts +50 -0
- package/out/Shared/types.js +3 -0
- package/out/Shared/util/assert.d.ts +1 -0
- package/out/Shared/util/assert.js +12 -0
- package/out/Shared/util/benchmark.d.ts +3 -0
- package/out/Shared/util/benchmark.js +32 -0
- package/out/Shared/util/createDiagnosticWithLocation.d.ts +3 -0
- package/out/Shared/util/createDiagnosticWithLocation.js +29 -0
- package/out/Shared/util/createGithubLink.d.ts +1 -0
- package/out/Shared/util/createGithubLink.js +12 -0
- package/out/Shared/util/createTextDiagnostic.d.ts +2 -0
- package/out/Shared/util/createTextDiagnostic.js +18 -0
- package/out/Shared/util/findAncestorDir.d.ts +1 -0
- package/out/Shared/util/findAncestorDir.js +16 -0
- package/out/Shared/util/findLastIndex.d.ts +1 -0
- package/out/Shared/util/findLastIndex.js +12 -0
- package/out/Shared/util/formatDiagnostics.d.ts +2 -0
- package/out/Shared/util/formatDiagnostics.js +19 -0
- package/out/Shared/util/getCanonicalFileName.d.ts +2 -0
- package/out/Shared/util/getCanonicalFileName.js +10 -0
- package/out/Shared/util/getOrSetDefault.d.ts +1 -0
- package/out/Shared/util/getOrSetDefault.js +12 -0
- package/out/Shared/util/getRootDirs.d.ts +2 -0
- package/out/Shared/util/getRootDirs.js +10 -0
- package/out/Shared/util/hasErrors.d.ts +2 -0
- package/out/Shared/util/hasErrors.js +11 -0
- package/out/Shared/util/isPathDescendantOf.d.ts +1 -0
- package/out/Shared/util/isPathDescendantOf.js +11 -0
- package/out/Shared/util/realPathExistsSync.d.ts +1 -0
- package/out/Shared/util/realPathExistsSync.js +13 -0
- package/out/Shared/warn.d.ts +1 -0
- package/out/Shared/warn.js +12 -0
- package/out/TSTransformer/classes/DiagnosticService.d.ts +11 -0
- package/out/TSTransformer/classes/DiagnosticService.js +37 -0
- package/out/TSTransformer/classes/MacroManager.d.ts +46 -0
- package/out/TSTransformer/classes/MacroManager.js +178 -0
- package/out/TSTransformer/classes/MultiTransformState.d.ts +9 -0
- package/out/TSTransformer/classes/MultiTransformState.js +15 -0
- package/out/TSTransformer/classes/TransformState.d.ts +73 -0
- package/out/TSTransformer/classes/TransformState.js +307 -0
- package/out/TSTransformer/index.d.ts +4 -0
- package/out/TSTransformer/index.js +23 -0
- package/out/TSTransformer/macros/callMacros.d.ts +2 -0
- package/out/TSTransformer/macros/callMacros.js +56 -0
- package/out/TSTransformer/macros/constructorMacros.d.ts +2 -0
- package/out/TSTransformer/macros/constructorMacros.js +97 -0
- package/out/TSTransformer/macros/identifierMacros.d.ts +2 -0
- package/out/TSTransformer/macros/identifierMacros.js +7 -0
- package/out/TSTransformer/macros/propertyCallMacros.d.ts +4 -0
- package/out/TSTransformer/macros/propertyCallMacros.js +726 -0
- package/out/TSTransformer/macros/types.d.ts +12 -0
- package/out/TSTransformer/macros/types.js +3 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.js +78 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.js +52 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.js +30 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.js +97 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.js +57 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.js +96 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.js +262 -0
- package/out/TSTransformer/nodes/class/transformDecorators.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformDecorators.js +179 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.js +33 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.js +79 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.js +199 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.js +15 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.d.ts +7 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.js +191 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.js +10 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.js +55 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.js +62 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.js +107 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.js +46 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.js +147 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.js +30 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.js +28 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.js +26 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.js +98 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.js +36 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.js +35 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.js +12 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.js +27 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.js +25 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.js +29 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.js +68 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.js +46 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.js +36 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.js +83 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.js +34 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.js +42 -0
- package/out/TSTransformer/nodes/statements/transformBlock.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBlock.js +14 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.d.ts +3 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.js +8 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.js +31 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.js +97 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.js +53 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.js +109 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.js +62 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.js +375 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.js +371 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.js +68 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.js +46 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.js +98 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.js +36 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.js +122 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.js +74 -0
- package/out/TSTransformer/nodes/statements/transformStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformStatement.js +83 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.js +105 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.js +18 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.js +148 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.d.ts +8 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.js +155 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.js +30 -0
- package/out/TSTransformer/nodes/transformEntityName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformEntityName.js +24 -0
- package/out/TSTransformer/nodes/transformInitializer.d.ts +4 -0
- package/out/TSTransformer/nodes/transformInitializer.js +22 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.d.ts +3 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.js +12 -0
- package/out/TSTransformer/nodes/transformLogical.d.ts +4 -0
- package/out/TSTransformer/nodes/transformLogical.js +103 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.js +91 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.d.ts +5 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.js +82 -0
- package/out/TSTransformer/nodes/transformOptionalChain.d.ts +46 -0
- package/out/TSTransformer/nodes/transformOptionalChain.js +257 -0
- package/out/TSTransformer/nodes/transformParameters.d.ts +8 -0
- package/out/TSTransformer/nodes/transformParameters.js +104 -0
- package/out/TSTransformer/nodes/transformPropertyName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformPropertyName.js +18 -0
- package/out/TSTransformer/nodes/transformSourceFile.d.ts +4 -0
- package/out/TSTransformer/nodes/transformSourceFile.js +171 -0
- package/out/TSTransformer/nodes/transformStatementList.d.ts +7 -0
- package/out/TSTransformer/nodes/transformStatementList.js +63 -0
- package/out/TSTransformer/nodes/transformWritable.d.ts +9 -0
- package/out/TSTransformer/nodes/transformWritable.js +49 -0
- package/out/TSTransformer/typeGuards.d.ts +5 -0
- package/out/TSTransformer/typeGuards.js +27 -0
- package/out/TSTransformer/types.d.ts +9 -0
- package/out/TSTransformer/types.js +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.d.ts +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.js +24 -0
- package/out/TSTransformer/util/addOneIfArrayType.d.ts +4 -0
- package/out/TSTransformer/util/addOneIfArrayType.js +14 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.d.ts +3 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.js +23 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.d.ts +2 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.js +17 -0
- package/out/TSTransformer/util/assertNever.d.ts +1 -0
- package/out/TSTransformer/util/assertNever.js +36 -0
- package/out/TSTransformer/util/assignment.d.ts +7 -0
- package/out/TSTransformer/util/assignment.js +48 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.d.ts +6 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.js +141 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.d.ts +4 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.js +15 -0
- package/out/TSTransformer/util/binding/objectAccessor.d.ts +4 -0
- package/out/TSTransformer/util/binding/objectAccessor.js +39 -0
- package/out/TSTransformer/util/bitwise.d.ts +6 -0
- package/out/TSTransformer/util/bitwise.js +67 -0
- package/out/TSTransformer/util/checkVariableHoist.d.ts +3 -0
- package/out/TSTransformer/util/checkVariableHoist.js +33 -0
- package/out/TSTransformer/util/cleanModuleName.d.ts +1 -0
- package/out/TSTransformer/util/cleanModuleName.js +7 -0
- package/out/TSTransformer/util/convertToIndexableExpression.d.ts +3 -0
- package/out/TSTransformer/util/convertToIndexableExpression.js +14 -0
- package/out/TSTransformer/util/createBinaryFromOperator.d.ts +4 -0
- package/out/TSTransformer/util/createBinaryFromOperator.js +54 -0
- package/out/TSTransformer/util/createGetService.d.ts +2 -0
- package/out/TSTransformer/util/createGetService.js +15 -0
- package/out/TSTransformer/util/createHoistDeclaration.d.ts +4 -0
- package/out/TSTransformer/util/createHoistDeclaration.js +20 -0
- package/out/TSTransformer/util/createImportExpression.d.ts +5 -0
- package/out/TSTransformer/util/createImportExpression.js +181 -0
- package/out/TSTransformer/util/createStringFromLiteral.d.ts +2 -0
- package/out/TSTransformer/util/createStringFromLiteral.js +27 -0
- package/out/TSTransformer/util/createTransformServices.d.ts +3 -0
- package/out/TSTransformer/util/createTransformServices.js +9 -0
- package/out/TSTransformer/util/createTruthinessChecks.d.ts +5 -0
- package/out/TSTransformer/util/createTruthinessChecks.js +50 -0
- package/out/TSTransformer/util/createTypeCheck.d.ts +2 -0
- package/out/TSTransformer/util/createTypeCheck.js +11 -0
- package/out/TSTransformer/util/ensureTransformOrder.d.ts +5 -0
- package/out/TSTransformer/util/ensureTransformOrder.js +39 -0
- package/out/TSTransformer/util/expressionChain.d.ts +3 -0
- package/out/TSTransformer/util/expressionChain.js +16 -0
- package/out/TSTransformer/util/expressionMightMutate.d.ts +4 -0
- package/out/TSTransformer/util/expressionMightMutate.js +57 -0
- package/out/TSTransformer/util/findConstructor.d.ts +4 -0
- package/out/TSTransformer/util/findConstructor.js +11 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.d.ts +1 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.js +306 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.d.ts +6 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.js +253 -0
- package/out/TSTransformer/util/getAssignableValue.d.ts +3 -0
- package/out/TSTransformer/util/getAssignableValue.js +15 -0
- package/out/TSTransformer/util/getConstantValueLiteral.d.ts +4 -0
- package/out/TSTransformer/util/getConstantValueLiteral.js +19 -0
- package/out/TSTransformer/util/getDeclaredVariables.d.ts +2 -0
- package/out/TSTransformer/util/getDeclaredVariables.js +37 -0
- package/out/TSTransformer/util/getExtendsNode.d.ts +2 -0
- package/out/TSTransformer/util/getExtendsNode.js +16 -0
- package/out/TSTransformer/util/getFlags.d.ts +1 -0
- package/out/TSTransformer/util/getFlags.js +13 -0
- package/out/TSTransformer/util/getKindName.d.ts +2 -0
- package/out/TSTransformer/util/getKindName.js +61 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.d.ts +2 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.js +15 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.d.ts +3 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.js +33 -0
- package/out/TSTransformer/util/getStatements.d.ts +2 -0
- package/out/TSTransformer/util/getStatements.js +11 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.d.ts +2 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.js +17 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.d.ts +3 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.js +17 -0
- package/out/TSTransformer/util/isMethod.d.ts +4 -0
- package/out/TSTransformer/util/isMethod.js +90 -0
- package/out/TSTransformer/util/isSymbolMutable.d.ts +3 -0
- package/out/TSTransformer/util/isSymbolMutable.js +24 -0
- package/out/TSTransformer/util/isSymbolOfValue.d.ts +2 -0
- package/out/TSTransformer/util/isSymbolOfValue.js +11 -0
- package/out/TSTransformer/util/isUsedAsStatement.d.ts +2 -0
- package/out/TSTransformer/util/isUsedAsStatement.js +23 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.d.ts +3 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.js +31 -0
- package/out/TSTransformer/util/offset.d.ts +2 -0
- package/out/TSTransformer/util/offset.js +44 -0
- package/out/TSTransformer/util/pointer.d.ts +13 -0
- package/out/TSTransformer/util/pointer.js +46 -0
- package/out/TSTransformer/util/spreadDestructuring/index.d.ts +9 -0
- package/out/TSTransformer/util/spreadDestructuring/index.js +45 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.js +17 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.js +33 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.js +34 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.js +41 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.js +28 -0
- package/out/TSTransformer/util/traversal.d.ts +7 -0
- package/out/TSTransformer/util/traversal.js +57 -0
- package/out/TSTransformer/util/types.d.ts +31 -0
- package/out/TSTransformer/util/types.js +259 -0
- package/out/TSTransformer/util/validateIdentifier.d.ts +3 -0
- package/out/TSTransformer/util/validateIdentifier.js +18 -0
- package/out/TSTransformer/util/validateMethodAssignment.d.ts +3 -0
- package/out/TSTransformer/util/validateMethodAssignment.js +81 -0
- package/out/TSTransformer/util/validateNotAny.d.ts +3 -0
- package/out/TSTransformer/util/validateNotAny.js +37 -0
- package/out/TSTransformer/util/valueToIdStr.d.ts +2 -0
- package/out/TSTransformer/util/valueToIdStr.js +29 -0
- package/out/TSTransformer/util/wrapExpressionStatement.d.ts +2 -0
- package/out/TSTransformer/util/wrapExpressionStatement.js +22 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.d.ts +4 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.js +56 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.d.ts +4 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.js +19 -0
- package/package.json +72 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformOmittedExpression = transformOmittedExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
function transformOmittedExpression() {
|
|
9
|
+
return luau_ast_1.default.nil();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=transformOmittedExpression.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformParenthesizedExpression(state: TransformState, node: ts.ParenthesizedExpression): luau.Identifier | luau.TemporaryIdentifier | luau.ParenthesizedExpression | luau.NilLiteral | luau.FalseLiteral | luau.TrueLiteral | luau.NumberLiteral | luau.StringLiteral;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformParenthesizedExpression = transformParenthesizedExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformExpression_1 = require("./transformExpression");
|
|
9
|
+
const traversal_1 = require("../../util/traversal");
|
|
10
|
+
function transformParenthesizedExpression(state, node) {
|
|
11
|
+
const expression = (0, transformExpression_1.transformExpression)(state, (0, traversal_1.skipDownwards)(node.expression));
|
|
12
|
+
if (luau_ast_1.default.isSimple(expression)) {
|
|
13
|
+
return expression;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.ParenthesizedExpression, { expression });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=transformParenthesizedExpression.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformPropertyAccessExpressionInner(state: TransformState, node: ts.PropertyAccessExpression, expression: luau.Expression, name: string): luau.PropertyAccessExpression | luau.None;
|
|
5
|
+
export declare function transformPropertyAccessExpression(state: TransformState, node: ts.PropertyAccessExpression): luau.Expression<luau.SyntaxKind>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformPropertyAccessExpressionInner = transformPropertyAccessExpressionInner;
|
|
7
|
+
exports.transformPropertyAccessExpression = transformPropertyAccessExpression;
|
|
8
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
9
|
+
const transformOptionalChain_1 = require("../transformOptionalChain");
|
|
10
|
+
const addIndexDiagnostics_1 = require("../../util/addIndexDiagnostics");
|
|
11
|
+
const convertToIndexableExpression_1 = require("../../util/convertToIndexableExpression");
|
|
12
|
+
const getConstantValueLiteral_1 = require("../../util/getConstantValueLiteral");
|
|
13
|
+
const traversal_1 = require("../../util/traversal");
|
|
14
|
+
const validateNotAny_1 = require("../../util/validateNotAny");
|
|
15
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
16
|
+
function transformPropertyAccessExpressionInner(state, node, expression, name) {
|
|
17
|
+
(0, validateNotAny_1.validateNotAnyType)(state, node.expression);
|
|
18
|
+
(0, addIndexDiagnostics_1.addIndexDiagnostics)(state, node, state.typeChecker.getNonOptionalType(state.getType(node)));
|
|
19
|
+
if (typescript_1.default.isDeleteExpression((0, traversal_1.skipUpwards)(node).parent)) {
|
|
20
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.Assignment, {
|
|
21
|
+
left: luau_ast_1.default.property((0, convertToIndexableExpression_1.convertToIndexableExpression)(expression), name),
|
|
22
|
+
operator: "=",
|
|
23
|
+
right: luau_ast_1.default.nil(),
|
|
24
|
+
}));
|
|
25
|
+
return luau_ast_1.default.none();
|
|
26
|
+
}
|
|
27
|
+
return luau_ast_1.default.property((0, convertToIndexableExpression_1.convertToIndexableExpression)(expression), name);
|
|
28
|
+
}
|
|
29
|
+
function transformPropertyAccessExpression(state, node) {
|
|
30
|
+
const constantValue = (0, getConstantValueLiteral_1.getConstantValueLiteral)(state, node);
|
|
31
|
+
if (constantValue) {
|
|
32
|
+
return constantValue;
|
|
33
|
+
}
|
|
34
|
+
return (0, transformOptionalChain_1.transformOptionalChain)(state, node);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=transformPropertyAccessExpression.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformSpreadElement = transformSpreadElement;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const diagnostics_1 = require("../../../Shared/diagnostics");
|
|
9
|
+
const assert_1 = require("../../../Shared/util/assert");
|
|
10
|
+
const DiagnosticService_1 = require("../../classes/DiagnosticService");
|
|
11
|
+
const transformExpression_1 = require("./transformExpression");
|
|
12
|
+
const getAddIterableToArrayBuilder_1 = require("../../util/getAddIterableToArrayBuilder");
|
|
13
|
+
const types_1 = require("../../util/types");
|
|
14
|
+
const validateNotAny_1 = require("../../util/validateNotAny");
|
|
15
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
16
|
+
function transformSpreadElement(state, node) {
|
|
17
|
+
(0, validateNotAny_1.validateNotAnyType)(state, node.expression);
|
|
18
|
+
(0, assert_1.assert)(!typescript_1.default.isArrayLiteralExpression(node.parent) && node.parent.arguments);
|
|
19
|
+
if (node.parent.arguments[node.parent.arguments.length - 1] !== node) {
|
|
20
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noPrecedingSpreadElement(node));
|
|
21
|
+
}
|
|
22
|
+
const expression = (0, transformExpression_1.transformExpression)(state, node.expression);
|
|
23
|
+
const type = state.getType(node.expression);
|
|
24
|
+
if ((0, types_1.isDefinitelyType)(type, (0, types_1.isArrayType)(state))) {
|
|
25
|
+
return luau_ast_1.default.call(luau_ast_1.default.globals.unpack, [expression]);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const addIterableToArrayBuilder = (0, getAddIterableToArrayBuilder_1.getAddIterableToArrayBuilder)(state, node.expression, type);
|
|
29
|
+
const arrayId = state.pushToVar(luau_ast_1.default.array(), "array");
|
|
30
|
+
const lengthId = state.pushToVar(luau_ast_1.default.number(0), "length");
|
|
31
|
+
state.prereqList(addIterableToArrayBuilder(state, expression, arrayId, lengthId, 0, false));
|
|
32
|
+
return luau_ast_1.default.call(luau_ast_1.default.globals.unpack, [arrayId]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=transformSpreadElement.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformStringLiteral = transformStringLiteral;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const createStringFromLiteral_1 = require("../../util/createStringFromLiteral");
|
|
9
|
+
function transformStringLiteral(state, node) {
|
|
10
|
+
return luau_ast_1.default.string((0, createStringFromLiteral_1.createStringFromLiteral)(node));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=transformStringLiteral.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformSuperKeyword = transformSuperKeyword;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
function transformSuperKeyword() {
|
|
9
|
+
return luau_ast_1.default.globals.super;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=transformSuperKeyword.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformTaggedTemplateExpression = transformTaggedTemplateExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformExpression_1 = require("./transformExpression");
|
|
9
|
+
const convertToIndexableExpression_1 = require("../../util/convertToIndexableExpression");
|
|
10
|
+
const ensureTransformOrder_1 = require("../../util/ensureTransformOrder");
|
|
11
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
12
|
+
function transformTaggedTemplateExpression(state, node) {
|
|
13
|
+
const tagExp = (0, transformExpression_1.transformExpression)(state, node.tag);
|
|
14
|
+
if (typescript_1.default.isTemplateExpression(node.template)) {
|
|
15
|
+
const strings = new Array();
|
|
16
|
+
strings.push(luau_ast_1.default.string(node.template.head.text));
|
|
17
|
+
for (const templateSpan of node.template.templateSpans) {
|
|
18
|
+
strings.push(luau_ast_1.default.string(templateSpan.literal.text));
|
|
19
|
+
}
|
|
20
|
+
const expressions = (0, ensureTransformOrder_1.ensureTransformOrder)(state, node.template.templateSpans.map(templateSpan => templateSpan.expression));
|
|
21
|
+
return luau_ast_1.default.call((0, convertToIndexableExpression_1.convertToIndexableExpression)(tagExp), [luau_ast_1.default.array(strings), ...expressions]);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return luau_ast_1.default.call((0, convertToIndexableExpression_1.convertToIndexableExpression)(tagExp), [luau_ast_1.default.array([luau_ast_1.default.string(node.template.text)])]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=transformTaggedTemplateExpression.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformTemplateExpression = transformTemplateExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformInterpolatedStringPart_1 = require("../transformInterpolatedStringPart");
|
|
9
|
+
const ensureTransformOrder_1 = require("../../util/ensureTransformOrder");
|
|
10
|
+
function transformTemplateExpression(state, node) {
|
|
11
|
+
const parts = luau_ast_1.default.list.make();
|
|
12
|
+
if (node.head.text.length > 0) {
|
|
13
|
+
luau_ast_1.default.list.push(parts, (0, transformInterpolatedStringPart_1.transformInterpolatedStringPart)(node.head));
|
|
14
|
+
}
|
|
15
|
+
const orderedExpressions = (0, ensureTransformOrder_1.ensureTransformOrder)(state, node.templateSpans.map(templateSpan => templateSpan.expression));
|
|
16
|
+
for (let i = 0; i < node.templateSpans.length; i++) {
|
|
17
|
+
luau_ast_1.default.list.push(parts, orderedExpressions[i]);
|
|
18
|
+
const templateSpan = node.templateSpans[i];
|
|
19
|
+
if (templateSpan.literal.text.length > 0) {
|
|
20
|
+
luau_ast_1.default.list.push(parts, (0, transformInterpolatedStringPart_1.transformInterpolatedStringPart)(templateSpan.literal));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.InterpolatedString, { parts });
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=transformTemplateExpression.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformThisExpression = transformThisExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const diagnostics_1 = require("../../../Shared/diagnostics");
|
|
9
|
+
const TSTransformer_1 = require("../..");
|
|
10
|
+
const DiagnosticService_1 = require("../../classes/DiagnosticService");
|
|
11
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
12
|
+
function transformThisExpression(state, node) {
|
|
13
|
+
const symbol = state.typeChecker.getSymbolAtLocation(node);
|
|
14
|
+
if (symbol === state.services.macroManager.getSymbolOrThrow(TSTransformer_1.SYMBOL_NAMES.globalThis)) {
|
|
15
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noGlobalThis(node));
|
|
16
|
+
}
|
|
17
|
+
if (symbol) {
|
|
18
|
+
const container = typescript_1.default.getThisContainer(node, false, false);
|
|
19
|
+
const isStatic = typescript_1.default.hasStaticModifier(container) || typescript_1.default.isClassStaticBlockDeclaration(container);
|
|
20
|
+
if (isStatic && !typescript_1.default.isMethodDeclaration(container) && typescript_1.default.isClassLike(container.parent)) {
|
|
21
|
+
const identifier = state.classIdentifierMap.get(container.parent);
|
|
22
|
+
if (identifier) {
|
|
23
|
+
return identifier;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return luau_ast_1.default.globals.self;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=transformThisExpression.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TransformState } from "../..";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
export declare function transformTypeExpression(state: TransformState, node: ts.AsExpression | ts.NonNullExpression | ts.SatisfiesExpression | ts.TypeAssertion | ts.ExpressionWithTypeArguments): import("@roblox-ts/luau-ast/out/LuauAST/bundle").Expression<import("@roblox-ts/luau-ast/out/LuauAST/bundle").SyntaxKind>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformTypeExpression = transformTypeExpression;
|
|
4
|
+
const transformExpression_1 = require("./transformExpression");
|
|
5
|
+
function transformTypeExpression(state, node) {
|
|
6
|
+
return (0, transformExpression_1.transformExpression)(state, node.expression);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=transformTypeExpression.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformPostfixUnaryExpression(state: TransformState, node: ts.PostfixUnaryExpression): luau.TemporaryIdentifier;
|
|
5
|
+
export declare function transformPrefixUnaryExpression(state: TransformState, node: ts.PrefixUnaryExpression): luau.Identifier | luau.TemporaryIdentifier | luau.ComputedIndexExpression | luau.PropertyAccessExpression | luau.CallExpression | luau.MethodCallExpression | luau.ParenthesizedExpression | luau.None | luau.NilLiteral | luau.FalseLiteral | luau.TrueLiteral | luau.NumberLiteral | luau.StringLiteral | luau.VarArgsLiteral | luau.FunctionExpression | luau.BinaryExpression | luau.UnaryExpression | luau.IfExpression | luau.InterpolatedString | luau.Array | luau.Map | luau.Set | luau.MixedTable;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformPostfixUnaryExpression = transformPostfixUnaryExpression;
|
|
7
|
+
exports.transformPrefixUnaryExpression = transformPrefixUnaryExpression;
|
|
8
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
9
|
+
const diagnostics_1 = require("../../../Shared/diagnostics");
|
|
10
|
+
const DiagnosticService_1 = require("../../classes/DiagnosticService");
|
|
11
|
+
const transformExpression_1 = require("./transformExpression");
|
|
12
|
+
const transformWritable_1 = require("../transformWritable");
|
|
13
|
+
const assertNever_1 = require("../../util/assertNever");
|
|
14
|
+
const createTruthinessChecks_1 = require("../../util/createTruthinessChecks");
|
|
15
|
+
const types_1 = require("../../util/types");
|
|
16
|
+
const validateNotAny_1 = require("../../util/validateNotAny");
|
|
17
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
18
|
+
function transformPostfixUnaryExpression(state, node) {
|
|
19
|
+
(0, validateNotAny_1.validateNotAnyType)(state, node.operand);
|
|
20
|
+
const writable = (0, transformWritable_1.transformWritableExpression)(state, node.operand, true);
|
|
21
|
+
const origValue = luau_ast_1.default.tempId("original");
|
|
22
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.VariableDeclaration, {
|
|
23
|
+
left: origValue,
|
|
24
|
+
right: writable,
|
|
25
|
+
}));
|
|
26
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.Assignment, {
|
|
27
|
+
left: writable,
|
|
28
|
+
operator: node.operator === typescript_1.default.SyntaxKind.PlusPlusToken
|
|
29
|
+
? "+="
|
|
30
|
+
: node.operator === typescript_1.default.SyntaxKind.MinusMinusToken
|
|
31
|
+
? "-="
|
|
32
|
+
: (0, assertNever_1.assertNever)(node.operator, "transformPostfixUnaryExpression"),
|
|
33
|
+
right: luau_ast_1.default.number(1),
|
|
34
|
+
}));
|
|
35
|
+
return origValue;
|
|
36
|
+
}
|
|
37
|
+
function transformPrefixUnaryExpression(state, node) {
|
|
38
|
+
(0, validateNotAny_1.validateNotAnyType)(state, node.operand);
|
|
39
|
+
if (node.operator === typescript_1.default.SyntaxKind.PlusPlusToken || node.operator === typescript_1.default.SyntaxKind.MinusMinusToken) {
|
|
40
|
+
const writable = (0, transformWritable_1.transformWritableExpression)(state, node.operand, true);
|
|
41
|
+
const operator = node.operator === typescript_1.default.SyntaxKind.PlusPlusToken ? "+=" : "-=";
|
|
42
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.Assignment, {
|
|
43
|
+
left: writable,
|
|
44
|
+
operator,
|
|
45
|
+
right: luau_ast_1.default.number(1),
|
|
46
|
+
}));
|
|
47
|
+
return writable;
|
|
48
|
+
}
|
|
49
|
+
else if (node.operator === typescript_1.default.SyntaxKind.PlusToken) {
|
|
50
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noUnaryPlus(node));
|
|
51
|
+
return (0, transformExpression_1.transformExpression)(state, node.operand);
|
|
52
|
+
}
|
|
53
|
+
else if (node.operator === typescript_1.default.SyntaxKind.MinusToken) {
|
|
54
|
+
if (!(0, types_1.isDefinitelyType)(state.getType(node.operand), types_1.isNumberType)) {
|
|
55
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noNonNumberUnaryMinus(node));
|
|
56
|
+
}
|
|
57
|
+
return luau_ast_1.default.unary("-", (0, transformExpression_1.transformExpression)(state, node.operand));
|
|
58
|
+
}
|
|
59
|
+
else if (node.operator === typescript_1.default.SyntaxKind.ExclamationToken) {
|
|
60
|
+
const checks = (0, createTruthinessChecks_1.createTruthinessChecks)(state, (0, transformExpression_1.transformExpression)(state, node.operand), node.operand);
|
|
61
|
+
return luau_ast_1.default.unary("not", checks);
|
|
62
|
+
}
|
|
63
|
+
else if (node.operator === typescript_1.default.SyntaxKind.TildeToken) {
|
|
64
|
+
return luau_ast_1.default.call(luau_ast_1.default.property(luau_ast_1.default.globals.bit32, "bnot"), [(0, transformExpression_1.transformExpression)(state, node.operand)]);
|
|
65
|
+
}
|
|
66
|
+
return (0, assertNever_1.assertNever)(node.operator, "transformPrefixUnaryExpression");
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=transformUnaryExpression.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformVoidExpression = transformVoidExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformExpressionStatement_1 = require("../statements/transformExpressionStatement");
|
|
9
|
+
const traversal_1 = require("../../util/traversal");
|
|
10
|
+
function transformVoidExpression(state, node) {
|
|
11
|
+
state.prereqList((0, transformExpressionStatement_1.transformExpressionStatementInner)(state, (0, traversal_1.skipDownwards)(node.expression)));
|
|
12
|
+
return luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.NilLiteral, {});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=transformVoidExpression.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../../classes/TransformState";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformYieldExpression(state: TransformState, node: ts.YieldExpression): luau.TemporaryIdentifier | luau.CallExpression | luau.None;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformYieldExpression = transformYieldExpression;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const transformExpression_1 = require("./transformExpression");
|
|
9
|
+
const convertToIndexableExpression_1 = require("../../util/convertToIndexableExpression");
|
|
10
|
+
const isUsedAsStatement_1 = require("../../util/isUsedAsStatement");
|
|
11
|
+
function transformYieldExpression(state, node) {
|
|
12
|
+
if (!node.expression) {
|
|
13
|
+
return luau_ast_1.default.call(luau_ast_1.default.globals.coroutine.yield, []);
|
|
14
|
+
}
|
|
15
|
+
const expression = (0, transformExpression_1.transformExpression)(state, node.expression);
|
|
16
|
+
if (node.asteriskToken) {
|
|
17
|
+
const loopId = luau_ast_1.default.tempId("result");
|
|
18
|
+
const finalizer = luau_ast_1.default.list.make(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.BreakStatement, {}));
|
|
19
|
+
let evaluated = luau_ast_1.default.none();
|
|
20
|
+
if (!(0, isUsedAsStatement_1.isUsedAsStatement)(node)) {
|
|
21
|
+
const returnValue = state.pushToVar(undefined, "returnValue");
|
|
22
|
+
luau_ast_1.default.list.unshift(finalizer, luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.Assignment, {
|
|
23
|
+
left: returnValue,
|
|
24
|
+
operator: "=",
|
|
25
|
+
right: luau_ast_1.default.property(loopId, "value"),
|
|
26
|
+
}));
|
|
27
|
+
evaluated = returnValue;
|
|
28
|
+
}
|
|
29
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.ForStatement, {
|
|
30
|
+
ids: luau_ast_1.default.list.make(loopId),
|
|
31
|
+
expression: luau_ast_1.default.property((0, convertToIndexableExpression_1.convertToIndexableExpression)(expression), "next"),
|
|
32
|
+
statements: luau_ast_1.default.list.make(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.IfStatement, {
|
|
33
|
+
condition: luau_ast_1.default.property(loopId, "done"),
|
|
34
|
+
statements: finalizer,
|
|
35
|
+
elseBody: luau_ast_1.default.list.make(),
|
|
36
|
+
}), luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.CallStatement, {
|
|
37
|
+
expression: luau_ast_1.default.call(luau_ast_1.default.globals.coroutine.yield, [luau_ast_1.default.property(loopId, "value")]),
|
|
38
|
+
})),
|
|
39
|
+
}));
|
|
40
|
+
return evaluated;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return luau_ast_1.default.call(luau_ast_1.default.globals.coroutine.yield, [expression]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=transformYieldExpression.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../..";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformJsx(state: TransformState, node: ts.JsxElement | ts.JsxSelfClosingElement, tagName: ts.JsxTagNameExpression, attributes: ts.JsxAttributes, children: ReadonlyArray<ts.JsxChild>): luau.CallExpression;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformJsx = transformJsx;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const assert_1 = require("../../../Shared/util/assert");
|
|
9
|
+
const transformJsxAttributes_1 = require("./transformJsxAttributes");
|
|
10
|
+
const transformJsxChildren_1 = require("./transformJsxChildren");
|
|
11
|
+
const transformJsxTagName_1 = require("./transformJsxTagName");
|
|
12
|
+
const transformEntityName_1 = require("../transformEntityName");
|
|
13
|
+
const convertToIndexableExpression_1 = require("../../util/convertToIndexableExpression");
|
|
14
|
+
const pointer_1 = require("../../util/pointer");
|
|
15
|
+
function transformJsx(state, node, tagName, attributes, children) {
|
|
16
|
+
const jsxFactoryEntity = state.resolver.getJsxFactoryEntity(node);
|
|
17
|
+
(0, assert_1.assert)(jsxFactoryEntity, "Expected jsxFactoryEntity to be defined");
|
|
18
|
+
const createElementExpression = (0, convertToIndexableExpression_1.convertToIndexableExpression)((0, transformEntityName_1.transformEntityName)(state, jsxFactoryEntity));
|
|
19
|
+
const tagNameExp = (0, transformJsxTagName_1.transformJsxTagName)(state, tagName);
|
|
20
|
+
let attributesPtr;
|
|
21
|
+
if (attributes.properties.length > 0) {
|
|
22
|
+
attributesPtr = (0, pointer_1.createMapPointer)("attributes");
|
|
23
|
+
(0, transformJsxAttributes_1.transformJsxAttributes)(state, attributes, attributesPtr);
|
|
24
|
+
}
|
|
25
|
+
const transformedChildren = (0, transformJsxChildren_1.transformJsxChildren)(state, children);
|
|
26
|
+
const args = [tagNameExp];
|
|
27
|
+
if (attributesPtr) {
|
|
28
|
+
args.push(attributesPtr.value);
|
|
29
|
+
}
|
|
30
|
+
else if (transformedChildren.length > 0) {
|
|
31
|
+
args.push(luau_ast_1.default.nil());
|
|
32
|
+
}
|
|
33
|
+
args.push(...transformedChildren);
|
|
34
|
+
return luau_ast_1.default.call(createElementExpression, args);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=transformJsx.js.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformJsxAttributes = transformJsxAttributes;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const diagnostics_1 = require("../../../Shared/diagnostics");
|
|
9
|
+
const DiagnosticService_1 = require("../../classes/DiagnosticService");
|
|
10
|
+
const transformExpression_1 = require("../expressions/transformExpression");
|
|
11
|
+
const createTruthinessChecks_1 = require("../../util/createTruthinessChecks");
|
|
12
|
+
const pointer_1 = require("../../util/pointer");
|
|
13
|
+
const types_1 = require("../../util/types");
|
|
14
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
15
|
+
function createJsxAttributeLoop(state, attributesPtrValue, expression, tsExpression) {
|
|
16
|
+
const definitelyObject = (0, types_1.isDefinitelyType)(state.getType(tsExpression), types_1.isObjectType);
|
|
17
|
+
if (!definitelyObject) {
|
|
18
|
+
expression = state.pushToVarIfComplex(expression, "attribute");
|
|
19
|
+
}
|
|
20
|
+
const keyId = luau_ast_1.default.tempId("k");
|
|
21
|
+
const valueId = luau_ast_1.default.tempId("v");
|
|
22
|
+
let statement = luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.ForStatement, {
|
|
23
|
+
ids: luau_ast_1.default.list.make(keyId, valueId),
|
|
24
|
+
expression,
|
|
25
|
+
statements: luau_ast_1.default.list.make(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.Assignment, {
|
|
26
|
+
left: luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.ComputedIndexExpression, {
|
|
27
|
+
expression: attributesPtrValue,
|
|
28
|
+
index: keyId,
|
|
29
|
+
}),
|
|
30
|
+
operator: "=",
|
|
31
|
+
right: valueId,
|
|
32
|
+
})),
|
|
33
|
+
});
|
|
34
|
+
if (!definitelyObject) {
|
|
35
|
+
statement = luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.IfStatement, {
|
|
36
|
+
condition: (0, createTruthinessChecks_1.createTruthinessChecks)(state, expression, tsExpression),
|
|
37
|
+
statements: luau_ast_1.default.list.make(statement),
|
|
38
|
+
elseBody: luau_ast_1.default.list.make(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return statement;
|
|
42
|
+
}
|
|
43
|
+
function transformJsxAttribute(state, attribute, attributesPtr) {
|
|
44
|
+
let initializer = attribute.initializer;
|
|
45
|
+
if (initializer && typescript_1.default.isJsxExpression(initializer)) {
|
|
46
|
+
initializer = initializer.expression;
|
|
47
|
+
}
|
|
48
|
+
const [init, initPrereqs] = initializer
|
|
49
|
+
? state.capture(() => (0, transformExpression_1.transformExpression)(state, initializer))
|
|
50
|
+
: [luau_ast_1.default.bool(true), luau_ast_1.default.list.make()];
|
|
51
|
+
if (!luau_ast_1.default.list.isEmpty(initPrereqs)) {
|
|
52
|
+
(0, pointer_1.disableMapInline)(state, attributesPtr);
|
|
53
|
+
state.prereqList(initPrereqs);
|
|
54
|
+
}
|
|
55
|
+
const text = typescript_1.default.isIdentifier(attribute.name) ? attribute.name.text : typescript_1.default.getTextOfJsxNamespacedName(attribute.name);
|
|
56
|
+
const name = luau_ast_1.default.string(text);
|
|
57
|
+
(0, pointer_1.assignToMapPointer)(state, attributesPtr, name, init);
|
|
58
|
+
}
|
|
59
|
+
function transformJsxAttributes(state, attributes, attributesPtr) {
|
|
60
|
+
for (const attribute of attributes.properties) {
|
|
61
|
+
if (typescript_1.default.isJsxAttribute(attribute)) {
|
|
62
|
+
transformJsxAttribute(state, attribute, attributesPtr);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const expType = state.typeChecker.getNonOptionalType(state.getType(attribute.expression));
|
|
66
|
+
const symbol = (0, types_1.getFirstDefinedSymbol)(state, expType);
|
|
67
|
+
if (symbol && state.services.macroManager.isMacroOnlyClass(symbol)) {
|
|
68
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noMacroObjectSpread(attribute));
|
|
69
|
+
}
|
|
70
|
+
const expression = (0, transformExpression_1.transformExpression)(state, attribute.expression);
|
|
71
|
+
if (attribute === attributes.properties[0] && (0, types_1.isDefinitelyType)(expType, types_1.isObjectType)) {
|
|
72
|
+
attributesPtr.value = state.pushToVar(luau_ast_1.default.call(luau_ast_1.default.globals.table.clone, [expression]), attributesPtr.name);
|
|
73
|
+
state.prereq(luau_ast_1.default.create(luau_ast_1.default.SyntaxKind.CallStatement, {
|
|
74
|
+
expression: luau_ast_1.default.call(luau_ast_1.default.globals.setmetatable, [attributesPtr.value, luau_ast_1.default.nil()]),
|
|
75
|
+
}));
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
(0, pointer_1.disableMapInline)(state, attributesPtr);
|
|
79
|
+
state.prereq(createJsxAttributeLoop(state, attributesPtr.value, expression, attribute.expression));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=transformJsxAttributes.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import luau from "@roblox-ts/luau-ast";
|
|
2
|
+
import { TransformState } from "../../classes/TransformState";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export declare function transformJsxChildren(state: TransformState, children: ReadonlyArray<ts.JsxChild>): luau.Expression<luau.SyntaxKind>[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.transformJsxChildren = transformJsxChildren;
|
|
7
|
+
const luau_ast_1 = __importDefault(require("@roblox-ts/luau-ast"));
|
|
8
|
+
const diagnostics_1 = require("../../../Shared/diagnostics");
|
|
9
|
+
const findLastIndex_1 = require("../../../Shared/util/findLastIndex");
|
|
10
|
+
const DiagnosticService_1 = require("../../classes/DiagnosticService");
|
|
11
|
+
const transformExpression_1 = require("../expressions/transformExpression");
|
|
12
|
+
const ensureTransformOrder_1 = require("../../util/ensureTransformOrder");
|
|
13
|
+
const fixupWhitespaceAndDecodeEntities_1 = require("../../util/fixupWhitespaceAndDecodeEntities");
|
|
14
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
15
|
+
function transformJsxChildren(state, children) {
|
|
16
|
+
const lastJsxChildIndex = (0, findLastIndex_1.findLastIndex)(children, child => !typescript_1.default.isJsxText(child) || !child.containsOnlyTriviaWhiteSpaces);
|
|
17
|
+
for (let i = 0; i < lastJsxChildIndex; i++) {
|
|
18
|
+
const child = children[i];
|
|
19
|
+
if (typescript_1.default.isJsxExpression(child) && child.dotDotDotToken) {
|
|
20
|
+
DiagnosticService_1.DiagnosticService.addDiagnostic(diagnostics_1.errors.noPrecedingJsxSpreadElement(child));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return (0, ensureTransformOrder_1.ensureTransformOrder)(state, children
|
|
24
|
+
.filter(v => !typescript_1.default.isJsxText(v) || !v.containsOnlyTriviaWhiteSpaces)
|
|
25
|
+
.filter(v => !typescript_1.default.isJsxExpression(v) || v.expression !== undefined), (state, node) => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (typescript_1.default.isJsxText(node)) {
|
|
28
|
+
const text = (_a = (0, fixupWhitespaceAndDecodeEntities_1.fixupWhitespaceAndDecodeEntities)(node.text)) !== null && _a !== void 0 ? _a : "";
|
|
29
|
+
return luau_ast_1.default.string(text.replace(/\\/g, "\\\\"));
|
|
30
|
+
}
|
|
31
|
+
return (0, transformExpression_1.transformExpression)(state, node);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=transformJsxChildren.js.map
|