brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.51
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 +79 -138
- package/bsconfig.schema.json +196 -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 +161 -43
- 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 +29 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +20 -15
- package/dist/CommentFlagProcessor.js +143 -58
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +650 -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 +83 -0
- package/dist/DiagnosticManager.js +422 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +602 -196
- package/dist/DiagnosticMessages.js +926 -342
- 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 +136 -104
- package/dist/LanguageServer.js +577 -741
- 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 +302 -98
- package/dist/Program.js +1613 -726
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +39 -22
- package/dist/ProgramBuilder.js +245 -179
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +227 -106
- package/dist/Scope.js +609 -557
- package/dist/Scope.js.map +1 -1
- package/dist/ScopeNamespaceLookup.d.ts +73 -0
- package/dist/ScopeNamespaceLookup.js +242 -0
- package/dist/ScopeNamespaceLookup.js.map +1 -0
- 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 +145 -26
- package/dist/SymbolTable.js +575 -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 +337 -0
- package/dist/astUtils/CachedLookups.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/creators.d.ts +54 -19
- package/dist/astUtils/creators.js +242 -42
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +199 -85
- package/dist/astUtils/reflection.js +518 -145
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +117 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.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 +26 -4
- package/dist/bscPlugin/BscPlugin.js +96 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +142 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +19 -0
- package/dist/bscPlugin/FileWriter.js +79 -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 +109 -7
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +676 -26
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.d.ts +17 -0
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js +66 -0
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js.map +1 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.d.ts +18 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.js +31 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.js.map +1 -0
- 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/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +220 -0
- package/dist/bscPlugin/definition/DefinitionProvider.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 +238 -0
- package/dist/bscPlugin/hover/HoverProcessor.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/selectionRanges/SelectionRangesProcessor.d.ts +7 -0
- package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.js +77 -0
- package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.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/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 +80 -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/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/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 +34 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +504 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.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 +51 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +714 -0
- package/dist/bscPlugin/validation/BrsFileValidator.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 +158 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1481 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +50 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +140 -28
- 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/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +61 -4
- package/dist/diagnosticUtils.js +285 -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.d.ts +161 -87
- package/dist/files/BrsFile.js +919 -936
- package/dist/files/BrsFile.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/XmlFile.d.ts +80 -41
- package/dist/files/XmlFile.js +162 -137
- package/dist/files/XmlFile.js.map +1 -1
- 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 +987 -125
- package/dist/interfaces.js +21 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +51 -12
- package/dist/lexer/Lexer.js +214 -65
- package/dist/lexer/Lexer.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 +48 -2
- package/dist/lexer/TokenKind.js +167 -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/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +287 -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/Project.d.ts +200 -0
- package/dist/lsp/Project.js +562 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +288 -0
- package/dist/lsp/ProjectManager.js +967 -0
- package/dist/lsp/ProjectManager.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/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/WorkerThreadProject.d.ts +168 -0
- package/dist/lsp/worker/WorkerThreadProject.js +205 -0
- package/dist/lsp/worker/WorkerThreadProject.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.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +205 -0
- package/dist/parser/AstNode.js +305 -0
- package/dist/parser/AstNode.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/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 +601 -220
- package/dist/parser/Expression.js +1516 -502
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.d.ts +137 -121
- package/dist/parser/Parser.js +1808 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/SGParser.d.ts +30 -13
- package/dist/parser/SGParser.js +94 -56
- package/dist/parser/SGParser.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 +854 -267
- package/dist/parser/Statement.js +2416 -621
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +30 -14
- package/dist/parser/TranspileState.js +124 -27
- package/dist/parser/TranspileState.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/roku-types/data.json +20554 -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 +95 -25
- package/dist/types/ArrayType.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/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/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 +63 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ComponentType.d.ts +22 -0
- package/dist/types/ComponentType.js +110 -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/DynamicType.d.ts +13 -5
- package/dist/types/DynamicType.js +26 -5
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +42 -0
- package/dist/types/EnumType.js +101 -0
- package/dist/types/EnumType.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/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/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +30 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +256 -0
- package/dist/types/IntersectionType.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/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +21 -17
- package/dist/types/LongIntegerType.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/ReferenceType.d.ts +123 -0
- package/dist/types/ReferenceType.js +726 -0
- package/dist/types/ReferenceType.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/TypeStatementType.d.ts +19 -0
- package/dist/types/TypeStatementType.js +56 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +157 -0
- package/dist/types/TypedFunctionType.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 +196 -0
- package/dist/types/UnionType.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/helpers.d.ts +51 -0
- package/dist/types/helpers.js +329 -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/util.d.ts +325 -185
- package/dist/util.js +2135 -568
- 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 +183 -138
- package/CHANGELOG.md +0 -1188
- package/dist/astUtils/creators.spec.js +0 -21
- package/dist/astUtils/creators.spec.js.map +0 -1
- 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/astUtils/reflection.spec.d.ts +0 -1
- package/dist/astUtils/reflection.spec.js +0 -292
- package/dist/astUtils/reflection.spec.js.map +0 -1
- package/dist/astUtils/stackedVisitor.spec.d.ts +0 -1
- package/dist/astUtils/stackedVisitor.spec.js +0 -79
- package/dist/astUtils/stackedVisitor.spec.js.map +0 -1
- package/dist/astUtils/visitors.spec.d.ts +0 -1
- package/dist/astUtils/visitors.spec.js +0 -854
- package/dist/astUtils/visitors.spec.js.map +0 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.d.ts +0 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +0 -194
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.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.d.ts +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
- package/dist/files/BrsFile.Class.spec.d.ts +0 -1
- package/dist/files/BrsFile.Class.spec.js +0 -1081
- package/dist/files/BrsFile.Class.spec.js.map +0 -1
- package/dist/files/BrsFile.spec.d.ts +0 -1
- package/dist/files/BrsFile.spec.js +0 -2524
- package/dist/files/BrsFile.spec.js.map +0 -1
- package/dist/files/XmlFile.spec.d.ts +0 -1
- package/dist/files/XmlFile.spec.js +0 -1065
- package/dist/files/XmlFile.spec.js.map +0 -1
- package/dist/files/tests/imports.spec.d.ts +0 -1
- package/dist/files/tests/imports.spec.js +0 -241
- package/dist/files/tests/imports.spec.js.map +0 -1
- package/dist/lexer/Character.spec.d.ts +0 -1
- package/dist/lexer/Character.spec.js +0 -27
- package/dist/lexer/Character.spec.js.map +0 -1
- package/dist/lexer/Lexer.spec.d.ts +0 -1
- package/dist/lexer/Lexer.spec.js +0 -1101
- package/dist/lexer/Lexer.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/Parser.Class.spec.d.ts +0 -1
- package/dist/parser/Parser.Class.spec.js +0 -390
- package/dist/parser/Parser.Class.spec.js.map +0 -1
- package/dist/parser/Parser.spec.d.ts +0 -4
- package/dist/parser/Parser.spec.js +0 -1216
- package/dist/parser/Parser.spec.js.map +0 -1
- package/dist/parser/SGParser.spec.d.ts +0 -1
- package/dist/parser/SGParser.spec.js +0 -145
- package/dist/parser/SGParser.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.d.ts +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/parser/Statement.spec.d.ts +0 -1
- package/dist/parser/Statement.spec.js +0 -94
- package/dist/parser/Statement.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/parser/tests/Parser.spec.d.ts +0 -18
- package/dist/parser/tests/Parser.spec.js +0 -35
- package/dist/parser/tests/Parser.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/For.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/For.spec.js +0 -161
- package/dist/parser/tests/controlFlow/For.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +0 -106
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/If.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/If.spec.js +0 -551
- package/dist/parser/tests/controlFlow/If.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/While.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/While.spec.js +0 -107
- package/dist/parser/tests/controlFlow/While.spec.js.map +0 -1
- package/dist/parser/tests/expression/Additive.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Additive.spec.js +0 -99
- package/dist/parser/tests/expression/Additive.spec.js.map +0 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.d.ts +0 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +0 -254
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +0 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.d.ts +0 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +0 -266
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +0 -1
- package/dist/parser/tests/expression/Boolean.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Boolean.spec.js +0 -83
- package/dist/parser/tests/expression/Boolean.spec.js.map +0 -1
- package/dist/parser/tests/expression/Call.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Call.spec.js +0 -134
- package/dist/parser/tests/expression/Call.spec.js.map +0 -1
- package/dist/parser/tests/expression/Exponential.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Exponential.spec.js +0 -37
- package/dist/parser/tests/expression/Exponential.spec.js.map +0 -1
- package/dist/parser/tests/expression/Function.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Function.spec.js +0 -403
- package/dist/parser/tests/expression/Function.spec.js.map +0 -1
- package/dist/parser/tests/expression/Indexing.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Indexing.spec.js +0 -219
- package/dist/parser/tests/expression/Indexing.spec.js.map +0 -1
- package/dist/parser/tests/expression/Multiplicative.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +0 -67
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +0 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +0 -201
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.d.ts +0 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +0 -105
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +0 -1
- package/dist/parser/tests/expression/Primary.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Primary.spec.js +0 -149
- package/dist/parser/tests/expression/Primary.spec.js.map +0 -1
- package/dist/parser/tests/expression/Relational.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Relational.spec.js +0 -83
- package/dist/parser/tests/expression/Relational.spec.js.map +0 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +0 -201
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +0 -202
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +0 -323
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +0 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.d.ts +0 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +0 -79
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +0 -1
- package/dist/parser/tests/statement/Declaration.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Declaration.spec.js +0 -108
- package/dist/parser/tests/statement/Declaration.spec.js.map +0 -1
- package/dist/parser/tests/statement/Dim.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Dim.spec.js +0 -73
- package/dist/parser/tests/statement/Dim.spec.js.map +0 -1
- package/dist/parser/tests/statement/Function.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Function.spec.js +0 -332
- package/dist/parser/tests/statement/Function.spec.js.map +0 -1
- package/dist/parser/tests/statement/Goto.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Goto.spec.js +0 -50
- package/dist/parser/tests/statement/Goto.spec.js.map +0 -1
- package/dist/parser/tests/statement/Increment.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Increment.spec.js +0 -117
- package/dist/parser/tests/statement/Increment.spec.js.map +0 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +0 -74
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/Misc.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Misc.spec.js +0 -333
- package/dist/parser/tests/statement/Misc.spec.js.map +0 -1
- package/dist/parser/tests/statement/PrintStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +0 -181
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +0 -94
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/Set.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Set.spec.js +0 -218
- package/dist/parser/tests/statement/Set.spec.js.map +0 -1
- package/dist/parser/tests/statement/Stop.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Stop.spec.js +0 -37
- package/dist/parser/tests/statement/Stop.spec.js.map +0 -1
- package/dist/parser/tests/statement/Throw.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Throw.spec.js +0 -35
- package/dist/parser/tests/statement/Throw.spec.js.map +0 -1
- package/dist/parser/tests/statement/TryCatch.spec.d.ts +0 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +0 -140
- package/dist/parser/tests/statement/TryCatch.spec.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/Manifest.spec.d.ts +0 -0
- package/dist/preprocessor/Manifest.spec.js +0 -105
- package/dist/preprocessor/Manifest.spec.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.d.ts +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.d.ts +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/ArrayType.spec.d.ts +0 -1
- package/dist/types/ArrayType.spec.js +0 -30
- package/dist/types/ArrayType.spec.js.map +0 -1
- package/dist/types/BooleanType.spec.d.ts +0 -1
- package/dist/types/BooleanType.spec.js +0 -12
- package/dist/types/BooleanType.spec.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/DoubleType.spec.d.ts +0 -1
- package/dist/types/DoubleType.spec.js +0 -12
- package/dist/types/DoubleType.spec.js.map +0 -1
- package/dist/types/DynamicType.spec.d.ts +0 -1
- package/dist/types/DynamicType.spec.js +0 -12
- package/dist/types/DynamicType.spec.js.map +0 -1
- package/dist/types/FloatType.spec.d.ts +0 -1
- package/dist/types/FloatType.spec.js +0 -12
- package/dist/types/FloatType.spec.js.map +0 -1
- package/dist/types/FunctionType.spec.d.ts +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/IntegerType.spec.d.ts +0 -1
- package/dist/types/IntegerType.spec.js +0 -12
- package/dist/types/IntegerType.spec.js.map +0 -1
- package/dist/types/InvalidType.spec.d.ts +0 -1
- package/dist/types/InvalidType.spec.js +0 -12
- package/dist/types/InvalidType.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/types/LongIntegerType.spec.d.ts +0 -1
- package/dist/types/LongIntegerType.spec.js +0 -12
- package/dist/types/LongIntegerType.spec.js.map +0 -1
- package/dist/types/ObjectType.spec.d.ts +0 -1
- package/dist/types/ObjectType.spec.js +0 -12
- package/dist/types/ObjectType.spec.js.map +0 -1
- package/dist/types/StringType.spec.d.ts +0 -1
- package/dist/types/StringType.spec.js +0 -12
- package/dist/types/StringType.spec.js.map +0 -1
- package/dist/types/VoidType.spec.d.ts +0 -1
- package/dist/types/VoidType.spec.js +0 -12
- package/dist/types/VoidType.spec.js.map +0 -1
- /package/dist/{astUtils/creators.spec.d.ts → lsp/worker/run.d.ts} +0 -0
|
@@ -1,252 +1,423 @@
|
|
|
1
|
-
import type { Token, Identifier } from '../lexer';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { Token, Identifier } from '../lexer/Token';
|
|
2
|
+
import type { PrintSeparatorToken } from '../lexer/TokenKind';
|
|
3
|
+
import type { Block } from './Statement';
|
|
4
|
+
import type { Location } from 'vscode-languageserver';
|
|
4
5
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
5
6
|
import { ParseMode } from './Parser';
|
|
6
7
|
import type { WalkOptions, WalkVisitor } from '../astUtils/visitors';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
8
|
+
import type { GetTypeOptions, TranspileResult, TypedefProvider } from '../interfaces';
|
|
9
|
+
import { VoidType } from '../types/VoidType';
|
|
10
|
+
import { DynamicType } from '../types/DynamicType';
|
|
9
11
|
import type { BscType } from '../types/BscType';
|
|
10
|
-
import {
|
|
12
|
+
import { AstNodeKind, Expression } from './AstNode';
|
|
13
|
+
import { SourceNode } from 'source-map';
|
|
14
|
+
import type { TranspileState } from './TranspileState';
|
|
15
|
+
import { StringType } from '../types/StringType';
|
|
16
|
+
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
17
|
+
import { InvalidType } from '../types/InvalidType';
|
|
11
18
|
import { FunctionType } from '../types/FunctionType';
|
|
12
19
|
export declare type ExpressionVisitor = (expression: Expression, parent: Expression) => void;
|
|
13
|
-
/** A BrightScript expression */
|
|
14
|
-
export declare abstract class Expression {
|
|
15
|
-
/**
|
|
16
|
-
* The starting and ending location of the expression.
|
|
17
|
-
*/
|
|
18
|
-
abstract range: Range;
|
|
19
|
-
abstract transpile(state: BrsTranspileState): TranspileResult;
|
|
20
|
-
/**
|
|
21
|
-
* When being considered by the walk visitor, this describes what type of element the current class is.
|
|
22
|
-
*/
|
|
23
|
-
visitMode: InternalWalkMode;
|
|
24
|
-
abstract walk(visitor: WalkVisitor, options: WalkOptions): any;
|
|
25
|
-
}
|
|
26
20
|
export declare class BinaryExpression extends Expression {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
constructor(options: {
|
|
22
|
+
left: Expression;
|
|
23
|
+
operator: Token;
|
|
24
|
+
right: Expression;
|
|
25
|
+
});
|
|
26
|
+
readonly tokens: {
|
|
27
|
+
readonly operator: Token;
|
|
28
|
+
};
|
|
29
|
+
readonly left: Expression;
|
|
30
|
+
readonly right: Expression;
|
|
31
|
+
readonly kind = AstNodeKind.BinaryExpression;
|
|
32
|
+
readonly location: Location | undefined;
|
|
33
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
33
34
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
35
|
+
getType(options: GetTypeOptions): BscType;
|
|
36
|
+
get leadingTrivia(): Token[];
|
|
37
|
+
clone(): BinaryExpression;
|
|
34
38
|
}
|
|
35
39
|
export declare class CallExpression extends Expression {
|
|
36
|
-
readonly callee: Expression;
|
|
37
|
-
readonly openingParen: Token;
|
|
38
|
-
readonly closingParen: Token;
|
|
39
|
-
readonly args: Expression[];
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Number of parameters that can be defined on a function
|
|
42
|
+
*
|
|
43
|
+
* Prior to Roku OS 11.5, this was 32
|
|
44
|
+
* As of Roku OS 11.5, this is 63
|
|
42
45
|
*/
|
|
43
|
-
readonly namespaceName: NamespacedVariableNameExpression;
|
|
44
46
|
static MaximumArguments: number;
|
|
45
|
-
constructor(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
constructor(options: {
|
|
48
|
+
callee: Expression;
|
|
49
|
+
openingParen?: Token;
|
|
50
|
+
args?: Expression[];
|
|
51
|
+
closingParen?: Token;
|
|
52
|
+
});
|
|
53
|
+
readonly callee: Expression;
|
|
54
|
+
readonly args: Expression[];
|
|
55
|
+
readonly tokens: {
|
|
56
|
+
/**
|
|
57
|
+
* Can either be `(`, or `?(` for optional chaining - defaults to '('
|
|
58
|
+
*/
|
|
59
|
+
readonly openingParen?: Token;
|
|
60
|
+
readonly closingParen?: Token;
|
|
61
|
+
};
|
|
62
|
+
readonly kind = AstNodeKind.CallExpression;
|
|
63
|
+
readonly location: Location | undefined;
|
|
64
|
+
transpile(state: BrsTranspileState, nameOverride?: string): TranspileResult;
|
|
52
65
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
66
|
+
getType(options: GetTypeOptions): BscType;
|
|
67
|
+
get leadingTrivia(): Token[];
|
|
68
|
+
clone(): CallExpression;
|
|
53
69
|
}
|
|
54
70
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
71
|
+
constructor(options: {
|
|
72
|
+
functionType?: Token;
|
|
73
|
+
leftParen?: Token;
|
|
74
|
+
parameters?: FunctionParameterExpression[];
|
|
75
|
+
rightParen?: Token;
|
|
76
|
+
as?: Token;
|
|
77
|
+
returnTypeExpression?: TypeExpression;
|
|
78
|
+
body: Block;
|
|
79
|
+
endFunctionType?: Token;
|
|
80
|
+
});
|
|
81
|
+
readonly kind = AstNodeKind.FunctionExpression;
|
|
55
82
|
readonly parameters: FunctionParameterExpression[];
|
|
56
|
-
body: Block;
|
|
57
|
-
readonly
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
readonly namespaceName?: NamespacedVariableNameExpression;
|
|
68
|
-
readonly parentSymbolTable?: SymbolTable;
|
|
69
|
-
constructor(parameters: FunctionParameterExpression[], body: Block, functionType: Token | null, end: Token, leftParen: Token, rightParen: Token, asToken?: Token, returnTypeToken?: Token,
|
|
70
|
-
/**
|
|
71
|
-
* If this function is enclosed within another function, this will reference that parent function
|
|
72
|
-
*/
|
|
73
|
-
parentFunction?: FunctionExpression, namespaceName?: NamespacedVariableNameExpression, parentSymbolTable?: SymbolTable);
|
|
74
|
-
readonly symbolTable: SymbolTable;
|
|
75
|
-
labelStatements: LabelStatement[];
|
|
76
|
-
/**
|
|
77
|
-
* The type this function returns
|
|
78
|
-
*/
|
|
79
|
-
returnType: BscType;
|
|
80
|
-
/**
|
|
81
|
-
* The list of function calls that are declared within this function scope. This excludes CallExpressions
|
|
82
|
-
* declared in child functions
|
|
83
|
-
*/
|
|
84
|
-
callExpressions: CallExpression[];
|
|
85
|
-
/**
|
|
86
|
-
* If this function is part of a FunctionStatement, this will be set. Otherwise this will be undefined
|
|
87
|
-
*/
|
|
88
|
-
functionStatement?: FunctionStatement;
|
|
89
|
-
/**
|
|
90
|
-
* A list of all child functions declared directly within this function
|
|
91
|
-
*/
|
|
92
|
-
childFunctionExpressions: FunctionExpression[];
|
|
83
|
+
readonly body: Block;
|
|
84
|
+
readonly returnTypeExpression?: TypeExpression;
|
|
85
|
+
readonly tokens: {
|
|
86
|
+
readonly functionType?: Token;
|
|
87
|
+
readonly endFunctionType?: Token;
|
|
88
|
+
readonly leftParen?: Token;
|
|
89
|
+
readonly rightParen?: Token;
|
|
90
|
+
readonly as?: Token;
|
|
91
|
+
};
|
|
92
|
+
get leadingTrivia(): Token[];
|
|
93
|
+
get endTrivia(): Token[];
|
|
93
94
|
/**
|
|
94
95
|
* The range of the function, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
95
96
|
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
96
97
|
*/
|
|
97
|
-
get
|
|
98
|
-
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean):
|
|
99
|
-
getTypedef(state: BrsTranspileState
|
|
98
|
+
get location(): Location;
|
|
99
|
+
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): TranspileResult;
|
|
100
|
+
getTypedef(state: BrsTranspileState): SourceNode[];
|
|
100
101
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
101
|
-
|
|
102
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
103
|
+
private get requiresReturnType();
|
|
104
|
+
clone(): FunctionExpression;
|
|
102
105
|
}
|
|
103
106
|
export declare class FunctionParameterExpression extends Expression {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
readonly
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
transpile(state: BrsTranspileState):
|
|
122
|
-
|
|
123
|
-
getName(parseMode: ParseMode): string;
|
|
107
|
+
constructor(options: {
|
|
108
|
+
name: Identifier;
|
|
109
|
+
equals?: Token;
|
|
110
|
+
defaultValue?: Expression;
|
|
111
|
+
as?: Token;
|
|
112
|
+
typeExpression?: TypeExpression;
|
|
113
|
+
});
|
|
114
|
+
readonly kind = AstNodeKind.FunctionParameterExpression;
|
|
115
|
+
readonly tokens: {
|
|
116
|
+
readonly name: Identifier;
|
|
117
|
+
readonly equals?: Token;
|
|
118
|
+
readonly as?: Token;
|
|
119
|
+
};
|
|
120
|
+
readonly defaultValue?: Expression;
|
|
121
|
+
readonly typeExpression?: TypeExpression;
|
|
122
|
+
getType(options: GetTypeOptions): BscType;
|
|
123
|
+
get location(): Location | undefined;
|
|
124
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
125
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
124
126
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
127
|
+
get leadingTrivia(): Token[];
|
|
128
|
+
clone(): FunctionParameterExpression;
|
|
125
129
|
}
|
|
126
130
|
export declare class DottedGetExpression extends Expression {
|
|
131
|
+
constructor(options: {
|
|
132
|
+
obj: Expression;
|
|
133
|
+
name: Identifier;
|
|
134
|
+
/**
|
|
135
|
+
* Can either be `.`, or `?.` for optional chaining - defaults in transpile to '.'
|
|
136
|
+
*/
|
|
137
|
+
dot?: Token;
|
|
138
|
+
});
|
|
139
|
+
readonly tokens: {
|
|
140
|
+
readonly name: Identifier;
|
|
141
|
+
readonly dot?: Token;
|
|
142
|
+
};
|
|
127
143
|
readonly obj: Expression;
|
|
128
|
-
readonly
|
|
129
|
-
readonly
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
144
|
+
readonly kind = AstNodeKind.DottedGetExpression;
|
|
145
|
+
readonly location: Location | undefined;
|
|
146
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
147
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
133
148
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
149
|
+
getType(options: GetTypeOptions): BscType;
|
|
150
|
+
getName(parseMode: ParseMode): string;
|
|
151
|
+
get leadingTrivia(): Token[];
|
|
152
|
+
clone(): DottedGetExpression;
|
|
134
153
|
}
|
|
135
154
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
155
|
+
constructor(options: {
|
|
156
|
+
obj: Expression;
|
|
157
|
+
/**
|
|
158
|
+
* Can either be `@`, or `?@` for optional chaining - defaults to '@'
|
|
159
|
+
*/
|
|
160
|
+
at?: Token;
|
|
161
|
+
name: Identifier;
|
|
162
|
+
});
|
|
163
|
+
readonly kind = AstNodeKind.XmlAttributeGetExpression;
|
|
164
|
+
readonly tokens: {
|
|
165
|
+
name: Identifier;
|
|
166
|
+
at?: Token;
|
|
167
|
+
};
|
|
136
168
|
readonly obj: Expression;
|
|
137
|
-
readonly
|
|
138
|
-
|
|
139
|
-
constructor(obj: Expression, name: Identifier, at: Token);
|
|
140
|
-
readonly range: Range;
|
|
141
|
-
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
169
|
+
readonly location: Location | undefined;
|
|
170
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
142
171
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
172
|
+
get leadingTrivia(): Token[];
|
|
173
|
+
clone(): XmlAttributeGetExpression;
|
|
143
174
|
}
|
|
144
175
|
export declare class IndexedGetExpression extends Expression {
|
|
176
|
+
constructor(options: {
|
|
177
|
+
obj: Expression;
|
|
178
|
+
indexes: Expression[];
|
|
179
|
+
/**
|
|
180
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
181
|
+
*/
|
|
182
|
+
openingSquare?: Token;
|
|
183
|
+
closingSquare?: Token;
|
|
184
|
+
questionDot?: Token;
|
|
185
|
+
});
|
|
186
|
+
readonly kind = AstNodeKind.IndexedGetExpression;
|
|
145
187
|
readonly obj: Expression;
|
|
146
|
-
readonly
|
|
147
|
-
readonly
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
188
|
+
readonly indexes: Expression[];
|
|
189
|
+
readonly tokens: {
|
|
190
|
+
/**
|
|
191
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
192
|
+
*/
|
|
193
|
+
readonly openingSquare?: Token;
|
|
194
|
+
readonly closingSquare?: Token;
|
|
195
|
+
readonly questionDot?: Token;
|
|
196
|
+
};
|
|
197
|
+
readonly location: Location | undefined;
|
|
198
|
+
transpile(state: BrsTranspileState): any[];
|
|
152
199
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
200
|
+
getType(options: GetTypeOptions): BscType;
|
|
201
|
+
get leadingTrivia(): Token[];
|
|
202
|
+
clone(): IndexedGetExpression;
|
|
153
203
|
}
|
|
154
204
|
export declare class GroupingExpression extends Expression {
|
|
205
|
+
constructor(options: {
|
|
206
|
+
leftParen?: Token;
|
|
207
|
+
rightParen?: Token;
|
|
208
|
+
expression: Expression;
|
|
209
|
+
});
|
|
155
210
|
readonly tokens: {
|
|
156
|
-
|
|
157
|
-
|
|
211
|
+
readonly leftParen?: Token;
|
|
212
|
+
readonly rightParen?: Token;
|
|
158
213
|
};
|
|
159
|
-
expression: Expression;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, expression: Expression);
|
|
164
|
-
readonly range: Range;
|
|
165
|
-
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
214
|
+
readonly expression: Expression;
|
|
215
|
+
readonly kind = AstNodeKind.GroupingExpression;
|
|
216
|
+
readonly location: Location | undefined;
|
|
217
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
166
218
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
219
|
+
getType(options: GetTypeOptions): BscType;
|
|
220
|
+
get leadingTrivia(): Token[];
|
|
221
|
+
clone(): GroupingExpression;
|
|
167
222
|
}
|
|
168
223
|
export declare class LiteralExpression extends Expression {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
224
|
+
constructor(options: {
|
|
225
|
+
value: Token;
|
|
226
|
+
});
|
|
227
|
+
readonly tokens: {
|
|
228
|
+
readonly value: Token;
|
|
229
|
+
};
|
|
230
|
+
readonly kind = AstNodeKind.LiteralExpression;
|
|
231
|
+
get location(): Location;
|
|
232
|
+
getType(options?: GetTypeOptions): DynamicType | VoidType | import("..").ObjectType | InvalidType | import("..").BooleanType | import("..").DoubleType | import("..").FloatType | FunctionType | import("..").IntegerType | import("..").LongIntegerType | StringType;
|
|
233
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
234
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
235
|
+
get leadingTrivia(): Token[];
|
|
236
|
+
clone(): LiteralExpression;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The print statement can have a mix of expressions and separators. These separators represent actual output to the screen,
|
|
240
|
+
* so this AstNode represents those separators (comma, semicolon, and whitespace)
|
|
241
|
+
*/
|
|
242
|
+
export declare class PrintSeparatorExpression extends Expression {
|
|
243
|
+
constructor(options: {
|
|
244
|
+
separator: PrintSeparatorToken;
|
|
245
|
+
});
|
|
246
|
+
readonly tokens: {
|
|
247
|
+
readonly separator: PrintSeparatorToken;
|
|
248
|
+
};
|
|
249
|
+
readonly kind = AstNodeKind.PrintSeparatorExpression;
|
|
250
|
+
location: Location;
|
|
251
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
177
252
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
253
|
+
get leadingTrivia(): Token[];
|
|
254
|
+
clone(): PrintSeparatorExpression;
|
|
178
255
|
}
|
|
179
256
|
/**
|
|
180
257
|
* This is a special expression only used within template strings. It exists so we can prevent producing lots of empty strings
|
|
181
258
|
* during template string transpile by identifying these expressions explicitly and skipping the bslib_toString around them
|
|
182
259
|
*/
|
|
183
260
|
export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
charCode: number;
|
|
261
|
+
constructor(options: {
|
|
262
|
+
value: Token & {
|
|
263
|
+
charCode: number;
|
|
264
|
+
};
|
|
189
265
|
});
|
|
190
|
-
readonly
|
|
191
|
-
|
|
266
|
+
readonly kind = AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
267
|
+
readonly tokens: {
|
|
268
|
+
readonly value: Token & {
|
|
269
|
+
charCode: number;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
readonly location: Location;
|
|
273
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
192
274
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
275
|
+
clone(): EscapedCharCodeLiteralExpression;
|
|
193
276
|
}
|
|
194
277
|
export declare class ArrayLiteralExpression extends Expression {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
readonly
|
|
201
|
-
|
|
278
|
+
constructor(options: {
|
|
279
|
+
elements: Array<Expression>;
|
|
280
|
+
open?: Token;
|
|
281
|
+
close?: Token;
|
|
282
|
+
});
|
|
283
|
+
readonly elements: Array<Expression>;
|
|
284
|
+
readonly tokens: {
|
|
285
|
+
readonly open?: Token;
|
|
286
|
+
readonly close?: Token;
|
|
287
|
+
};
|
|
288
|
+
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
289
|
+
readonly location: Location | undefined;
|
|
290
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
202
291
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
292
|
+
getType(options: GetTypeOptions): BscType;
|
|
293
|
+
get leadingTrivia(): Token[];
|
|
294
|
+
get endTrivia(): Token[];
|
|
295
|
+
clone(): ArrayLiteralExpression;
|
|
203
296
|
}
|
|
204
297
|
export declare class AAMemberExpression extends Expression {
|
|
205
|
-
|
|
206
|
-
|
|
298
|
+
constructor(options: {
|
|
299
|
+
key: Token;
|
|
300
|
+
colon?: Token;
|
|
301
|
+
/** The expression evaluated to determine the member's initial value. */
|
|
302
|
+
value: Expression;
|
|
303
|
+
comma?: Token;
|
|
304
|
+
});
|
|
305
|
+
readonly kind = AstNodeKind.AAMemberExpression;
|
|
306
|
+
readonly location: Location | undefined;
|
|
307
|
+
readonly tokens: {
|
|
308
|
+
readonly key: Token;
|
|
309
|
+
readonly colon?: Token;
|
|
310
|
+
readonly comma?: Token;
|
|
311
|
+
};
|
|
207
312
|
/** The expression evaluated to determine the member's initial value. */
|
|
208
|
-
value: Expression;
|
|
209
|
-
|
|
313
|
+
readonly value: Expression;
|
|
314
|
+
transpile(state: BrsTranspileState): any[];
|
|
315
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
316
|
+
getType(options: GetTypeOptions): BscType;
|
|
317
|
+
get leadingTrivia(): Token[];
|
|
318
|
+
clone(): AAMemberExpression;
|
|
319
|
+
}
|
|
320
|
+
export declare class AAIndexedMemberExpression extends Expression {
|
|
321
|
+
constructor(options: {
|
|
322
|
+
leftBracket?: Token;
|
|
323
|
+
key: Expression;
|
|
324
|
+
rightBracket?: Token;
|
|
325
|
+
colon?: Token;
|
|
326
|
+
/** The expression evaluated to determine the member's initial value. */
|
|
327
|
+
value: Expression;
|
|
328
|
+
comma?: Token;
|
|
329
|
+
});
|
|
330
|
+
readonly tokens: {
|
|
331
|
+
readonly leftBracket?: Token;
|
|
332
|
+
readonly rightBracket?: Token;
|
|
333
|
+
readonly colon?: Token;
|
|
334
|
+
readonly comma?: Token;
|
|
335
|
+
};
|
|
336
|
+
key: Expression;
|
|
210
337
|
/** The expression evaluated to determine the member's initial value. */
|
|
211
|
-
value: Expression
|
|
212
|
-
|
|
338
|
+
value: Expression;
|
|
339
|
+
readonly kind = AstNodeKind.AAIndexedMemberExpression;
|
|
340
|
+
readonly location: Location | undefined;
|
|
213
341
|
transpile(state: BrsTranspileState): any[];
|
|
214
342
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
343
|
+
clone(): AAIndexedMemberExpression;
|
|
215
344
|
}
|
|
216
345
|
export declare class AALiteralExpression extends Expression {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
346
|
+
constructor(options: {
|
|
347
|
+
readonly elements: Array<AAMemberExpression | AAIndexedMemberExpression>;
|
|
348
|
+
readonly open?: Token;
|
|
349
|
+
readonly close?: Token;
|
|
350
|
+
});
|
|
351
|
+
readonly elements: Array<AAMemberExpression | AAIndexedMemberExpression>;
|
|
352
|
+
readonly tokens: {
|
|
353
|
+
readonly open?: Token;
|
|
354
|
+
readonly close?: Token;
|
|
355
|
+
};
|
|
356
|
+
readonly kind = AstNodeKind.AALiteralExpression;
|
|
357
|
+
readonly location: Location | undefined;
|
|
358
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
223
359
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
360
|
+
getType(options: GetTypeOptions): BscType;
|
|
361
|
+
get leadingTrivia(): Token[];
|
|
362
|
+
get endTrivia(): Token[];
|
|
363
|
+
clone(): AALiteralExpression;
|
|
224
364
|
}
|
|
225
365
|
export declare class UnaryExpression extends Expression {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
366
|
+
constructor(options: {
|
|
367
|
+
operator: Token;
|
|
368
|
+
right: Expression;
|
|
369
|
+
});
|
|
370
|
+
readonly kind = AstNodeKind.UnaryExpression;
|
|
371
|
+
readonly location: Location | undefined;
|
|
372
|
+
readonly tokens: {
|
|
373
|
+
readonly operator: Token;
|
|
374
|
+
};
|
|
375
|
+
readonly right: Expression;
|
|
376
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
231
377
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
378
|
+
getType(options: GetTypeOptions): BscType;
|
|
379
|
+
get leadingTrivia(): Token[];
|
|
380
|
+
clone(): UnaryExpression;
|
|
232
381
|
}
|
|
233
382
|
export declare class VariableExpression extends Expression {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
readonly
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
383
|
+
constructor(options: {
|
|
384
|
+
name: Identifier;
|
|
385
|
+
});
|
|
386
|
+
readonly tokens: {
|
|
387
|
+
readonly name: Identifier;
|
|
388
|
+
};
|
|
389
|
+
readonly kind = AstNodeKind.VariableExpression;
|
|
390
|
+
readonly location: Location;
|
|
391
|
+
getName(parseMode?: ParseMode): string;
|
|
392
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
393
|
+
getTypedef(state: BrsTranspileState): TranspileResult[];
|
|
241
394
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
395
|
+
getType(options: GetTypeOptions): BscType;
|
|
396
|
+
get leadingTrivia(): Token[];
|
|
397
|
+
clone(): VariableExpression;
|
|
242
398
|
}
|
|
243
399
|
export declare class SourceLiteralExpression extends Expression {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
400
|
+
constructor(options: {
|
|
401
|
+
value: Token;
|
|
402
|
+
});
|
|
403
|
+
readonly location: Location;
|
|
404
|
+
readonly kind = AstNodeKind.SourceLiteralExpression;
|
|
405
|
+
readonly tokens: {
|
|
406
|
+
readonly value: Token;
|
|
407
|
+
};
|
|
408
|
+
/**
|
|
409
|
+
* Find the index of the function in its parent
|
|
410
|
+
*/
|
|
411
|
+
private findFunctionIndex;
|
|
247
412
|
private getFunctionName;
|
|
248
|
-
|
|
413
|
+
/**
|
|
414
|
+
* Get the line number from our token or from the closest ancestor that has a range
|
|
415
|
+
*/
|
|
416
|
+
private getClosestLineNumber;
|
|
417
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
249
418
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
419
|
+
get leadingTrivia(): Token[];
|
|
420
|
+
clone(): SourceLiteralExpression;
|
|
250
421
|
}
|
|
251
422
|
/**
|
|
252
423
|
* This expression transpiles and acts exactly like a CallExpression,
|
|
@@ -254,99 +425,309 @@ export declare class SourceLiteralExpression extends Expression {
|
|
|
254
425
|
* do more type checking.
|
|
255
426
|
*/
|
|
256
427
|
export declare class NewExpression extends Expression {
|
|
257
|
-
|
|
428
|
+
constructor(options: {
|
|
429
|
+
new?: Token;
|
|
430
|
+
call: CallExpression;
|
|
431
|
+
});
|
|
432
|
+
readonly kind = AstNodeKind.NewExpression;
|
|
433
|
+
readonly location: Location | undefined;
|
|
434
|
+
readonly tokens: {
|
|
435
|
+
readonly new?: Token;
|
|
436
|
+
};
|
|
258
437
|
readonly call: CallExpression;
|
|
259
|
-
constructor(newKeyword: Token, call: CallExpression);
|
|
260
438
|
/**
|
|
261
439
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
262
440
|
*/
|
|
263
|
-
get className():
|
|
264
|
-
|
|
265
|
-
readonly range: Range;
|
|
266
|
-
transpile(state: BrsTranspileState): any[];
|
|
441
|
+
get className(): DottedGetExpression | VariableExpression;
|
|
442
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
267
443
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
444
|
+
getType(options: GetTypeOptions): BscType;
|
|
445
|
+
get leadingTrivia(): Token[];
|
|
446
|
+
clone(): NewExpression;
|
|
268
447
|
}
|
|
269
448
|
export declare class CallfuncExpression extends Expression {
|
|
449
|
+
constructor(options: {
|
|
450
|
+
callee: Expression;
|
|
451
|
+
operator?: Token;
|
|
452
|
+
methodName: Identifier;
|
|
453
|
+
openingParen?: Token;
|
|
454
|
+
args?: Expression[];
|
|
455
|
+
closingParen?: Token;
|
|
456
|
+
});
|
|
270
457
|
readonly callee: Expression;
|
|
271
|
-
readonly operator: Token;
|
|
272
|
-
readonly methodName: Identifier;
|
|
273
|
-
readonly openingParen: Token;
|
|
274
458
|
readonly args: Expression[];
|
|
275
|
-
readonly
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
459
|
+
readonly tokens: {
|
|
460
|
+
readonly operator: Token;
|
|
461
|
+
readonly methodName: Identifier;
|
|
462
|
+
readonly openingParen?: Token;
|
|
463
|
+
readonly closingParen?: Token;
|
|
464
|
+
};
|
|
465
|
+
readonly kind = AstNodeKind.CallfuncExpression;
|
|
466
|
+
readonly location: Location | undefined;
|
|
467
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
279
468
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
469
|
+
getType(options: GetTypeOptions): BscType;
|
|
470
|
+
get leadingTrivia(): Token[];
|
|
471
|
+
clone(): CallfuncExpression;
|
|
280
472
|
}
|
|
281
473
|
/**
|
|
282
474
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
283
475
|
* This is a single expression that represents the string contatenation of all parts of a single quasi.
|
|
284
476
|
*/
|
|
285
477
|
export declare class TemplateStringQuasiExpression extends Expression {
|
|
478
|
+
constructor(options: {
|
|
479
|
+
expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
480
|
+
});
|
|
286
481
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
287
|
-
|
|
288
|
-
readonly
|
|
289
|
-
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean):
|
|
482
|
+
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
483
|
+
readonly location: Location | undefined;
|
|
484
|
+
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): TranspileResult;
|
|
290
485
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
486
|
+
clone(): TemplateStringQuasiExpression;
|
|
291
487
|
}
|
|
292
488
|
export declare class TemplateStringExpression extends Expression {
|
|
293
|
-
|
|
489
|
+
constructor(options: {
|
|
490
|
+
openingBacktick?: Token;
|
|
491
|
+
quasis: TemplateStringQuasiExpression[];
|
|
492
|
+
expressions: Expression[];
|
|
493
|
+
closingBacktick?: Token;
|
|
494
|
+
});
|
|
495
|
+
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
496
|
+
readonly tokens: {
|
|
497
|
+
readonly openingBacktick?: Token;
|
|
498
|
+
readonly closingBacktick?: Token;
|
|
499
|
+
};
|
|
294
500
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
295
501
|
readonly expressions: Expression[];
|
|
296
|
-
readonly
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
transpile(state: BrsTranspileState): any[];
|
|
502
|
+
readonly location: Location | undefined;
|
|
503
|
+
getType(options: GetTypeOptions): StringType;
|
|
504
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
300
505
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
506
|
+
clone(): TemplateStringExpression;
|
|
301
507
|
}
|
|
302
508
|
export declare class TaggedTemplateStringExpression extends Expression {
|
|
303
|
-
|
|
304
|
-
|
|
509
|
+
constructor(options: {
|
|
510
|
+
tagName: Identifier;
|
|
511
|
+
openingBacktick?: Token;
|
|
512
|
+
quasis: TemplateStringQuasiExpression[];
|
|
513
|
+
expressions: Expression[];
|
|
514
|
+
closingBacktick?: Token;
|
|
515
|
+
});
|
|
516
|
+
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
517
|
+
readonly tokens: {
|
|
518
|
+
readonly tagName: Identifier;
|
|
519
|
+
readonly openingBacktick?: Token;
|
|
520
|
+
readonly closingBacktick?: Token;
|
|
521
|
+
};
|
|
305
522
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
306
523
|
readonly expressions: Expression[];
|
|
307
|
-
readonly
|
|
308
|
-
|
|
309
|
-
readonly range: Range;
|
|
310
|
-
transpile(state: BrsTranspileState): any[];
|
|
524
|
+
readonly location: Location | undefined;
|
|
525
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
311
526
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
527
|
+
clone(): TaggedTemplateStringExpression;
|
|
312
528
|
}
|
|
313
529
|
export declare class AnnotationExpression extends Expression {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
530
|
+
constructor(options: {
|
|
531
|
+
at?: Token;
|
|
532
|
+
name: Token;
|
|
533
|
+
call?: CallExpression;
|
|
534
|
+
});
|
|
535
|
+
readonly kind = AstNodeKind.AnnotationExpression;
|
|
536
|
+
readonly tokens: {
|
|
537
|
+
readonly at: Token;
|
|
538
|
+
readonly name: Token;
|
|
539
|
+
};
|
|
540
|
+
get location(): Location | undefined;
|
|
541
|
+
readonly name: string;
|
|
319
542
|
call: CallExpression;
|
|
320
543
|
/**
|
|
321
544
|
* Convert annotation arguments to JavaScript types
|
|
322
545
|
* @param strict If false, keep Expression objects not corresponding to JS types
|
|
323
546
|
*/
|
|
324
547
|
getArguments(strict?: boolean): ExpressionValue[];
|
|
325
|
-
|
|
548
|
+
get leadingTrivia(): Token[];
|
|
549
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
326
550
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
327
|
-
getTypedef(state: BrsTranspileState):
|
|
551
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
552
|
+
clone(): AnnotationExpression;
|
|
328
553
|
}
|
|
329
554
|
export declare class TernaryExpression extends Expression {
|
|
555
|
+
constructor(options: {
|
|
556
|
+
test: Expression;
|
|
557
|
+
questionMark?: Token;
|
|
558
|
+
consequent?: Expression;
|
|
559
|
+
colon?: Token;
|
|
560
|
+
alternate?: Expression;
|
|
561
|
+
});
|
|
562
|
+
readonly kind = AstNodeKind.TernaryExpression;
|
|
563
|
+
readonly location: Location | undefined;
|
|
564
|
+
readonly tokens: {
|
|
565
|
+
readonly questionMark?: Token;
|
|
566
|
+
readonly colon?: Token;
|
|
567
|
+
};
|
|
330
568
|
readonly test: Expression;
|
|
331
|
-
readonly questionMarkToken: Token;
|
|
332
569
|
readonly consequent?: Expression;
|
|
333
|
-
readonly colonToken?: Token;
|
|
334
570
|
readonly alternate?: Expression;
|
|
335
|
-
|
|
336
|
-
range: Range;
|
|
337
|
-
transpile(state: BrsTranspileState): any[];
|
|
571
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
338
572
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
573
|
+
get leadingTrivia(): Token[];
|
|
574
|
+
clone(): TernaryExpression;
|
|
339
575
|
}
|
|
340
576
|
export declare class NullCoalescingExpression extends Expression {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
577
|
+
constructor(options: {
|
|
578
|
+
consequent: Expression;
|
|
579
|
+
questionQuestion?: Token;
|
|
580
|
+
alternate: Expression;
|
|
581
|
+
});
|
|
582
|
+
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
583
|
+
readonly location: Location | undefined;
|
|
584
|
+
readonly tokens: {
|
|
585
|
+
readonly questionQuestion?: Token;
|
|
586
|
+
};
|
|
587
|
+
readonly consequent: Expression;
|
|
588
|
+
readonly alternate: Expression;
|
|
589
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
347
590
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
591
|
+
get leadingTrivia(): Token[];
|
|
592
|
+
clone(): NullCoalescingExpression;
|
|
593
|
+
}
|
|
594
|
+
export declare class RegexLiteralExpression extends Expression {
|
|
595
|
+
constructor(options: {
|
|
596
|
+
regexLiteral: Token;
|
|
597
|
+
});
|
|
598
|
+
readonly kind = AstNodeKind.RegexLiteralExpression;
|
|
599
|
+
readonly tokens: {
|
|
600
|
+
readonly regexLiteral: Token;
|
|
601
|
+
};
|
|
602
|
+
get location(): Location;
|
|
603
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
604
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
605
|
+
clone(): RegexLiteralExpression;
|
|
606
|
+
get leadingTrivia(): Token[];
|
|
348
607
|
}
|
|
349
608
|
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
350
609
|
[key: string]: ExpressionValue;
|
|
351
|
-
};
|
|
610
|
+
} | null;
|
|
611
|
+
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
612
|
+
constructor(options: {
|
|
613
|
+
/**
|
|
614
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
615
|
+
*/
|
|
616
|
+
expression: Expression;
|
|
617
|
+
});
|
|
618
|
+
readonly kind = AstNodeKind.TypeExpression;
|
|
619
|
+
/**
|
|
620
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
621
|
+
*/
|
|
622
|
+
readonly expression: Expression;
|
|
623
|
+
readonly location: Location;
|
|
624
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
625
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
626
|
+
getType(options: GetTypeOptions): BscType;
|
|
627
|
+
getTypedef(state: TranspileState): TranspileResult;
|
|
628
|
+
getName(parseMode?: ParseMode): string;
|
|
629
|
+
getNameParts(): string[];
|
|
630
|
+
clone(): TypeExpression;
|
|
631
|
+
}
|
|
632
|
+
export declare class TypecastExpression extends Expression {
|
|
633
|
+
constructor(options: {
|
|
634
|
+
obj: Expression;
|
|
635
|
+
as?: Token;
|
|
636
|
+
typeExpression?: TypeExpression;
|
|
637
|
+
});
|
|
638
|
+
readonly kind = AstNodeKind.TypecastExpression;
|
|
639
|
+
readonly obj: Expression;
|
|
640
|
+
readonly tokens: {
|
|
641
|
+
readonly as?: Token;
|
|
642
|
+
};
|
|
643
|
+
typeExpression?: TypeExpression;
|
|
644
|
+
readonly location: Location;
|
|
645
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
646
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
647
|
+
getType(options: GetTypeOptions): BscType;
|
|
648
|
+
clone(): TypecastExpression;
|
|
649
|
+
}
|
|
650
|
+
export declare class TypedArrayExpression extends Expression {
|
|
651
|
+
constructor(options: {
|
|
652
|
+
innerType: Expression;
|
|
653
|
+
leftBracket?: Token;
|
|
654
|
+
rightBracket?: Token;
|
|
655
|
+
});
|
|
656
|
+
readonly tokens: {
|
|
657
|
+
readonly leftBracket?: Token;
|
|
658
|
+
readonly rightBracket?: Token;
|
|
659
|
+
};
|
|
660
|
+
readonly innerType: Expression;
|
|
661
|
+
readonly kind = AstNodeKind.TypedArrayExpression;
|
|
662
|
+
readonly location: Location;
|
|
663
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
664
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
665
|
+
getType(options: GetTypeOptions): BscType;
|
|
666
|
+
clone(): TypedArrayExpression;
|
|
667
|
+
}
|
|
668
|
+
export declare class InlineInterfaceExpression extends Expression {
|
|
669
|
+
constructor(options: {
|
|
670
|
+
open?: Token;
|
|
671
|
+
members: InlineInterfaceMemberExpression[];
|
|
672
|
+
close?: Token;
|
|
673
|
+
});
|
|
674
|
+
readonly tokens: {
|
|
675
|
+
readonly open?: Token;
|
|
676
|
+
readonly close?: Token;
|
|
677
|
+
};
|
|
678
|
+
readonly members: InlineInterfaceMemberExpression[];
|
|
679
|
+
readonly kind = AstNodeKind.InlineInterfaceExpression;
|
|
680
|
+
readonly location: Location;
|
|
681
|
+
get leadingTrivia(): Token[];
|
|
682
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
683
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
684
|
+
getType(options: GetTypeOptions): BscType;
|
|
685
|
+
clone(): InlineInterfaceExpression;
|
|
686
|
+
}
|
|
687
|
+
export declare class InlineInterfaceMemberExpression extends Expression {
|
|
688
|
+
constructor(options: {
|
|
689
|
+
optional?: Token;
|
|
690
|
+
name: Token;
|
|
691
|
+
as?: Token;
|
|
692
|
+
typeExpression?: TypeExpression;
|
|
693
|
+
});
|
|
694
|
+
readonly kind = AstNodeKind.InlineInterfaceMemberExpression;
|
|
695
|
+
readonly tokens: {
|
|
696
|
+
readonly optional?: Token;
|
|
697
|
+
readonly name: Token;
|
|
698
|
+
readonly as?: Token;
|
|
699
|
+
};
|
|
700
|
+
readonly typeExpression?: TypeExpression;
|
|
701
|
+
readonly location: Location;
|
|
702
|
+
get leadingTrivia(): Token[];
|
|
703
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
704
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
705
|
+
getType(options: GetTypeOptions): BscType;
|
|
706
|
+
get isOptional(): boolean;
|
|
707
|
+
clone(): InlineInterfaceMemberExpression;
|
|
708
|
+
}
|
|
709
|
+
export declare class TypedFunctionTypeExpression extends Expression {
|
|
710
|
+
constructor(options: {
|
|
711
|
+
functionType?: Token;
|
|
712
|
+
leftParen?: Token;
|
|
713
|
+
params?: FunctionParameterExpression[];
|
|
714
|
+
rightParen?: Token;
|
|
715
|
+
as?: Token;
|
|
716
|
+
returnType?: TypeExpression;
|
|
717
|
+
});
|
|
718
|
+
readonly kind = AstNodeKind.TypedFunctionTypeExpression;
|
|
719
|
+
readonly tokens: {
|
|
720
|
+
readonly functionType?: Token;
|
|
721
|
+
readonly leftParen?: Token;
|
|
722
|
+
readonly rightParen?: Token;
|
|
723
|
+
readonly as?: Token;
|
|
724
|
+
};
|
|
725
|
+
readonly params: FunctionParameterExpression[];
|
|
726
|
+
readonly returnType?: TypeExpression;
|
|
727
|
+
readonly location: Location;
|
|
728
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
729
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
730
|
+
getType(options: GetTypeOptions): BscType;
|
|
731
|
+
clone(): TypedFunctionTypeExpression;
|
|
732
|
+
}
|
|
352
733
|
export {};
|