brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50
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 +76 -138
- package/bsconfig.schema.json +121 -5
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +45 -0
- package/dist/AstValidationSegmenter.js +322 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +72 -39
- package/dist/BusyStatusTracker.d.ts +61 -0
- package/dist/BusyStatusTracker.js +148 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +3 -8
- package/dist/Cache.js +9 -14
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +12 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +11 -8
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +642 -0
- package/dist/CrossScopeValidator.js.map +1 -0
- package/dist/DependencyGraph.d.ts +8 -3
- package/dist/DependencyGraph.js +49 -16
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +21 -5
- package/dist/DiagnosticCollection.js +77 -24
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +27 -6
- package/dist/DiagnosticFilterer.js +273 -60
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +82 -0
- package/dist/DiagnosticManager.js +406 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +558 -196
- package/dist/DiagnosticMessages.js +870 -340
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +45 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +100 -105
- package/dist/LanguageServer.js +444 -745
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +17 -13
- package/dist/Logger.js +64 -34
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +32 -10
- package/dist/PluginInterface.js +117 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +241 -98
- package/dist/Program.js +1432 -717
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +47 -23
- package/dist/ProgramBuilder.js +224 -178
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +149 -109
- package/dist/Scope.js +557 -550
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.js +5 -1
- package/dist/SemanticTokenUtils.js.map +1 -1
- package/dist/Stopwatch.d.ts +4 -0
- package/dist/Stopwatch.js +8 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +136 -24
- package/dist/SymbolTable.js +565 -64
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTypeFlag.d.ts +9 -0
- package/dist/SymbolTypeFlag.js +14 -0
- package/dist/SymbolTypeFlag.js.map +1 -0
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +5 -15
- package/dist/XmlScope.js +34 -90
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +334 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/CachedLookups.spec.js +39 -0
- package/dist/astUtils/CachedLookups.spec.js.map +1 -0
- package/dist/astUtils/Editor.d.ts +69 -0
- package/dist/astUtils/Editor.js +245 -0
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/Editor.spec.js +258 -0
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +54 -19
- package/dist/astUtils/creators.js +242 -42
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +196 -85
- package/dist/astUtils/reflection.js +497 -144
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -167
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +14 -14
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +116 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +629 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +12 -7
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +24 -4
- package/dist/bscPlugin/BscPlugin.js +88 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +143 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +6 -5
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +212 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +230 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
- package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
- package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +164 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +564 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
- package/dist/bscPlugin/serialize/BslibManager.js +46 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
- package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +37 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +638 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1517 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +141 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1323 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +6135 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +36 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +126 -27
- package/dist/cli.js.map +1 -1
- package/dist/common/Sequencer.d.ts +53 -0
- package/dist/common/Sequencer.js +233 -0
- package/dist/common/Sequencer.js.map +1 -0
- package/dist/common/Sequencer.spec.d.ts +1 -0
- package/dist/common/Sequencer.spec.js +75 -0
- package/dist/common/Sequencer.spec.js.map +1 -0
- package/dist/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +10 -3
- package/dist/diagnosticUtils.js +64 -25
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.d.ts +2 -2
- package/dist/examples/plugins/removePrint.js +8 -12
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +24 -0
- package/dist/files/AssetFile.js +25 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +1213 -259
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +145 -87
- package/dist/files/BrsFile.js +836 -934
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +4226 -902
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +102 -0
- package/dist/files/BscFile.js +15 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +21 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +80 -41
- package/dist/files/XmlFile.js +161 -137
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +444 -336
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +62 -52
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
- package/dist/files/tests/optionalChaning.spec.js +152 -0
- package/dist/files/tests/optionalChaning.spec.js.map +1 -0
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +424 -184
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +32 -4
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +942 -125
- package/dist/interfaces.js +21 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +51 -12
- package/dist/lexer/Lexer.js +215 -65
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +812 -568
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +27 -11
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +40 -2
- package/dist/lexer/TokenKind.js +147 -10
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +14 -0
- package/dist/logging.js +29 -0
- package/dist/logging.js.map +1 -0
- package/dist/lsp/ActionQueue.d.ts +35 -0
- package/dist/lsp/ActionQueue.js +115 -0
- package/dist/lsp/ActionQueue.js.map +1 -0
- package/dist/lsp/ActionQueue.spec.d.ts +1 -0
- package/dist/lsp/ActionQueue.spec.js +80 -0
- package/dist/lsp/ActionQueue.spec.js.map +1 -0
- package/dist/lsp/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/DocumentManager.spec.d.ts +1 -0
- package/dist/lsp/DocumentManager.spec.js +103 -0
- package/dist/lsp/DocumentManager.spec.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +239 -0
- package/dist/lsp/LspProject.js +3 -0
- package/dist/lsp/LspProject.js.map +1 -0
- package/dist/lsp/PathFilterer.d.ts +75 -0
- package/dist/lsp/PathFilterer.js +196 -0
- package/dist/lsp/PathFilterer.js.map +1 -0
- package/dist/lsp/PathFilterer.spec.d.ts +1 -0
- package/dist/lsp/PathFilterer.spec.js +182 -0
- package/dist/lsp/PathFilterer.spec.js.map +1 -0
- package/dist/lsp/Project.d.ts +168 -0
- package/dist/lsp/Project.js +437 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/Project.spec.d.ts +1 -0
- package/dist/lsp/Project.spec.js +267 -0
- package/dist/lsp/Project.spec.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +242 -0
- package/dist/lsp/ProjectManager.js +824 -0
- package/dist/lsp/ProjectManager.js.map +1 -0
- package/dist/lsp/ProjectManager.spec.d.ts +1 -0
- package/dist/lsp/ProjectManager.spec.js +913 -0
- package/dist/lsp/ProjectManager.spec.js.map +1 -0
- package/dist/lsp/ReaderWriterManager.d.ts +21 -0
- package/dist/lsp/ReaderWriterManager.js +60 -0
- package/dist/lsp/ReaderWriterManager.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.d.ts +99 -0
- package/dist/lsp/worker/MessageHandler.js +138 -0
- package/dist/lsp/worker/MessageHandler.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
- package/dist/lsp/worker/MessageHandler.spec.js +64 -0
- package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.d.ts +38 -0
- package/dist/lsp/worker/WorkerPool.js +78 -0
- package/dist/lsp/worker/WorkerPool.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
- package/dist/lsp/worker/WorkerPool.spec.js +59 -0
- package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
- package/dist/lsp/worker/WorkerThreadProject.js +189 -0
- package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
- package/dist/lsp/worker/run.d.ts +1 -0
- package/dist/lsp/worker/run.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +203 -0
- package/dist/parser/AstNode.js +303 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +1455 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.d.ts +56 -0
- package/dist/parser/BrightScriptDocParser.js +294 -0
- package/dist/parser/BrightScriptDocParser.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
- package/dist/parser/BrightScriptDocParser.spec.js +310 -0
- package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +22 -3
- package/dist/parser/BrsTranspileState.js +19 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +553 -221
- package/dist/parser/Expression.js +1414 -505
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Expression.spec.d.ts +1 -0
- package/dist/parser/Expression.spec.js +40 -0
- package/dist/parser/Expression.spec.js.map +1 -0
- package/dist/parser/Parser.Class.spec.js +255 -125
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +117 -124
- package/dist/parser/Parser.js +1669 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +2111 -525
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +29 -13
- package/dist/parser/SGParser.js +85 -56
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -45
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +134 -46
- package/dist/parser/SGTypes.js +206 -115
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +849 -267
- package/dist/parser/Statement.js +2412 -625
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +133 -36
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +26 -12
- package/dist/parser/TranspileState.js +115 -24
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +3 -9
- package/dist/parser/tests/Parser.spec.js +7 -13
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +83 -75
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +382 -239
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +52 -45
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +51 -43
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +41 -34
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +173 -55
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +20 -20
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +291 -282
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +193 -110
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +76 -60
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +50 -50
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +281 -94
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +44 -44
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +500 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +61 -55
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +29 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Enum.spec.js +744 -0
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
- package/dist/parser/tests/statement/For.spec.d.ts +1 -0
- package/dist/parser/tests/statement/For.spec.js +45 -0
- package/dist/parser/tests/statement/For.spec.js.map +1 -0
- package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ForEach.spec.js +36 -0
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
- package/dist/parser/tests/statement/Function.spec.js +226 -215
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +16 -15
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +64 -61
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +127 -168
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +131 -117
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +14 -13
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +11 -8
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +6 -6
- package/dist/preprocessor/Manifest.js +17 -38
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.d.ts +1 -0
- package/dist/preprocessor/Manifest.spec.js +78 -103
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/roku-types/data.json +20347 -0
- package/dist/roku-types/index.d.ts +5726 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +12 -5
- package/dist/types/ArrayType.js +89 -24
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +39 -11
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +15 -0
- package/dist/types/AssociativeArrayType.js +64 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +10 -0
- package/dist/types/BaseFunctionType.js +26 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +9 -5
- package/dist/types/BooleanType.js +19 -8
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -4
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +41 -3
- package/dist/types/BscType.js +152 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +28 -0
- package/dist/types/BscTypeKind.js +33 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
- package/dist/types/BuiltInInterfaceAdder.js +212 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/CallFuncableType.d.ts +24 -0
- package/dist/types/CallFuncableType.js +91 -0
- package/dist/types/CallFuncableType.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +60 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +76 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +22 -0
- package/dist/types/ComponentType.js +107 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +21 -17
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -4
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +13 -5
- package/dist/types/DynamicType.js +26 -5
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +42 -0
- package/dist/types/EnumType.js +98 -0
- package/dist/types/EnumType.js.map +1 -0
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +10 -5
- package/dist/types/FloatType.js +21 -17
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -4
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +8 -22
- package/dist/types/FunctionType.js +25 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +29 -0
- package/dist/types/InheritableType.js +173 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/InlineInterfaceType.d.ts +5 -0
- package/dist/types/InlineInterfaceType.js +17 -0
- package/dist/types/InlineInterfaceType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +21 -17
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -4
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +30 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +227 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +253 -0
- package/dist/types/IntersectionType.js.map +1 -0
- package/dist/types/IntersectionType.spec.d.ts +1 -0
- package/dist/types/IntersectionType.spec.js +150 -0
- package/dist/types/IntersectionType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +10 -5
- package/dist/types/InvalidType.js +21 -9
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -4
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +21 -17
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -4
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +12 -5
- package/dist/types/ObjectType.js +25 -8
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +123 -0
- package/dist/types/ReferenceType.js +720 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +151 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +12 -5
- package/dist/types/StringType.js +23 -8
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -3
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypeStatementType.d.ts +18 -0
- package/dist/types/TypeStatementType.js +45 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +147 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +122 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.d.ts +11 -6
- package/dist/types/UninitializedType.js +20 -11
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +27 -0
- package/dist/types/UnionType.js +193 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +205 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +11 -5
- package/dist/types/VoidType.js +22 -8
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +174 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +51 -0
- package/dist/types/helpers.js +323 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/roFunctionType.d.ts +11 -0
- package/dist/types/roFunctionType.js +37 -0
- package/dist/types/roFunctionType.js.map +1 -0
- package/dist/types/roFunctionType.spec.d.ts +1 -0
- package/dist/types/roFunctionType.spec.js +20 -0
- package/dist/types/roFunctionType.spec.js.map +1 -0
- package/dist/util.d.ts +288 -187
- package/dist/util.js +2018 -575
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +93 -138
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +185 -138
- package/CHANGELOG.md +0 -1188
- package/dist/astUtils/index.d.ts +0 -7
- package/dist/astUtils/index.js +0 -26
- package/dist/astUtils/index.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
- package/dist/lexer/index.d.ts +0 -3
- package/dist/lexer/index.js +0 -17
- package/dist/lexer/index.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.js +0 -16
- package/dist/parser/index.js.map +0 -1
- package/dist/preprocessor/Chunk.d.ts +0 -82
- package/dist/preprocessor/Chunk.js +0 -77
- package/dist/preprocessor/Chunk.js.map +0 -1
- package/dist/preprocessor/Preprocessor.d.ts +0 -60
- package/dist/preprocessor/Preprocessor.js +0 -156
- package/dist/preprocessor/Preprocessor.js.map +0 -1
- package/dist/preprocessor/Preprocessor.spec.js +0 -152
- package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
- package/dist/preprocessor/PreprocessorParser.js +0 -194
- package/dist/preprocessor/PreprocessorParser.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
- package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
- package/dist/preprocessor/index.d.ts +0 -3
- package/dist/preprocessor/index.js +0 -16
- package/dist/preprocessor/index.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -10
- package/dist/types/CustomType.js +0 -35
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -15
- package/dist/types/LazyType.js +0 -32
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
|
@@ -1,382 +1,657 @@
|
|
|
1
|
-
import type { Token, Identifier } from '../lexer';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import type { Token, Identifier } from '../lexer/Token';
|
|
2
|
+
import type { DottedGetExpression, FunctionParameterExpression, TypecastExpression, TypeExpression } from './Expression';
|
|
3
|
+
import { FunctionExpression } from './Expression';
|
|
4
|
+
import { VariableExpression } from './Expression';
|
|
5
|
+
import type { Location } from 'vscode-languageserver';
|
|
5
6
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
6
7
|
import { ParseMode } from './Parser';
|
|
7
8
|
import type { WalkVisitor, WalkOptions } from '../astUtils/visitors';
|
|
8
|
-
import {
|
|
9
|
-
import type
|
|
9
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
10
|
+
import { type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
11
|
+
import type { BscType } from '../types/BscType';
|
|
10
12
|
import { SymbolTable } from '../SymbolTable';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
**/
|
|
18
|
-
abstract range: Range;
|
|
19
|
-
/**
|
|
20
|
-
* Statement annotations
|
|
21
|
-
*/
|
|
22
|
-
annotations: AnnotationExpression[];
|
|
23
|
-
abstract transpile(state: BrsTranspileState): TranspileResult;
|
|
24
|
-
/**
|
|
25
|
-
* When being considered by the walk visitor, this describes what type of element the current class is.
|
|
26
|
-
*/
|
|
27
|
-
visitMode: InternalWalkMode;
|
|
28
|
-
abstract walk(visitor: WalkVisitor, options: WalkOptions): any;
|
|
29
|
-
}
|
|
13
|
+
import type { Expression } from './AstNode';
|
|
14
|
+
import { AstNodeKind, Statement } from './AstNode';
|
|
15
|
+
import { ClassType } from '../types/ClassType';
|
|
16
|
+
import { NamespaceType } from '../types/NamespaceType';
|
|
17
|
+
import { InterfaceType } from '../types/InterfaceType';
|
|
18
|
+
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
30
19
|
export declare class EmptyStatement extends Statement {
|
|
20
|
+
constructor(options?: {
|
|
21
|
+
range?: Location;
|
|
22
|
+
});
|
|
31
23
|
/**
|
|
32
24
|
* Create a negative range to indicate this is an interpolated location
|
|
33
25
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Create a negative range to indicate this is an interpolated location
|
|
38
|
-
*/
|
|
39
|
-
range?: Range);
|
|
26
|
+
readonly location?: Location;
|
|
27
|
+
readonly kind = AstNodeKind.EmptyStatement;
|
|
40
28
|
transpile(state: BrsTranspileState): any[];
|
|
41
29
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
30
|
+
clone(): EmptyStatement;
|
|
42
31
|
}
|
|
43
32
|
/**
|
|
44
33
|
* This is a top-level statement. Consider this the root of the AST
|
|
45
34
|
*/
|
|
46
35
|
export declare class Body extends Statement implements TypedefProvider {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
constructor(options?: {
|
|
37
|
+
statements?: Statement[];
|
|
38
|
+
});
|
|
39
|
+
readonly statements: Statement[];
|
|
40
|
+
readonly kind = AstNodeKind.Body;
|
|
41
|
+
readonly symbolTable: SymbolTable;
|
|
42
|
+
get location(): Location;
|
|
43
|
+
set location(value: Location);
|
|
44
|
+
private _location;
|
|
50
45
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
51
|
-
getTypedef(state: BrsTranspileState):
|
|
46
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
52
47
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
48
|
+
clone(): Body;
|
|
53
49
|
}
|
|
54
50
|
export declare class AssignmentStatement extends Statement {
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
constructor(options: {
|
|
52
|
+
name: Identifier;
|
|
53
|
+
equals?: Token;
|
|
54
|
+
value: Expression;
|
|
55
|
+
as?: Token;
|
|
56
|
+
typeExpression?: TypeExpression;
|
|
57
|
+
});
|
|
58
|
+
readonly tokens: {
|
|
59
|
+
readonly equals?: Token;
|
|
60
|
+
readonly name: Identifier;
|
|
61
|
+
readonly as?: Token;
|
|
62
|
+
};
|
|
57
63
|
readonly value: Expression;
|
|
58
|
-
readonly
|
|
59
|
-
|
|
60
|
-
readonly
|
|
61
|
-
transpile(state: BrsTranspileState): TranspileResult;
|
|
64
|
+
readonly typeExpression?: TypeExpression;
|
|
65
|
+
readonly kind = AstNodeKind.AssignmentStatement;
|
|
66
|
+
readonly location: Location | undefined;
|
|
67
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode | TranspileResult)[];
|
|
62
68
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
69
|
+
getType(options: GetTypeOptions): BscType;
|
|
70
|
+
get leadingTrivia(): Token[];
|
|
71
|
+
clone(): AssignmentStatement;
|
|
72
|
+
}
|
|
73
|
+
export declare class AugmentedAssignmentStatement extends Statement {
|
|
74
|
+
constructor(options: {
|
|
75
|
+
item: Expression;
|
|
76
|
+
operator: Token;
|
|
77
|
+
value: Expression;
|
|
78
|
+
});
|
|
79
|
+
readonly tokens: {
|
|
80
|
+
readonly operator?: Token;
|
|
81
|
+
};
|
|
82
|
+
readonly item: Expression;
|
|
83
|
+
readonly value: Expression;
|
|
84
|
+
readonly kind = AstNodeKind.AugmentedAssignmentStatement;
|
|
85
|
+
readonly location: Location | undefined;
|
|
86
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
87
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
88
|
+
getType(options: GetTypeOptions): BscType;
|
|
89
|
+
get leadingTrivia(): Token[];
|
|
90
|
+
clone(): AugmentedAssignmentStatement;
|
|
63
91
|
}
|
|
64
92
|
export declare class Block extends Statement {
|
|
93
|
+
constructor(options: {
|
|
94
|
+
statements: Statement[];
|
|
95
|
+
});
|
|
65
96
|
readonly statements: Statement[];
|
|
66
|
-
readonly
|
|
67
|
-
|
|
68
|
-
|
|
97
|
+
readonly kind = AstNodeKind.Block;
|
|
98
|
+
private buildLocation;
|
|
99
|
+
get location(): Location;
|
|
100
|
+
set location(value: Location);
|
|
101
|
+
private _location;
|
|
69
102
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
103
|
+
get leadingTrivia(): Token[];
|
|
70
104
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
105
|
+
clone(): Block;
|
|
71
106
|
}
|
|
72
107
|
export declare class ExpressionStatement extends Statement {
|
|
108
|
+
constructor(options: {
|
|
109
|
+
expression: Expression;
|
|
110
|
+
});
|
|
73
111
|
readonly expression: Expression;
|
|
74
|
-
|
|
75
|
-
readonly
|
|
76
|
-
transpile(state: BrsTranspileState): TranspileResult;
|
|
77
|
-
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
78
|
-
}
|
|
79
|
-
export declare class CommentStatement extends Statement implements Expression, TypedefProvider {
|
|
80
|
-
comments: Token[];
|
|
81
|
-
constructor(comments: Token[]);
|
|
82
|
-
range: Range;
|
|
83
|
-
get text(): string;
|
|
84
|
-
transpile(state: BrsTranspileState): any[];
|
|
85
|
-
getTypedef(state: BrsTranspileState): any[];
|
|
112
|
+
readonly kind = AstNodeKind.ExpressionStatement;
|
|
113
|
+
readonly location: Location | undefined;
|
|
114
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
86
115
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
116
|
+
get leadingTrivia(): Token[];
|
|
117
|
+
clone(): ExpressionStatement;
|
|
87
118
|
}
|
|
88
|
-
export declare class
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
constructor(tokens: {
|
|
93
|
-
exitFor: Token;
|
|
119
|
+
export declare class ExitStatement extends Statement {
|
|
120
|
+
constructor(options?: {
|
|
121
|
+
exit?: Token;
|
|
122
|
+
loopType: Token;
|
|
94
123
|
});
|
|
95
|
-
readonly range: Range;
|
|
96
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
97
|
-
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
98
|
-
}
|
|
99
|
-
export declare class ExitWhileStatement extends Statement {
|
|
100
124
|
readonly tokens: {
|
|
101
|
-
|
|
125
|
+
readonly exit: Token;
|
|
126
|
+
readonly loopType?: Token;
|
|
102
127
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
readonly range: Range;
|
|
107
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
128
|
+
readonly kind = AstNodeKind.ExitStatement;
|
|
129
|
+
readonly location?: Location;
|
|
130
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
108
131
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
132
|
+
get leadingTrivia(): Token[];
|
|
133
|
+
clone(): ExitStatement;
|
|
109
134
|
}
|
|
110
135
|
export declare class FunctionStatement extends Statement implements TypedefProvider {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
readonly
|
|
136
|
+
constructor(options: {
|
|
137
|
+
name: Identifier;
|
|
138
|
+
func: FunctionExpression;
|
|
139
|
+
});
|
|
140
|
+
readonly tokens: {
|
|
141
|
+
readonly name: Identifier;
|
|
142
|
+
};
|
|
143
|
+
readonly func: FunctionExpression;
|
|
144
|
+
readonly kind: AstNodeKind;
|
|
145
|
+
readonly location: Location | undefined;
|
|
116
146
|
/**
|
|
117
147
|
* Get the name of this expression based on the parse mode
|
|
118
148
|
*/
|
|
119
149
|
getName(parseMode: ParseMode): string;
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
get leadingTrivia(): Token[];
|
|
151
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
152
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
122
153
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
154
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
155
|
+
clone(): FunctionStatement;
|
|
123
156
|
}
|
|
124
157
|
export declare class IfStatement extends Statement {
|
|
125
|
-
|
|
126
|
-
if
|
|
158
|
+
constructor(options: {
|
|
159
|
+
if?: Token;
|
|
127
160
|
then?: Token;
|
|
128
161
|
else?: Token;
|
|
129
162
|
endIf?: Token;
|
|
163
|
+
condition: Expression;
|
|
164
|
+
thenBranch: Block;
|
|
165
|
+
elseBranch?: IfStatement | Block;
|
|
166
|
+
});
|
|
167
|
+
readonly tokens: {
|
|
168
|
+
readonly if?: Token;
|
|
169
|
+
readonly then?: Token;
|
|
170
|
+
readonly else?: Token;
|
|
171
|
+
readonly endIf?: Token;
|
|
130
172
|
};
|
|
131
173
|
readonly condition: Expression;
|
|
132
174
|
readonly thenBranch: Block;
|
|
133
175
|
readonly elseBranch?: IfStatement | Block;
|
|
134
|
-
readonly
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
else?: Token;
|
|
139
|
-
endIf?: Token;
|
|
140
|
-
}, condition: Expression, thenBranch: Block, elseBranch?: IfStatement | Block, isInline?: boolean);
|
|
141
|
-
readonly range: Range;
|
|
142
|
-
transpile(state: BrsTranspileState): any[];
|
|
176
|
+
readonly kind = AstNodeKind.IfStatement;
|
|
177
|
+
readonly location: Location | undefined;
|
|
178
|
+
get isInline(): boolean;
|
|
179
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
143
180
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
181
|
+
get leadingTrivia(): Token[];
|
|
182
|
+
get endTrivia(): Token[];
|
|
183
|
+
clone(): any;
|
|
144
184
|
}
|
|
145
185
|
export declare class IncrementStatement extends Statement {
|
|
186
|
+
constructor(options: {
|
|
187
|
+
value: Expression;
|
|
188
|
+
operator: Token;
|
|
189
|
+
});
|
|
146
190
|
readonly value: Expression;
|
|
147
|
-
readonly
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
191
|
+
readonly tokens: {
|
|
192
|
+
readonly operator: Token;
|
|
193
|
+
};
|
|
194
|
+
readonly kind = AstNodeKind.IncrementStatement;
|
|
195
|
+
readonly location: Location | undefined;
|
|
196
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode | TranspileResult)[];
|
|
151
197
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
export interface PrintSeparatorTab extends Token {
|
|
155
|
-
kind: TokenKind.Comma;
|
|
156
|
-
}
|
|
157
|
-
/** Used to insert a single whitespace character at the current `print` position. */
|
|
158
|
-
export interface PrintSeparatorSpace extends Token {
|
|
159
|
-
kind: TokenKind.Semicolon;
|
|
198
|
+
get leadingTrivia(): Token[];
|
|
199
|
+
clone(): IncrementStatement;
|
|
160
200
|
}
|
|
161
201
|
/**
|
|
162
202
|
* Represents a `print` statement within BrightScript.
|
|
163
203
|
*/
|
|
164
204
|
export declare class PrintStatement extends Statement {
|
|
165
|
-
readonly tokens: {
|
|
166
|
-
print: Token;
|
|
167
|
-
};
|
|
168
|
-
readonly expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
169
205
|
/**
|
|
170
206
|
* Creates a new internal representation of a BrightScript `print` statement.
|
|
171
|
-
* @param
|
|
172
|
-
*
|
|
207
|
+
* @param options the options for this statement
|
|
208
|
+
* @param options.print a print token
|
|
209
|
+
* @param options.expressions an array of expressions to be evaluated and printed. Wrap PrintSeparator tokens (`;` or `,`) in `PrintSeparatorExpression`
|
|
173
210
|
*/
|
|
174
|
-
constructor(
|
|
175
|
-
print
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
211
|
+
constructor(options: {
|
|
212
|
+
print?: Token;
|
|
213
|
+
expressions: Array<Expression>;
|
|
214
|
+
});
|
|
215
|
+
readonly tokens: {
|
|
216
|
+
readonly print?: Token;
|
|
217
|
+
};
|
|
218
|
+
readonly expressions: Array<Expression>;
|
|
219
|
+
readonly kind = AstNodeKind.PrintStatement;
|
|
220
|
+
readonly location: Location | undefined;
|
|
221
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
179
222
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
223
|
+
get leadingTrivia(): Token[];
|
|
224
|
+
clone(): PrintStatement;
|
|
180
225
|
}
|
|
181
226
|
export declare class DimStatement extends Statement {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
227
|
+
constructor(options: {
|
|
228
|
+
dim?: Token;
|
|
229
|
+
name: Identifier;
|
|
230
|
+
openingSquare?: Token;
|
|
231
|
+
dimensions: Expression[];
|
|
232
|
+
closingSquare?: Token;
|
|
233
|
+
});
|
|
234
|
+
readonly tokens: {
|
|
235
|
+
readonly dim?: Token;
|
|
236
|
+
readonly name: Identifier;
|
|
237
|
+
readonly openingSquare?: Token;
|
|
238
|
+
readonly closingSquare?: Token;
|
|
239
|
+
};
|
|
240
|
+
readonly dimensions: Expression[];
|
|
241
|
+
readonly kind = AstNodeKind.DimStatement;
|
|
242
|
+
readonly location: Location | undefined;
|
|
243
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
190
244
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
245
|
+
getType(options: GetTypeOptions): BscType;
|
|
246
|
+
get leadingTrivia(): Token[];
|
|
247
|
+
clone(): DimStatement;
|
|
191
248
|
}
|
|
192
249
|
export declare class GotoStatement extends Statement {
|
|
193
|
-
|
|
194
|
-
goto
|
|
195
|
-
label: Token;
|
|
196
|
-
};
|
|
197
|
-
constructor(tokens: {
|
|
198
|
-
goto: Token;
|
|
250
|
+
constructor(options: {
|
|
251
|
+
goto?: Token;
|
|
199
252
|
label: Token;
|
|
200
253
|
});
|
|
201
|
-
readonly
|
|
202
|
-
|
|
254
|
+
readonly tokens: {
|
|
255
|
+
readonly goto?: Token;
|
|
256
|
+
readonly label: Token;
|
|
257
|
+
};
|
|
258
|
+
readonly kind = AstNodeKind.GotoStatement;
|
|
259
|
+
readonly location: Location | undefined;
|
|
260
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
203
261
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
262
|
+
get leadingTrivia(): Token[];
|
|
263
|
+
clone(): GotoStatement;
|
|
204
264
|
}
|
|
205
265
|
export declare class LabelStatement extends Statement {
|
|
266
|
+
constructor(options: {
|
|
267
|
+
name: Token;
|
|
268
|
+
colon?: Token;
|
|
269
|
+
});
|
|
206
270
|
readonly tokens: {
|
|
207
|
-
|
|
208
|
-
colon: Token;
|
|
271
|
+
readonly name: Token;
|
|
272
|
+
readonly colon: Token;
|
|
209
273
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
readonly range: Range;
|
|
215
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
274
|
+
readonly kind = AstNodeKind.LabelStatement;
|
|
275
|
+
readonly location: Location | undefined;
|
|
276
|
+
get leadingTrivia(): Token[];
|
|
277
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
216
278
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
279
|
+
clone(): LabelStatement;
|
|
217
280
|
}
|
|
218
281
|
export declare class ReturnStatement extends Statement {
|
|
282
|
+
constructor(options?: {
|
|
283
|
+
return?: Token;
|
|
284
|
+
value?: Expression;
|
|
285
|
+
});
|
|
219
286
|
readonly tokens: {
|
|
220
|
-
return
|
|
287
|
+
readonly return?: Token;
|
|
221
288
|
};
|
|
222
289
|
readonly value?: Expression;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
readonly range: Range;
|
|
227
|
-
transpile(state: BrsTranspileState): any[];
|
|
290
|
+
readonly kind = AstNodeKind.ReturnStatement;
|
|
291
|
+
readonly location: Location | undefined;
|
|
292
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
228
293
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
294
|
+
get leadingTrivia(): Token[];
|
|
295
|
+
clone(): ReturnStatement;
|
|
229
296
|
}
|
|
230
297
|
export declare class EndStatement extends Statement {
|
|
298
|
+
constructor(options?: {
|
|
299
|
+
end?: Token;
|
|
300
|
+
});
|
|
231
301
|
readonly tokens: {
|
|
232
|
-
end
|
|
302
|
+
readonly end?: Token;
|
|
233
303
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
readonly range: Range;
|
|
238
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
304
|
+
readonly kind = AstNodeKind.EndStatement;
|
|
305
|
+
readonly location: Location;
|
|
306
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
239
307
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
308
|
+
get leadingTrivia(): Token[];
|
|
309
|
+
clone(): EndStatement;
|
|
240
310
|
}
|
|
241
311
|
export declare class StopStatement extends Statement {
|
|
312
|
+
constructor(options?: {
|
|
313
|
+
stop?: Token;
|
|
314
|
+
});
|
|
242
315
|
readonly tokens: {
|
|
243
|
-
stop
|
|
316
|
+
readonly stop?: Token;
|
|
244
317
|
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
readonly range: Range;
|
|
249
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
318
|
+
readonly kind = AstNodeKind.StopStatement;
|
|
319
|
+
readonly location: Location;
|
|
320
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
250
321
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
322
|
+
get leadingTrivia(): Token[];
|
|
323
|
+
clone(): StopStatement;
|
|
251
324
|
}
|
|
252
325
|
export declare class ForStatement extends Statement {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
326
|
+
constructor(options: {
|
|
327
|
+
for?: Token;
|
|
328
|
+
counterDeclaration: AssignmentStatement;
|
|
329
|
+
to?: Token;
|
|
330
|
+
finalValue: Expression;
|
|
331
|
+
body: Block;
|
|
332
|
+
endFor?: Token;
|
|
333
|
+
step?: Token;
|
|
334
|
+
increment?: Expression;
|
|
335
|
+
});
|
|
336
|
+
readonly tokens: {
|
|
337
|
+
readonly for?: Token;
|
|
338
|
+
readonly to?: Token;
|
|
339
|
+
readonly endFor?: Token;
|
|
340
|
+
readonly step?: Token;
|
|
341
|
+
};
|
|
342
|
+
readonly counterDeclaration: AssignmentStatement;
|
|
343
|
+
readonly finalValue: Expression;
|
|
344
|
+
readonly body: Block;
|
|
345
|
+
readonly increment?: Expression;
|
|
346
|
+
readonly kind = AstNodeKind.ForStatement;
|
|
347
|
+
readonly location: Location | undefined;
|
|
348
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
264
349
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
350
|
+
get leadingTrivia(): Token[];
|
|
351
|
+
get endTrivia(): Token[];
|
|
352
|
+
clone(): ForStatement;
|
|
265
353
|
}
|
|
266
354
|
export declare class ForEachStatement extends Statement {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
355
|
+
constructor(options: {
|
|
356
|
+
forEach?: Token;
|
|
357
|
+
item: Token;
|
|
358
|
+
as?: Token;
|
|
359
|
+
typeExpression?: TypeExpression;
|
|
360
|
+
in?: Token;
|
|
361
|
+
target: Expression;
|
|
362
|
+
body: Block;
|
|
363
|
+
endFor?: Token;
|
|
364
|
+
});
|
|
365
|
+
readonly tokens: {
|
|
366
|
+
readonly forEach?: Token;
|
|
367
|
+
readonly item: Token;
|
|
368
|
+
readonly as: Token;
|
|
369
|
+
readonly in?: Token;
|
|
370
|
+
readonly endFor?: Token;
|
|
371
|
+
};
|
|
372
|
+
readonly body: Block;
|
|
373
|
+
readonly target: Expression;
|
|
374
|
+
readonly typeExpression?: TypeExpression;
|
|
375
|
+
readonly kind = AstNodeKind.ForEachStatement;
|
|
376
|
+
readonly location: Location | undefined;
|
|
377
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
276
378
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
379
|
+
getType(options: GetTypeOptions): BscType;
|
|
380
|
+
getLoopVariableType(options: GetTypeOptions): BscType;
|
|
381
|
+
get leadingTrivia(): Token[];
|
|
382
|
+
get endTrivia(): Token[];
|
|
383
|
+
clone(): ForEachStatement;
|
|
277
384
|
}
|
|
278
385
|
export declare class WhileStatement extends Statement {
|
|
386
|
+
constructor(options: {
|
|
387
|
+
while?: Token;
|
|
388
|
+
endWhile?: Token;
|
|
389
|
+
condition: Expression;
|
|
390
|
+
body: Block;
|
|
391
|
+
});
|
|
279
392
|
readonly tokens: {
|
|
280
|
-
while
|
|
281
|
-
endWhile
|
|
393
|
+
readonly while?: Token;
|
|
394
|
+
readonly endWhile?: Token;
|
|
282
395
|
};
|
|
283
396
|
readonly condition: Expression;
|
|
284
397
|
readonly body: Block;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}, condition: Expression, body: Block);
|
|
289
|
-
readonly range: Range;
|
|
290
|
-
transpile(state: BrsTranspileState): any[];
|
|
398
|
+
readonly kind = AstNodeKind.WhileStatement;
|
|
399
|
+
readonly location: Location | undefined;
|
|
400
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
291
401
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
402
|
+
get leadingTrivia(): Token[];
|
|
403
|
+
get endTrivia(): Token[];
|
|
404
|
+
clone(): WhileStatement;
|
|
292
405
|
}
|
|
293
406
|
export declare class DottedSetStatement extends Statement {
|
|
407
|
+
constructor(options: {
|
|
408
|
+
obj: Expression;
|
|
409
|
+
name: Identifier;
|
|
410
|
+
value: Expression;
|
|
411
|
+
dot?: Token;
|
|
412
|
+
equals?: Token;
|
|
413
|
+
});
|
|
414
|
+
readonly tokens: {
|
|
415
|
+
readonly name: Identifier;
|
|
416
|
+
readonly equals?: Token;
|
|
417
|
+
readonly dot?: Token;
|
|
418
|
+
};
|
|
294
419
|
readonly obj: Expression;
|
|
295
|
-
readonly name: Identifier;
|
|
296
420
|
readonly value: Expression;
|
|
297
|
-
|
|
298
|
-
readonly
|
|
299
|
-
transpile(state: BrsTranspileState): TranspileResult;
|
|
421
|
+
readonly kind = AstNodeKind.DottedSetStatement;
|
|
422
|
+
readonly location: Location | undefined;
|
|
423
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode | TranspileResult)[];
|
|
300
424
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
425
|
+
getType(options: GetTypeOptions): BscType;
|
|
426
|
+
get leadingTrivia(): Token[];
|
|
427
|
+
clone(): DottedSetStatement;
|
|
301
428
|
}
|
|
302
429
|
export declare class IndexedSetStatement extends Statement {
|
|
430
|
+
constructor(options: {
|
|
431
|
+
obj: Expression;
|
|
432
|
+
indexes: Expression[];
|
|
433
|
+
value: Expression;
|
|
434
|
+
openingSquare?: Token;
|
|
435
|
+
closingSquare?: Token;
|
|
436
|
+
equals?: Token;
|
|
437
|
+
});
|
|
438
|
+
readonly tokens: {
|
|
439
|
+
readonly openingSquare?: Token;
|
|
440
|
+
readonly closingSquare?: Token;
|
|
441
|
+
readonly equals?: Token;
|
|
442
|
+
};
|
|
303
443
|
readonly obj: Expression;
|
|
304
|
-
readonly
|
|
444
|
+
readonly indexes: Expression[];
|
|
305
445
|
readonly value: Expression;
|
|
306
|
-
readonly
|
|
307
|
-
readonly
|
|
308
|
-
|
|
309
|
-
readonly range: Range;
|
|
310
|
-
transpile(state: BrsTranspileState): TranspileResult;
|
|
446
|
+
readonly kind = AstNodeKind.IndexedSetStatement;
|
|
447
|
+
readonly location: Location | undefined;
|
|
448
|
+
transpile(state: BrsTranspileState): any[];
|
|
311
449
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
450
|
+
get leadingTrivia(): Token[];
|
|
451
|
+
clone(): IndexedSetStatement;
|
|
312
452
|
}
|
|
313
453
|
export declare class LibraryStatement extends Statement implements TypedefProvider {
|
|
314
|
-
|
|
315
|
-
library: Token;
|
|
316
|
-
filePath: Token | undefined;
|
|
317
|
-
};
|
|
318
|
-
constructor(tokens: {
|
|
454
|
+
constructor(options: {
|
|
319
455
|
library: Token;
|
|
320
|
-
filePath
|
|
456
|
+
filePath?: Token;
|
|
321
457
|
});
|
|
322
|
-
readonly
|
|
323
|
-
|
|
324
|
-
|
|
458
|
+
readonly tokens: {
|
|
459
|
+
readonly library: Token;
|
|
460
|
+
readonly filePath?: Token;
|
|
461
|
+
};
|
|
462
|
+
readonly kind = AstNodeKind.LibraryStatement;
|
|
463
|
+
readonly location: Location | undefined;
|
|
464
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
465
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
325
466
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
467
|
+
get leadingTrivia(): Token[];
|
|
468
|
+
clone(): LibraryStatement;
|
|
326
469
|
}
|
|
327
470
|
export declare class NamespaceStatement extends Statement implements TypedefProvider {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
471
|
+
constructor(options: {
|
|
472
|
+
namespace?: Token;
|
|
473
|
+
nameExpression: VariableExpression | DottedGetExpression;
|
|
474
|
+
body: Body;
|
|
475
|
+
endNamespace?: Token;
|
|
476
|
+
});
|
|
477
|
+
readonly tokens: {
|
|
478
|
+
readonly namespace?: Token;
|
|
479
|
+
readonly endNamespace?: Token;
|
|
480
|
+
};
|
|
481
|
+
readonly nameExpression: VariableExpression | DottedGetExpression;
|
|
482
|
+
readonly body: Body;
|
|
483
|
+
readonly kind = AstNodeKind.NamespaceStatement;
|
|
335
484
|
/**
|
|
336
485
|
* The string name for this namespace
|
|
337
486
|
*/
|
|
338
|
-
name: string;
|
|
339
|
-
get
|
|
487
|
+
get name(): string;
|
|
488
|
+
get location(): Location;
|
|
489
|
+
private _location;
|
|
490
|
+
cacheLocation(): Location;
|
|
340
491
|
getName(parseMode: ParseMode): string;
|
|
341
|
-
|
|
342
|
-
|
|
492
|
+
get leadingTrivia(): Token[];
|
|
493
|
+
get endTrivia(): Token[];
|
|
494
|
+
getNameParts(): Identifier[];
|
|
495
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
496
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
343
497
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
498
|
+
getType(options: GetTypeOptions): NamespaceType;
|
|
499
|
+
clone(): NamespaceStatement;
|
|
344
500
|
}
|
|
345
501
|
export declare class ImportStatement extends Statement implements TypedefProvider {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
502
|
+
constructor(options: {
|
|
503
|
+
import?: Token;
|
|
504
|
+
path?: Token;
|
|
505
|
+
});
|
|
506
|
+
readonly tokens: {
|
|
507
|
+
readonly import?: Token;
|
|
508
|
+
readonly path: Token;
|
|
509
|
+
};
|
|
510
|
+
readonly kind = AstNodeKind.ImportStatement;
|
|
511
|
+
readonly location: Location;
|
|
512
|
+
readonly filePath: string;
|
|
513
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
352
514
|
/**
|
|
353
515
|
* Get the typedef for this statement
|
|
354
516
|
*/
|
|
355
517
|
getTypedef(state: BrsTranspileState): string[];
|
|
356
518
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
519
|
+
get leadingTrivia(): Token[];
|
|
520
|
+
clone(): ImportStatement;
|
|
357
521
|
}
|
|
358
|
-
export declare class
|
|
359
|
-
|
|
522
|
+
export declare class InterfaceStatement extends Statement implements TypedefProvider {
|
|
523
|
+
constructor(options: {
|
|
524
|
+
interface: Token;
|
|
525
|
+
name: Identifier;
|
|
526
|
+
extends?: Token;
|
|
527
|
+
parentInterfaceName?: TypeExpression;
|
|
528
|
+
body: Statement[];
|
|
529
|
+
endInterface?: Token;
|
|
530
|
+
});
|
|
531
|
+
readonly parentInterfaceName?: TypeExpression;
|
|
532
|
+
readonly body: Statement[];
|
|
533
|
+
readonly kind = AstNodeKind.InterfaceStatement;
|
|
534
|
+
readonly tokens: {
|
|
535
|
+
readonly interface?: Token;
|
|
536
|
+
readonly name: Identifier;
|
|
537
|
+
readonly extends?: Token;
|
|
538
|
+
readonly endInterface?: Token;
|
|
539
|
+
};
|
|
540
|
+
readonly location: Location | undefined;
|
|
541
|
+
get fields(): InterfaceFieldStatement[];
|
|
542
|
+
get methods(): InterfaceMethodStatement[];
|
|
543
|
+
hasParentInterface(): boolean;
|
|
544
|
+
get leadingTrivia(): Token[];
|
|
545
|
+
get endTrivia(): Token[];
|
|
360
546
|
/**
|
|
361
|
-
* The name of the
|
|
547
|
+
* The name of the interface WITH its leading namespace (if applicable)
|
|
362
548
|
*/
|
|
363
|
-
|
|
364
|
-
body: Statement[];
|
|
365
|
-
readonly end: Token;
|
|
366
|
-
readonly extendsKeyword?: Token;
|
|
367
|
-
readonly parentClassName?: NamespacedVariableNameExpression;
|
|
368
|
-
readonly namespaceName?: NamespacedVariableNameExpression;
|
|
369
|
-
constructor(classKeyword: Token,
|
|
549
|
+
get fullName(): string;
|
|
370
550
|
/**
|
|
371
|
-
* The name of the
|
|
551
|
+
* The name of the interface (without the namespace prefix)
|
|
552
|
+
*/
|
|
553
|
+
get name(): string;
|
|
554
|
+
/**
|
|
555
|
+
* Get the name of this expression based on the parse mode
|
|
372
556
|
*/
|
|
373
|
-
name: Identifier, body: Statement[], end: Token, extendsKeyword?: Token, parentClassName?: NamespacedVariableNameExpression, namespaceName?: NamespacedVariableNameExpression);
|
|
374
557
|
getName(parseMode: ParseMode): string;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
558
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
559
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
560
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
561
|
+
getType(options: GetTypeOptions): InterfaceType;
|
|
562
|
+
clone(): InterfaceStatement;
|
|
563
|
+
}
|
|
564
|
+
export declare class InterfaceFieldStatement extends Statement implements TypedefProvider {
|
|
565
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
566
|
+
constructor(options: {
|
|
567
|
+
name: Identifier;
|
|
568
|
+
as?: Token;
|
|
569
|
+
typeExpression?: TypeExpression;
|
|
570
|
+
optional?: Token;
|
|
571
|
+
});
|
|
572
|
+
readonly kind = AstNodeKind.InterfaceFieldStatement;
|
|
573
|
+
readonly typeExpression?: TypeExpression;
|
|
574
|
+
readonly location: Location | undefined;
|
|
575
|
+
readonly tokens: {
|
|
576
|
+
readonly name: Identifier;
|
|
577
|
+
readonly as: Token;
|
|
578
|
+
readonly optional?: Token;
|
|
579
|
+
};
|
|
580
|
+
get leadingTrivia(): Token[];
|
|
581
|
+
get name(): string;
|
|
582
|
+
get isOptional(): boolean;
|
|
583
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
584
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
585
|
+
getType(options: GetTypeOptions): BscType;
|
|
586
|
+
clone(): InterfaceFieldStatement;
|
|
587
|
+
}
|
|
588
|
+
export declare class InterfaceMethodStatement extends Statement implements TypedefProvider {
|
|
589
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
590
|
+
constructor(options: {
|
|
591
|
+
functionType?: Token;
|
|
592
|
+
name: Identifier;
|
|
593
|
+
leftParen?: Token;
|
|
594
|
+
params?: FunctionParameterExpression[];
|
|
595
|
+
rightParen?: Token;
|
|
596
|
+
as?: Token;
|
|
597
|
+
returnTypeExpression?: TypeExpression;
|
|
598
|
+
optional?: Token;
|
|
599
|
+
});
|
|
600
|
+
readonly kind = AstNodeKind.InterfaceMethodStatement;
|
|
601
|
+
get location(): Location;
|
|
602
|
+
/**
|
|
603
|
+
* Get the name of this method.
|
|
604
|
+
*/
|
|
605
|
+
getName(parseMode: ParseMode): string;
|
|
606
|
+
readonly tokens: {
|
|
607
|
+
readonly optional?: Token;
|
|
608
|
+
readonly functionType: Token;
|
|
609
|
+
readonly name: Identifier;
|
|
610
|
+
readonly leftParen?: Token;
|
|
611
|
+
readonly rightParen?: Token;
|
|
612
|
+
readonly as?: Token;
|
|
613
|
+
};
|
|
614
|
+
readonly params: FunctionParameterExpression[];
|
|
615
|
+
readonly returnTypeExpression?: TypeExpression;
|
|
616
|
+
get isOptional(): boolean;
|
|
617
|
+
get leadingTrivia(): Token[];
|
|
618
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
619
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
620
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
621
|
+
clone(): InterfaceMethodStatement;
|
|
622
|
+
}
|
|
623
|
+
export declare class ClassStatement extends Statement implements TypedefProvider {
|
|
624
|
+
constructor(options: {
|
|
625
|
+
class?: Token;
|
|
626
|
+
/**
|
|
627
|
+
* The name of the class (without namespace prefix)
|
|
628
|
+
*/
|
|
629
|
+
name: Identifier;
|
|
630
|
+
body: Statement[];
|
|
631
|
+
endClass?: Token;
|
|
632
|
+
extends?: Token;
|
|
633
|
+
parentClassName?: TypeExpression;
|
|
634
|
+
});
|
|
635
|
+
readonly kind = AstNodeKind.ClassStatement;
|
|
636
|
+
readonly tokens: {
|
|
637
|
+
readonly class?: Token;
|
|
638
|
+
/**
|
|
639
|
+
* The name of the class (without namespace prefix)
|
|
640
|
+
*/
|
|
641
|
+
readonly name: Identifier;
|
|
642
|
+
readonly endClass?: Token;
|
|
643
|
+
readonly extends?: Token;
|
|
644
|
+
};
|
|
645
|
+
readonly body: Statement[];
|
|
646
|
+
readonly parentClassName: TypeExpression;
|
|
647
|
+
getName(parseMode: ParseMode): string;
|
|
648
|
+
get leadingTrivia(): Token[];
|
|
649
|
+
get endTrivia(): Token[];
|
|
650
|
+
readonly memberMap: Record<string, MemberStatement>;
|
|
651
|
+
readonly methods: MethodStatement[];
|
|
652
|
+
readonly fields: FieldStatement[];
|
|
653
|
+
readonly location: Location | undefined;
|
|
654
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
380
655
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
381
656
|
/**
|
|
382
657
|
* Find the parent index for this class's parent.
|
|
@@ -391,11 +666,18 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
391
666
|
*/
|
|
392
667
|
getAncestors(state: BrsTranspileState): ClassStatement[];
|
|
393
668
|
private getBuilderName;
|
|
669
|
+
private getMethodIdentifier;
|
|
670
|
+
getConstructorType(): TypedFunctionType;
|
|
394
671
|
/**
|
|
395
672
|
* Get the constructor function for this class (if exists), or undefined if not exist
|
|
396
673
|
*/
|
|
397
674
|
private getConstructorFunction;
|
|
398
|
-
|
|
675
|
+
/**
|
|
676
|
+
* Return the parameters for the first constructor function for this class
|
|
677
|
+
* @param ancestors The list of ancestors for this class
|
|
678
|
+
* @returns The parameters for the first constructor function for this class
|
|
679
|
+
*/
|
|
680
|
+
private getConstructorParams;
|
|
399
681
|
/**
|
|
400
682
|
* Determine if the specified field was declared in one of the ancestor classes
|
|
401
683
|
*/
|
|
@@ -406,6 +688,15 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
406
688
|
* without instantiating the parent constructor at that point in time.
|
|
407
689
|
*/
|
|
408
690
|
private getTranspiledBuilder;
|
|
691
|
+
/**
|
|
692
|
+
* Returns a copy of the class' body, with the constructor function added if it doesn't exist.
|
|
693
|
+
*/
|
|
694
|
+
private getTranspiledClassBody;
|
|
695
|
+
/**
|
|
696
|
+
* These are the methods that are defined in this class. They are transpiled outside of the class body
|
|
697
|
+
* to ensure they don't appear as "$anon_#" in stack traces and crash logs.
|
|
698
|
+
*/
|
|
699
|
+
private getTranspiledMethods;
|
|
409
700
|
/**
|
|
410
701
|
* The class function is the function with the same name as the class. This is the function that
|
|
411
702
|
* consumers should call to create a new instance of that class.
|
|
@@ -413,14 +704,31 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
413
704
|
*/
|
|
414
705
|
private getTranspiledClassFunction;
|
|
415
706
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
707
|
+
getType(options: GetTypeOptions): ClassType;
|
|
708
|
+
clone(): ClassStatement;
|
|
416
709
|
}
|
|
417
|
-
export declare class
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
710
|
+
export declare class MethodStatement extends FunctionStatement {
|
|
711
|
+
constructor(options: {
|
|
712
|
+
modifiers?: Token | Token[];
|
|
713
|
+
name: Identifier;
|
|
714
|
+
func: FunctionExpression;
|
|
715
|
+
override?: Token;
|
|
716
|
+
});
|
|
717
|
+
readonly kind: AstNodeKind;
|
|
718
|
+
readonly modifiers: Token[];
|
|
719
|
+
readonly tokens: {
|
|
720
|
+
readonly name: Identifier;
|
|
721
|
+
readonly override?: Token;
|
|
722
|
+
};
|
|
723
|
+
get accessModifier(): Token;
|
|
724
|
+
readonly location: Location | undefined;
|
|
725
|
+
/**
|
|
726
|
+
* Get the name of this method.
|
|
727
|
+
*/
|
|
728
|
+
getName(parseMode: ParseMode): string;
|
|
729
|
+
get leadingTrivia(): Token[];
|
|
730
|
+
transpile(state: BrsTranspileState, name?: Identifier): TranspileResult;
|
|
731
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
424
732
|
/**
|
|
425
733
|
* All child classes must call the parent constructor. The type checker will warn users when they don't call it in their own class,
|
|
426
734
|
* but we still need to call it even if they have omitted it. This injects the super call if it's missing
|
|
@@ -431,43 +739,317 @@ export declare class ClassMethodStatement extends FunctionStatement {
|
|
|
431
739
|
*/
|
|
432
740
|
private injectFieldInitializersForConstructor;
|
|
433
741
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
742
|
+
clone(): MethodStatement;
|
|
434
743
|
}
|
|
435
|
-
export declare class
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
744
|
+
export declare class FieldStatement extends Statement implements TypedefProvider {
|
|
745
|
+
constructor(options: {
|
|
746
|
+
accessModifier?: Token;
|
|
747
|
+
name: Identifier;
|
|
748
|
+
as?: Token;
|
|
749
|
+
typeExpression?: TypeExpression;
|
|
750
|
+
equals?: Token;
|
|
751
|
+
initialValue?: Expression;
|
|
752
|
+
optional?: Token;
|
|
753
|
+
});
|
|
754
|
+
readonly tokens: {
|
|
755
|
+
readonly accessModifier?: Token;
|
|
756
|
+
readonly name: Identifier;
|
|
757
|
+
readonly as?: Token;
|
|
758
|
+
readonly equals?: Token;
|
|
759
|
+
readonly optional?: Token;
|
|
760
|
+
};
|
|
761
|
+
readonly typeExpression?: TypeExpression;
|
|
441
762
|
readonly initialValue?: Expression;
|
|
442
|
-
|
|
763
|
+
readonly kind = AstNodeKind.FieldStatement;
|
|
443
764
|
/**
|
|
444
765
|
* Derive a ValueKind from the type token, or the initial value.
|
|
445
766
|
* Defaults to `DynamicType`
|
|
446
767
|
*/
|
|
447
|
-
getType(
|
|
448
|
-
readonly
|
|
768
|
+
getType(options: GetTypeOptions): BscType;
|
|
769
|
+
readonly location: Location | undefined;
|
|
770
|
+
get leadingTrivia(): Token[];
|
|
771
|
+
get isOptional(): boolean;
|
|
449
772
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
450
773
|
getTypedef(state: BrsTranspileState): any[];
|
|
451
774
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
775
|
+
clone(): FieldStatement;
|
|
452
776
|
}
|
|
453
|
-
export declare type
|
|
777
|
+
export declare type MemberStatement = FieldStatement | MethodStatement;
|
|
454
778
|
export declare class TryCatchStatement extends Statement {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
779
|
+
constructor(options?: {
|
|
780
|
+
try?: Token;
|
|
781
|
+
endTry?: Token;
|
|
782
|
+
tryBranch?: Block;
|
|
783
|
+
catchStatement?: CatchStatement;
|
|
784
|
+
});
|
|
785
|
+
readonly tokens: {
|
|
786
|
+
readonly try?: Token;
|
|
787
|
+
readonly endTry?: Token;
|
|
788
|
+
};
|
|
789
|
+
readonly tryBranch: Block;
|
|
790
|
+
readonly catchStatement: CatchStatement;
|
|
791
|
+
readonly kind = AstNodeKind.TryCatchStatement;
|
|
792
|
+
readonly location: Location | undefined;
|
|
793
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
794
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
795
|
+
get leadingTrivia(): Token[];
|
|
796
|
+
get endTrivia(): Token[];
|
|
797
|
+
clone(): TryCatchStatement;
|
|
798
|
+
}
|
|
799
|
+
export declare class CatchStatement extends Statement {
|
|
800
|
+
constructor(options?: {
|
|
801
|
+
catch?: Token;
|
|
802
|
+
exceptionVariableExpression?: Expression;
|
|
803
|
+
catchBranch?: Block;
|
|
804
|
+
});
|
|
805
|
+
readonly tokens: {
|
|
806
|
+
readonly catch?: Token;
|
|
807
|
+
};
|
|
808
|
+
readonly exceptionVariableExpression?: Expression;
|
|
809
|
+
readonly catchBranch?: Block;
|
|
810
|
+
readonly kind = AstNodeKind.CatchStatement;
|
|
811
|
+
readonly location: Location | undefined;
|
|
463
812
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
464
813
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
814
|
+
get leadingTrivia(): Token[];
|
|
815
|
+
clone(): CatchStatement;
|
|
465
816
|
}
|
|
466
817
|
export declare class ThrowStatement extends Statement {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
818
|
+
constructor(options?: {
|
|
819
|
+
throw?: Token;
|
|
820
|
+
expression?: Expression;
|
|
821
|
+
});
|
|
822
|
+
readonly tokens: {
|
|
823
|
+
readonly throw?: Token;
|
|
824
|
+
};
|
|
825
|
+
readonly expression?: Expression;
|
|
826
|
+
readonly kind = AstNodeKind.ThrowStatement;
|
|
827
|
+
readonly location: Location | undefined;
|
|
828
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
829
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
830
|
+
get leadingTrivia(): Token[];
|
|
831
|
+
clone(): ThrowStatement;
|
|
832
|
+
}
|
|
833
|
+
export declare class EnumStatement extends Statement implements TypedefProvider {
|
|
834
|
+
constructor(options: {
|
|
835
|
+
enum?: Token;
|
|
836
|
+
name: Identifier;
|
|
837
|
+
endEnum?: Token;
|
|
838
|
+
body: Array<EnumMemberStatement>;
|
|
839
|
+
});
|
|
840
|
+
readonly tokens: {
|
|
841
|
+
readonly enum?: Token;
|
|
842
|
+
readonly name: Identifier;
|
|
843
|
+
readonly endEnum?: Token;
|
|
844
|
+
};
|
|
845
|
+
readonly body: Array<EnumMemberStatement>;
|
|
846
|
+
readonly kind = AstNodeKind.EnumStatement;
|
|
847
|
+
get location(): Location | undefined;
|
|
848
|
+
getMembers(): EnumMemberStatement[];
|
|
849
|
+
get leadingTrivia(): Token[];
|
|
850
|
+
get endTrivia(): Token[];
|
|
851
|
+
/**
|
|
852
|
+
* Get a map of member names and their values.
|
|
853
|
+
* All values are stored as their AST LiteralExpression representation (i.e. string enum values include the wrapping quotes)
|
|
854
|
+
*/
|
|
855
|
+
getMemberValueMap(): Map<string, string>;
|
|
856
|
+
getMemberValue(name: string): string;
|
|
857
|
+
/**
|
|
858
|
+
* The name of the enum (without the namespace prefix)
|
|
859
|
+
*/
|
|
860
|
+
get name(): string;
|
|
861
|
+
/**
|
|
862
|
+
* The name of the enum WITH its leading namespace (if applicable)
|
|
863
|
+
*/
|
|
864
|
+
get fullName(): string;
|
|
865
|
+
transpile(state: BrsTranspileState): any;
|
|
866
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
867
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
868
|
+
getType(options: GetTypeOptions): any;
|
|
869
|
+
clone(): EnumStatement;
|
|
870
|
+
}
|
|
871
|
+
export declare class EnumMemberStatement extends Statement implements TypedefProvider {
|
|
872
|
+
constructor(options: {
|
|
873
|
+
name: Identifier;
|
|
874
|
+
equals?: Token;
|
|
875
|
+
value?: Expression;
|
|
876
|
+
});
|
|
877
|
+
readonly tokens: {
|
|
878
|
+
readonly name: Identifier;
|
|
879
|
+
readonly equals?: Token;
|
|
880
|
+
};
|
|
881
|
+
readonly value?: Expression;
|
|
882
|
+
readonly kind = AstNodeKind.EnumMemberStatement;
|
|
883
|
+
get location(): Location;
|
|
884
|
+
/**
|
|
885
|
+
* The name of the member
|
|
886
|
+
*/
|
|
887
|
+
get name(): string;
|
|
888
|
+
get leadingTrivia(): Token[];
|
|
889
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
890
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
891
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
892
|
+
getType(options: GetTypeOptions): any;
|
|
893
|
+
clone(): EnumMemberStatement;
|
|
894
|
+
}
|
|
895
|
+
export declare class ConstStatement extends Statement implements TypedefProvider {
|
|
896
|
+
constructor(options: {
|
|
897
|
+
const?: Token;
|
|
898
|
+
name: Identifier;
|
|
899
|
+
equals?: Token;
|
|
900
|
+
value: Expression;
|
|
901
|
+
});
|
|
902
|
+
readonly tokens: {
|
|
903
|
+
readonly const: Token;
|
|
904
|
+
readonly name: Identifier;
|
|
905
|
+
readonly equals: Token;
|
|
906
|
+
};
|
|
907
|
+
readonly value: Expression;
|
|
908
|
+
readonly kind = AstNodeKind.ConstStatement;
|
|
909
|
+
readonly location: Location | undefined;
|
|
910
|
+
get name(): string;
|
|
911
|
+
get leadingTrivia(): Token[];
|
|
912
|
+
/**
|
|
913
|
+
* The name of the statement WITH its leading namespace (if applicable)
|
|
914
|
+
*/
|
|
915
|
+
get fullName(): string;
|
|
916
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
917
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
918
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
919
|
+
getType(options: GetTypeOptions): BscType;
|
|
920
|
+
clone(): ConstStatement;
|
|
921
|
+
}
|
|
922
|
+
export declare class ContinueStatement extends Statement {
|
|
923
|
+
constructor(options: {
|
|
924
|
+
continue?: Token;
|
|
925
|
+
loopType: Token;
|
|
926
|
+
});
|
|
927
|
+
readonly tokens: {
|
|
928
|
+
readonly continue?: Token;
|
|
929
|
+
readonly loopType: Token;
|
|
930
|
+
};
|
|
931
|
+
readonly kind = AstNodeKind.ContinueStatement;
|
|
932
|
+
readonly location: Location | undefined;
|
|
471
933
|
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
472
934
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
935
|
+
get leadingTrivia(): Token[];
|
|
936
|
+
clone(): ContinueStatement;
|
|
937
|
+
}
|
|
938
|
+
export declare class TypecastStatement extends Statement {
|
|
939
|
+
constructor(options: {
|
|
940
|
+
typecast?: Token;
|
|
941
|
+
typecastExpression: TypecastExpression;
|
|
942
|
+
});
|
|
943
|
+
readonly tokens: {
|
|
944
|
+
readonly typecast?: Token;
|
|
945
|
+
};
|
|
946
|
+
readonly typecastExpression: TypecastExpression;
|
|
947
|
+
readonly kind = AstNodeKind.TypecastStatement;
|
|
948
|
+
readonly location: Location;
|
|
949
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
950
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
951
|
+
get leadingTrivia(): Token[];
|
|
952
|
+
getType(options: GetTypeOptions): BscType;
|
|
953
|
+
clone(): TypecastStatement;
|
|
954
|
+
}
|
|
955
|
+
export declare class ConditionalCompileErrorStatement extends Statement {
|
|
956
|
+
constructor(options: {
|
|
957
|
+
hashError?: Token;
|
|
958
|
+
message: Token;
|
|
959
|
+
});
|
|
960
|
+
readonly tokens: {
|
|
961
|
+
readonly hashError?: Token;
|
|
962
|
+
readonly message: Token;
|
|
963
|
+
};
|
|
964
|
+
readonly kind = AstNodeKind.ConditionalCompileErrorStatement;
|
|
965
|
+
readonly location: Location | undefined;
|
|
966
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
967
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
968
|
+
get leadingTrivia(): Token[];
|
|
969
|
+
clone(): ConditionalCompileErrorStatement;
|
|
970
|
+
}
|
|
971
|
+
export declare class AliasStatement extends Statement {
|
|
972
|
+
constructor(options: {
|
|
973
|
+
alias?: Token;
|
|
974
|
+
name: Token;
|
|
975
|
+
equals?: Token;
|
|
976
|
+
value: VariableExpression | DottedGetExpression;
|
|
977
|
+
});
|
|
978
|
+
readonly tokens: {
|
|
979
|
+
readonly alias?: Token;
|
|
980
|
+
readonly name: Token;
|
|
981
|
+
readonly equals?: Token;
|
|
982
|
+
};
|
|
983
|
+
readonly value: Expression;
|
|
984
|
+
readonly kind = AstNodeKind.AliasStatement;
|
|
985
|
+
readonly location: Location;
|
|
986
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
987
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
988
|
+
get leadingTrivia(): Token[];
|
|
989
|
+
getType(options: GetTypeOptions): BscType;
|
|
990
|
+
clone(): AliasStatement;
|
|
991
|
+
}
|
|
992
|
+
export declare class ConditionalCompileStatement extends Statement {
|
|
993
|
+
constructor(options: {
|
|
994
|
+
hashIf?: Token;
|
|
995
|
+
not?: Token;
|
|
996
|
+
condition: Token;
|
|
997
|
+
hashElse?: Token;
|
|
998
|
+
hashEndIf?: Token;
|
|
999
|
+
thenBranch: Block;
|
|
1000
|
+
elseBranch?: ConditionalCompileStatement | Block;
|
|
1001
|
+
});
|
|
1002
|
+
readonly tokens: {
|
|
1003
|
+
readonly hashIf?: Token;
|
|
1004
|
+
readonly not?: Token;
|
|
1005
|
+
readonly condition: Token;
|
|
1006
|
+
readonly hashElse?: Token;
|
|
1007
|
+
readonly hashEndIf?: Token;
|
|
1008
|
+
};
|
|
1009
|
+
readonly thenBranch: Block;
|
|
1010
|
+
readonly elseBranch?: ConditionalCompileStatement | Block;
|
|
1011
|
+
readonly kind = AstNodeKind.ConditionalCompileStatement;
|
|
1012
|
+
readonly location: Location | undefined;
|
|
1013
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
1014
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
1015
|
+
get leadingTrivia(): Token[];
|
|
1016
|
+
clone(): any;
|
|
1017
|
+
getBranchStatementIndex(stmt: Statement): 1 | -1 | 0;
|
|
1018
|
+
}
|
|
1019
|
+
export declare class ConditionalCompileConstStatement extends Statement {
|
|
1020
|
+
constructor(options: {
|
|
1021
|
+
hashConst?: Token;
|
|
1022
|
+
assignment: AssignmentStatement;
|
|
1023
|
+
});
|
|
1024
|
+
readonly tokens: {
|
|
1025
|
+
readonly hashConst?: Token;
|
|
1026
|
+
};
|
|
1027
|
+
readonly assignment: AssignmentStatement;
|
|
1028
|
+
readonly kind = AstNodeKind.ConditionalCompileConstStatement;
|
|
1029
|
+
readonly location: Location | undefined;
|
|
1030
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode | TranspileResult)[];
|
|
1031
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
1032
|
+
get leadingTrivia(): Token[];
|
|
1033
|
+
clone(): ConditionalCompileConstStatement;
|
|
1034
|
+
}
|
|
1035
|
+
export declare class TypeStatement extends Statement {
|
|
1036
|
+
constructor(options: {
|
|
1037
|
+
type?: Token;
|
|
1038
|
+
name: Token;
|
|
1039
|
+
equals?: Token;
|
|
1040
|
+
value: TypeExpression;
|
|
1041
|
+
});
|
|
1042
|
+
readonly tokens: {
|
|
1043
|
+
readonly type?: Token;
|
|
1044
|
+
readonly name: Token;
|
|
1045
|
+
readonly equals?: Token;
|
|
1046
|
+
};
|
|
1047
|
+
readonly value: TypeExpression;
|
|
1048
|
+
readonly kind = AstNodeKind.TypeStatement;
|
|
1049
|
+
readonly location: Location;
|
|
1050
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
1051
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
1052
|
+
get leadingTrivia(): Token[];
|
|
1053
|
+
getType(options: GetTypeOptions): BscType;
|
|
1054
|
+
clone(): TypeStatement;
|
|
473
1055
|
}
|