brighterscript 1.0.0-alpha.24 → 1.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +521 -233
- package/README.md +45 -139
- package/bsconfig.schema.json +46 -0
- 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 +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +40 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- 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 +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +61 -13
- package/dist/DiagnosticMessages.js +116 -19
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -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 +23 -11
- package/dist/LanguageServer.js +150 -69
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +158 -79
- package/dist/Program.js +841 -706
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +130 -103
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +86 -137
- package/dist/Scope.js +453 -519
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +89 -34
- package/dist/SymbolTable.js +239 -114
- package/dist/SymbolTable.js.map +1 -1
- 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 +4 -11
- package/dist/XmlScope.js +75 -88
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +69 -65
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +54 -24
- 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 +132 -104
- package/dist/astUtils/reflection.js +220 -174
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +256 -157
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +53 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +208 -52
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +11 -2
- package/dist/bscPlugin/BscPlugin.js +37 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -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 +136 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +16 -13
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +16 -16
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +52 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +517 -26
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -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 +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -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 +7 -7
- package/dist/bscPlugin/hover/HoverProcessor.js +123 -125
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +371 -53
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +2 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +83 -23
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +83 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -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 +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +38 -12
- 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 +41 -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/BrsFileValidator.d.ts +13 -5
- package/dist/bscPlugin/validation/BrsFileValidator.js +262 -52
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +230 -14
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +58 -27
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -286
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2527 -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 +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +104 -13
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +523 -493
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +111 -117
- package/dist/files/BrsFile.js +684 -1142
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1783 -1233
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -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 +20 -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 +70 -32
- package/dist/files/XmlFile.js +106 -118
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +48 -40
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +84 -24
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -21
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +421 -162
- package/dist/interfaces.js +27 -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 +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +181 -135
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +8 -0
- package/dist/lexer/TokenKind.js +24 -4
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +376 -283
- package/dist/parser/Expression.js +742 -585
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +151 -145
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +48 -201
- package/dist/parser/Parser.js +705 -1026
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +861 -848
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +468 -272
- package/dist/parser/Statement.js +904 -631
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +47 -23
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +62 -21
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +92 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -59
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +96 -57
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +89 -89
- 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 +127 -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 +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +82 -33
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- 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 +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +98 -302
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +36 -34
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +2 -2
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +5 -5
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +5892 -10081
- package/dist/roku-types/index.d.ts +622 -1719
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +171 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +9 -5
- package/dist/types/DynamicType.js +15 -4
- 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 +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- 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 +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- 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 +9 -8
- package/dist/types/ObjectType.js +21 -11
- 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 +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- 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 +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- 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/util.d.ts +143 -139
- package/dist/util.js +864 -385
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +8 -25
- package/dist/validators/ClassValidator.js +99 -179
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -152
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
|
@@ -1,56 +1,33 @@
|
|
|
1
1
|
import type { Token, Identifier } from '../lexer/Token';
|
|
2
2
|
import { TokenKind } from '../lexer/TokenKind';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DottedGetExpression, FunctionExpression, FunctionParameterExpression, TypeExpression } from './Expression';
|
|
4
|
+
import { VariableExpression } from './Expression';
|
|
4
5
|
import type { Range } 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 { InheritableStatement, MemberSymbolTableProvider, TranspileResult, TypedefProvider } from '../interfaces';
|
|
10
|
-
import { DynamicType } from '../types/DynamicType';
|
|
9
|
+
import { type GetTypeOptions, type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
11
10
|
import type { SourceNode } from 'source-map';
|
|
12
11
|
import type { TranspileState } from './TranspileState';
|
|
13
12
|
import { SymbolTable } from '../SymbolTable';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import type { Expression } from './AstNode';
|
|
14
|
+
import { AstNodeKind } from './AstNode';
|
|
15
|
+
import { Statement } from './AstNode';
|
|
16
|
+
import { ClassType } from '../types/ClassType';
|
|
17
|
+
import { EnumMemberType, EnumType } from '../types/EnumType';
|
|
18
|
+
import { NamespaceType } from '../types/NamespaceType';
|
|
16
19
|
import { InterfaceType } from '../types/InterfaceType';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
export declare abstract class Statement {
|
|
21
|
-
/**
|
|
22
|
-
* The starting and ending location of the statement.
|
|
23
|
-
**/
|
|
24
|
-
abstract readonly range: Range;
|
|
25
|
-
/**
|
|
26
|
-
* Statement annotations
|
|
27
|
-
*/
|
|
28
|
-
annotations: AnnotationExpression[];
|
|
29
|
-
abstract transpile(state: BrsTranspileState): TranspileResult;
|
|
30
|
-
/**
|
|
31
|
-
* When being considered by the walk visitor, this describes what type of element the current class is.
|
|
32
|
-
*/
|
|
33
|
-
visitMode: InternalWalkMode;
|
|
34
|
-
abstract walk(visitor: WalkVisitor, options: WalkOptions): any;
|
|
35
|
-
/**
|
|
36
|
-
* The parent node for this statement. This is set dynamically during `onFileValidate`, and should not be set directly.
|
|
37
|
-
*/
|
|
38
|
-
parent?: Statement | Expression;
|
|
39
|
-
/**
|
|
40
|
-
* Get the closest symbol table for this node. Should be overridden in children that directly contain a symbol table
|
|
41
|
-
*/
|
|
42
|
-
getSymbolTable(): SymbolTable;
|
|
43
|
-
}
|
|
20
|
+
import type { BscType } from '../types/BscType';
|
|
21
|
+
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
44
22
|
export declare class EmptyStatement extends Statement {
|
|
23
|
+
constructor(options?: {
|
|
24
|
+
range?: Range;
|
|
25
|
+
});
|
|
45
26
|
/**
|
|
46
27
|
* Create a negative range to indicate this is an interpolated location
|
|
47
28
|
*/
|
|
48
29
|
range: Range;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Create a negative range to indicate this is an interpolated location
|
|
52
|
-
*/
|
|
53
|
-
range?: Range);
|
|
30
|
+
readonly kind = AstNodeKind.EmptyStatement;
|
|
54
31
|
transpile(state: BrsTranspileState): any[];
|
|
55
32
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
56
33
|
}
|
|
@@ -58,90 +35,132 @@ export declare class EmptyStatement extends Statement {
|
|
|
58
35
|
* This is a top-level statement. Consider this the root of the AST
|
|
59
36
|
*/
|
|
60
37
|
export declare class Body extends Statement implements TypedefProvider {
|
|
38
|
+
constructor(options?: {
|
|
39
|
+
statements?: Statement[];
|
|
40
|
+
});
|
|
61
41
|
statements: Statement[];
|
|
42
|
+
readonly kind = AstNodeKind.Body;
|
|
62
43
|
symbolTable: SymbolTable;
|
|
63
|
-
constructor(statements?: Statement[], symbolTable?: SymbolTable);
|
|
64
|
-
getSymbolTable(): SymbolTable;
|
|
65
44
|
get range(): Range;
|
|
66
45
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
67
46
|
getTypedef(state: BrsTranspileState): any[];
|
|
68
47
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
69
48
|
}
|
|
70
49
|
export declare class AssignmentStatement extends Statement {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
constructor(options: {
|
|
51
|
+
name: Identifier;
|
|
52
|
+
equals?: Token;
|
|
53
|
+
value: Expression;
|
|
54
|
+
as?: Token;
|
|
55
|
+
typeExpression?: TypeExpression;
|
|
56
|
+
});
|
|
57
|
+
tokens: {
|
|
58
|
+
equals?: Token;
|
|
59
|
+
name: Identifier;
|
|
60
|
+
as?: Token;
|
|
61
|
+
};
|
|
62
|
+
value: Expression;
|
|
63
|
+
typeExpression: TypeExpression;
|
|
64
|
+
readonly kind = AstNodeKind.AssignmentStatement;
|
|
76
65
|
readonly range: Range;
|
|
77
66
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
78
67
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
68
|
+
getType(options: GetTypeOptions): BscType;
|
|
79
69
|
}
|
|
80
70
|
export declare class Block extends Statement {
|
|
71
|
+
constructor(options: {
|
|
72
|
+
statements: Statement[];
|
|
73
|
+
startingRange: Range;
|
|
74
|
+
});
|
|
81
75
|
readonly statements: Statement[];
|
|
82
76
|
readonly startingRange: Range;
|
|
83
|
-
|
|
77
|
+
readonly kind = AstNodeKind.Block;
|
|
84
78
|
readonly range: Range;
|
|
85
79
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
86
80
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
87
81
|
}
|
|
88
82
|
export declare class ExpressionStatement extends Statement {
|
|
83
|
+
constructor(options: {
|
|
84
|
+
expression: Expression;
|
|
85
|
+
});
|
|
89
86
|
readonly expression: Expression;
|
|
90
|
-
|
|
87
|
+
readonly kind = AstNodeKind.ExpressionStatement;
|
|
91
88
|
readonly range: Range;
|
|
92
89
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
93
90
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
94
91
|
}
|
|
95
92
|
export declare class CommentStatement extends Statement implements Expression, TypedefProvider {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
constructor(options: {
|
|
94
|
+
comments: Token[];
|
|
95
|
+
});
|
|
96
|
+
tokens: {
|
|
97
|
+
comments: Token[];
|
|
98
|
+
};
|
|
99
|
+
readonly kind = AstNodeKind.CommentStatement;
|
|
100
|
+
range: Range;
|
|
99
101
|
get text(): string;
|
|
100
102
|
transpile(state: BrsTranspileState): any[];
|
|
101
103
|
getTypedef(state: TranspileState): any[];
|
|
102
104
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
103
105
|
}
|
|
104
106
|
export declare class ExitForStatement extends Statement {
|
|
107
|
+
constructor(options?: {
|
|
108
|
+
exitFor?: Token;
|
|
109
|
+
});
|
|
105
110
|
readonly tokens: {
|
|
106
|
-
exitFor
|
|
111
|
+
exitFor?: Token;
|
|
107
112
|
};
|
|
108
|
-
|
|
109
|
-
exitFor: Token;
|
|
110
|
-
});
|
|
113
|
+
readonly kind = AstNodeKind.ExitForStatement;
|
|
111
114
|
readonly range: Range;
|
|
112
|
-
transpile(state: BrsTranspileState): SourceNode[];
|
|
115
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
113
116
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
114
117
|
}
|
|
115
118
|
export declare class ExitWhileStatement extends Statement {
|
|
119
|
+
constructor(options?: {
|
|
120
|
+
exitWhile?: Token;
|
|
121
|
+
});
|
|
116
122
|
readonly tokens: {
|
|
117
|
-
exitWhile
|
|
123
|
+
exitWhile?: Token;
|
|
118
124
|
};
|
|
119
|
-
|
|
120
|
-
exitWhile: Token;
|
|
121
|
-
});
|
|
125
|
+
readonly kind = AstNodeKind.ExitWhileStatement;
|
|
122
126
|
readonly range: Range;
|
|
123
|
-
transpile(state: BrsTranspileState): SourceNode[];
|
|
127
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
124
128
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
125
129
|
}
|
|
126
130
|
export declare class FunctionStatement extends Statement implements TypedefProvider {
|
|
127
|
-
|
|
131
|
+
constructor(options: {
|
|
132
|
+
name: Identifier;
|
|
133
|
+
func: FunctionExpression;
|
|
134
|
+
});
|
|
135
|
+
tokens: {
|
|
136
|
+
name: Identifier;
|
|
137
|
+
};
|
|
128
138
|
func: FunctionExpression;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
get range(): Range;
|
|
132
|
-
cacheRange(): Range;
|
|
133
|
-
protected _range: Range;
|
|
139
|
+
readonly kind: AstNodeKind;
|
|
140
|
+
readonly range: Range;
|
|
134
141
|
/**
|
|
135
142
|
* Get the name of this expression based on the parse mode
|
|
136
143
|
*/
|
|
137
144
|
getName(parseMode: ParseMode): string;
|
|
145
|
+
getLeadingTrivia(): Token[];
|
|
138
146
|
transpile(state: BrsTranspileState): any[];
|
|
139
147
|
getTypedef(state: BrsTranspileState): any[];
|
|
140
148
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
149
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
141
150
|
}
|
|
142
151
|
export declare class IfStatement extends Statement {
|
|
152
|
+
constructor(options: {
|
|
153
|
+
if?: Token;
|
|
154
|
+
then?: Token;
|
|
155
|
+
else?: Token;
|
|
156
|
+
endIf?: Token;
|
|
157
|
+
condition: Expression;
|
|
158
|
+
thenBranch: Block;
|
|
159
|
+
elseBranch?: IfStatement | Block;
|
|
160
|
+
isInline?: boolean;
|
|
161
|
+
});
|
|
143
162
|
readonly tokens: {
|
|
144
|
-
if
|
|
163
|
+
if?: Token;
|
|
145
164
|
then?: Token;
|
|
146
165
|
else?: Token;
|
|
147
166
|
endIf?: Token;
|
|
@@ -150,20 +169,21 @@ export declare class IfStatement extends Statement {
|
|
|
150
169
|
readonly thenBranch: Block;
|
|
151
170
|
readonly elseBranch?: IfStatement | Block;
|
|
152
171
|
readonly isInline?: boolean;
|
|
153
|
-
|
|
154
|
-
if: Token;
|
|
155
|
-
then?: Token;
|
|
156
|
-
else?: Token;
|
|
157
|
-
endIf?: Token;
|
|
158
|
-
}, condition: Expression, thenBranch: Block, elseBranch?: IfStatement | Block, isInline?: boolean);
|
|
172
|
+
readonly kind = AstNodeKind.IfStatement;
|
|
159
173
|
readonly range: Range;
|
|
160
174
|
transpile(state: BrsTranspileState): any[];
|
|
161
175
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
162
176
|
}
|
|
163
177
|
export declare class IncrementStatement extends Statement {
|
|
178
|
+
constructor(options: {
|
|
179
|
+
value: Expression;
|
|
180
|
+
operator: Token;
|
|
181
|
+
});
|
|
164
182
|
readonly value: Expression;
|
|
165
|
-
readonly
|
|
166
|
-
|
|
183
|
+
readonly tokens: {
|
|
184
|
+
operator: Token;
|
|
185
|
+
};
|
|
186
|
+
readonly kind = AstNodeKind.IncrementStatement;
|
|
167
187
|
readonly range: Range;
|
|
168
188
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
169
189
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -180,180 +200,247 @@ export interface PrintSeparatorSpace extends Token {
|
|
|
180
200
|
* Represents a `print` statement within BrightScript.
|
|
181
201
|
*/
|
|
182
202
|
export declare class PrintStatement extends Statement {
|
|
183
|
-
readonly tokens: {
|
|
184
|
-
print: Token;
|
|
185
|
-
};
|
|
186
|
-
readonly expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
187
203
|
/**
|
|
188
204
|
* Creates a new internal representation of a BrightScript `print` statement.
|
|
189
|
-
* @param
|
|
190
|
-
*
|
|
205
|
+
* @param options the options for this statement
|
|
206
|
+
* @param options.print a print token
|
|
207
|
+
* @param options.expressions an array of expressions or `PrintSeparator`s to be evaluated and printed.
|
|
191
208
|
*/
|
|
192
|
-
constructor(
|
|
209
|
+
constructor(options: {
|
|
193
210
|
print: Token;
|
|
194
|
-
|
|
211
|
+
expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
212
|
+
});
|
|
213
|
+
readonly tokens: {
|
|
214
|
+
print: Token;
|
|
215
|
+
};
|
|
216
|
+
readonly expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
217
|
+
readonly kind = AstNodeKind.PrintStatement;
|
|
195
218
|
readonly range: Range;
|
|
196
219
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
197
220
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
198
221
|
}
|
|
199
222
|
export declare class DimStatement extends Statement {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
223
|
+
constructor(options: {
|
|
224
|
+
dim?: Token;
|
|
225
|
+
name: Identifier;
|
|
226
|
+
openingSquare?: Token;
|
|
227
|
+
dimensions: Expression[];
|
|
228
|
+
closingSquare?: Token;
|
|
229
|
+
});
|
|
230
|
+
readonly tokens: {
|
|
231
|
+
dim?: Token;
|
|
232
|
+
name: Identifier;
|
|
233
|
+
openingSquare?: Token;
|
|
234
|
+
closingSquare?: Token;
|
|
235
|
+
};
|
|
236
|
+
dimensions: Expression[];
|
|
237
|
+
readonly kind = AstNodeKind.DimStatement;
|
|
238
|
+
range: Range;
|
|
207
239
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
208
240
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
241
|
+
getType(options: GetTypeOptions): BscType;
|
|
209
242
|
}
|
|
210
243
|
export declare class GotoStatement extends Statement {
|
|
244
|
+
constructor(options: {
|
|
245
|
+
goto?: Token;
|
|
246
|
+
label: Token;
|
|
247
|
+
});
|
|
211
248
|
readonly tokens: {
|
|
212
|
-
goto
|
|
249
|
+
goto?: Token;
|
|
213
250
|
label: Token;
|
|
214
251
|
};
|
|
215
|
-
|
|
216
|
-
goto: Token;
|
|
217
|
-
label: Token;
|
|
218
|
-
});
|
|
252
|
+
readonly kind = AstNodeKind.GotoStatement;
|
|
219
253
|
readonly range: Range;
|
|
220
254
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
221
255
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
222
256
|
}
|
|
223
257
|
export declare class LabelStatement extends Statement {
|
|
258
|
+
constructor(options: {
|
|
259
|
+
name: Token;
|
|
260
|
+
colon?: Token;
|
|
261
|
+
});
|
|
224
262
|
readonly tokens: {
|
|
225
|
-
|
|
263
|
+
name: Token;
|
|
226
264
|
colon: Token;
|
|
227
265
|
};
|
|
228
|
-
|
|
229
|
-
identifier: Token;
|
|
230
|
-
colon: Token;
|
|
231
|
-
});
|
|
266
|
+
readonly kind = AstNodeKind.LabelStatement;
|
|
232
267
|
readonly range: Range;
|
|
268
|
+
getLeadingTrivia(): Token[];
|
|
233
269
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
234
270
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
235
271
|
}
|
|
236
272
|
export declare class ReturnStatement extends Statement {
|
|
273
|
+
constructor(options?: {
|
|
274
|
+
return?: Token;
|
|
275
|
+
value?: Expression;
|
|
276
|
+
});
|
|
237
277
|
readonly tokens: {
|
|
238
278
|
return: Token;
|
|
239
279
|
};
|
|
240
280
|
readonly value?: Expression;
|
|
241
|
-
|
|
242
|
-
return: Token;
|
|
243
|
-
}, value?: Expression);
|
|
281
|
+
readonly kind = AstNodeKind.ReturnStatement;
|
|
244
282
|
readonly range: Range;
|
|
245
283
|
transpile(state: BrsTranspileState): any[];
|
|
246
284
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
247
285
|
}
|
|
248
286
|
export declare class EndStatement extends Statement {
|
|
287
|
+
constructor(options?: {
|
|
288
|
+
end?: Token;
|
|
289
|
+
});
|
|
249
290
|
readonly tokens: {
|
|
250
|
-
end
|
|
291
|
+
end?: Token;
|
|
251
292
|
};
|
|
252
|
-
|
|
253
|
-
end: Token;
|
|
254
|
-
});
|
|
293
|
+
readonly kind = AstNodeKind.EndStatement;
|
|
255
294
|
readonly range: Range;
|
|
256
295
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
257
296
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
258
297
|
}
|
|
259
298
|
export declare class StopStatement extends Statement {
|
|
299
|
+
constructor(options?: {
|
|
300
|
+
stop?: Token;
|
|
301
|
+
});
|
|
260
302
|
readonly tokens: {
|
|
261
|
-
stop
|
|
303
|
+
stop?: Token;
|
|
262
304
|
};
|
|
263
|
-
|
|
264
|
-
stop: Token;
|
|
265
|
-
});
|
|
305
|
+
readonly kind = AstNodeKind.StopStatement;
|
|
266
306
|
readonly range: Range;
|
|
267
307
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
268
308
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
269
309
|
}
|
|
270
310
|
export declare class ForStatement extends Statement {
|
|
271
|
-
|
|
311
|
+
constructor(options: {
|
|
312
|
+
for?: Token;
|
|
313
|
+
counterDeclaration: AssignmentStatement;
|
|
314
|
+
to?: Token;
|
|
315
|
+
finalValue: Expression;
|
|
316
|
+
body: Block;
|
|
317
|
+
endFor?: Token;
|
|
318
|
+
step?: Token;
|
|
319
|
+
increment?: Expression;
|
|
320
|
+
});
|
|
321
|
+
readonly tokens: {
|
|
322
|
+
for?: Token;
|
|
323
|
+
to?: Token;
|
|
324
|
+
endFor?: Token;
|
|
325
|
+
step?: Token;
|
|
326
|
+
};
|
|
272
327
|
counterDeclaration: AssignmentStatement;
|
|
273
|
-
toToken: Token;
|
|
274
328
|
finalValue: Expression;
|
|
275
329
|
body: Block;
|
|
276
|
-
endForToken: Token;
|
|
277
|
-
stepToken?: Token;
|
|
278
330
|
increment?: Expression;
|
|
279
|
-
|
|
331
|
+
readonly kind = AstNodeKind.ForStatement;
|
|
280
332
|
readonly range: Range;
|
|
281
333
|
transpile(state: BrsTranspileState): any[];
|
|
282
334
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
283
335
|
}
|
|
284
336
|
export declare class ForEachStatement extends Statement {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
337
|
+
constructor(options: {
|
|
338
|
+
forEach?: Token;
|
|
339
|
+
item: Token;
|
|
340
|
+
in?: Token;
|
|
341
|
+
target: Expression;
|
|
342
|
+
body: Block;
|
|
343
|
+
endFor?: Token;
|
|
344
|
+
});
|
|
345
|
+
readonly tokens: {
|
|
346
|
+
forEach?: Token;
|
|
347
|
+
item: Token;
|
|
348
|
+
in?: Token;
|
|
349
|
+
endFor?: Token;
|
|
350
|
+
};
|
|
351
|
+
readonly body: Block;
|
|
352
|
+
readonly target: Expression;
|
|
353
|
+
readonly kind = AstNodeKind.ForEachStatement;
|
|
292
354
|
readonly range: Range;
|
|
293
355
|
transpile(state: BrsTranspileState): any[];
|
|
294
356
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
295
357
|
}
|
|
296
358
|
export declare class WhileStatement extends Statement {
|
|
359
|
+
constructor(options: {
|
|
360
|
+
while?: Token;
|
|
361
|
+
endWhile?: Token;
|
|
362
|
+
condition: Expression;
|
|
363
|
+
body: Block;
|
|
364
|
+
});
|
|
297
365
|
readonly tokens: {
|
|
298
|
-
while
|
|
299
|
-
endWhile
|
|
366
|
+
while?: Token;
|
|
367
|
+
endWhile?: Token;
|
|
300
368
|
};
|
|
301
369
|
readonly condition: Expression;
|
|
302
370
|
readonly body: Block;
|
|
303
|
-
|
|
304
|
-
while: Token;
|
|
305
|
-
endWhile: Token;
|
|
306
|
-
}, condition: Expression, body: Block);
|
|
371
|
+
readonly kind = AstNodeKind.WhileStatement;
|
|
307
372
|
readonly range: Range;
|
|
308
373
|
transpile(state: BrsTranspileState): any[];
|
|
309
374
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
310
375
|
}
|
|
311
376
|
export declare class DottedSetStatement extends Statement {
|
|
377
|
+
constructor(options: {
|
|
378
|
+
obj: Expression;
|
|
379
|
+
name: Identifier;
|
|
380
|
+
value: Expression;
|
|
381
|
+
dot?: Token;
|
|
382
|
+
});
|
|
383
|
+
readonly tokens: {
|
|
384
|
+
name: Identifier;
|
|
385
|
+
dot?: Token;
|
|
386
|
+
};
|
|
312
387
|
readonly obj: Expression;
|
|
313
|
-
readonly name: Identifier;
|
|
314
388
|
readonly value: Expression;
|
|
315
|
-
|
|
316
|
-
operator: Token;
|
|
317
|
-
constructor(obj: Expression, name: Identifier, value: Expression, dot: Token, operator: Token);
|
|
389
|
+
readonly kind = AstNodeKind.DottedSetStatement;
|
|
318
390
|
readonly range: Range;
|
|
319
391
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
320
392
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
393
|
+
getType(options: GetTypeOptions): BscType;
|
|
321
394
|
}
|
|
322
395
|
export declare class IndexedSetStatement extends Statement {
|
|
396
|
+
constructor(options: {
|
|
397
|
+
obj: Expression;
|
|
398
|
+
indexes: Expression[];
|
|
399
|
+
value: Expression;
|
|
400
|
+
openingSquare?: Token;
|
|
401
|
+
closingSquare?: Token;
|
|
402
|
+
});
|
|
403
|
+
readonly tokens: {
|
|
404
|
+
openingSquare?: Token;
|
|
405
|
+
closingSquare?: Token;
|
|
406
|
+
};
|
|
323
407
|
readonly obj: Expression;
|
|
324
|
-
readonly
|
|
408
|
+
readonly indexes: Expression[];
|
|
325
409
|
readonly value: Expression;
|
|
326
|
-
readonly
|
|
327
|
-
readonly closingSquare: Token;
|
|
328
|
-
operator: Token;
|
|
329
|
-
constructor(obj: Expression, index: Expression, value: Expression, openingSquare: Token, closingSquare: Token, operator: Token);
|
|
410
|
+
readonly kind = AstNodeKind.IndexedSetStatement;
|
|
330
411
|
readonly range: Range;
|
|
331
|
-
transpile(state: BrsTranspileState):
|
|
412
|
+
transpile(state: BrsTranspileState): any[];
|
|
332
413
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
333
414
|
}
|
|
334
415
|
export declare class LibraryStatement extends Statement implements TypedefProvider {
|
|
416
|
+
constructor(options: {
|
|
417
|
+
library: Token;
|
|
418
|
+
filePath?: Token;
|
|
419
|
+
});
|
|
335
420
|
readonly tokens: {
|
|
336
421
|
library: Token;
|
|
337
|
-
filePath
|
|
422
|
+
filePath?: Token;
|
|
338
423
|
};
|
|
339
|
-
|
|
340
|
-
library: Token;
|
|
341
|
-
filePath: Token | undefined;
|
|
342
|
-
});
|
|
424
|
+
readonly kind = AstNodeKind.LibraryStatement;
|
|
343
425
|
readonly range: Range;
|
|
344
426
|
transpile(state: BrsTranspileState): any[];
|
|
345
427
|
getTypedef(state: BrsTranspileState): any[];
|
|
346
428
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
347
429
|
}
|
|
348
430
|
export declare class NamespaceStatement extends Statement implements TypedefProvider {
|
|
349
|
-
|
|
350
|
-
|
|
431
|
+
constructor(options: {
|
|
432
|
+
namespace?: Token;
|
|
433
|
+
nameExpression: VariableExpression | DottedGetExpression;
|
|
434
|
+
body: Body;
|
|
435
|
+
endNamespace?: Token;
|
|
436
|
+
});
|
|
437
|
+
readonly tokens: {
|
|
438
|
+
namespace?: Token;
|
|
439
|
+
endNamespace?: Token;
|
|
440
|
+
};
|
|
441
|
+
readonly nameExpression: VariableExpression | DottedGetExpression;
|
|
351
442
|
body: Body;
|
|
352
|
-
|
|
353
|
-
readonly parentSymbolTable?: SymbolTable;
|
|
354
|
-
constructor(keyword: Token, nameExpression: NamespacedVariableNameExpression, body: Body, endKeyword: Token, parentSymbolTable?: SymbolTable);
|
|
355
|
-
symbolTable: SymbolTable;
|
|
356
|
-
getSymbolTable(): SymbolTable;
|
|
443
|
+
readonly kind = AstNodeKind.NamespaceStatement;
|
|
357
444
|
/**
|
|
358
445
|
* The string name for this namespace
|
|
359
446
|
*/
|
|
@@ -362,16 +449,25 @@ export declare class NamespaceStatement extends Statement implements TypedefProv
|
|
|
362
449
|
private _range;
|
|
363
450
|
cacheRange(): Range;
|
|
364
451
|
getName(parseMode: ParseMode): string;
|
|
452
|
+
getLeadingTrivia(): Token[];
|
|
453
|
+
getNameParts(): Identifier[];
|
|
365
454
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
366
455
|
getTypedef(state: BrsTranspileState): string[];
|
|
367
456
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
457
|
+
getType(options: GetTypeOptions): NamespaceType;
|
|
368
458
|
}
|
|
369
459
|
export declare class ImportStatement extends Statement implements TypedefProvider {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
460
|
+
constructor(options: {
|
|
461
|
+
import?: Token;
|
|
462
|
+
filePath: Token;
|
|
463
|
+
});
|
|
464
|
+
readonly tokens: {
|
|
465
|
+
import?: Token;
|
|
466
|
+
filePath: Token;
|
|
467
|
+
};
|
|
468
|
+
readonly kind = AstNodeKind.ImportStatement;
|
|
469
|
+
range: Range;
|
|
373
470
|
filePath: string;
|
|
374
|
-
readonly range: Range;
|
|
375
471
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
376
472
|
/**
|
|
377
473
|
* Get the typedef for this statement
|
|
@@ -379,87 +475,133 @@ export declare class ImportStatement extends Statement implements TypedefProvide
|
|
|
379
475
|
getTypedef(state: BrsTranspileState): string[];
|
|
380
476
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
381
477
|
}
|
|
382
|
-
export declare class InterfaceStatement extends Statement implements TypedefProvider
|
|
383
|
-
|
|
384
|
-
|
|
478
|
+
export declare class InterfaceStatement extends Statement implements TypedefProvider {
|
|
479
|
+
constructor(options: {
|
|
480
|
+
interface: Token;
|
|
481
|
+
name: Identifier;
|
|
482
|
+
extends?: Token;
|
|
483
|
+
parentInterfaceName?: TypeExpression;
|
|
484
|
+
body: Statement[];
|
|
485
|
+
endInterface?: Token;
|
|
486
|
+
});
|
|
487
|
+
parentInterfaceName?: TypeExpression;
|
|
385
488
|
body: Statement[];
|
|
386
|
-
|
|
387
|
-
readonly memberTable: SymbolTable;
|
|
388
|
-
constructor(interfaceToken: Token, name: Identifier, extendsToken: Token, parentInterfaceName: NamespacedVariableNameExpression, body: Statement[], endInterfaceToken: Token, namespaceName: NamespacedVariableNameExpression);
|
|
489
|
+
readonly kind = AstNodeKind.InterfaceStatement;
|
|
389
490
|
tokens: {
|
|
390
|
-
interface
|
|
491
|
+
interface?: Token;
|
|
391
492
|
name: Identifier;
|
|
392
|
-
extends
|
|
393
|
-
endInterface
|
|
493
|
+
extends?: Token;
|
|
494
|
+
endInterface?: Token;
|
|
394
495
|
};
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
methods: InterfaceMethodStatement[];
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
hasParent(): boolean;
|
|
401
|
-
getParentName(): boolean;
|
|
496
|
+
range: Range;
|
|
497
|
+
get fields(): InterfaceFieldStatement[];
|
|
498
|
+
get methods(): InterfaceMethodStatement[];
|
|
499
|
+
hasParentInterface(): boolean;
|
|
500
|
+
getLeadingTrivia(): Token[];
|
|
402
501
|
/**
|
|
403
|
-
*
|
|
404
|
-
* @returns array of possible parent interface names
|
|
502
|
+
* The name of the interface WITH its leading namespace (if applicable)
|
|
405
503
|
*/
|
|
406
|
-
|
|
407
|
-
getThisBscType(): InterfaceType;
|
|
504
|
+
get fullName(): string;
|
|
408
505
|
/**
|
|
409
|
-
* The name of the interface
|
|
506
|
+
* The name of the interface (without the namespace prefix)
|
|
507
|
+
*/
|
|
508
|
+
get name(): string;
|
|
509
|
+
/**
|
|
510
|
+
* Get the name of this expression based on the parse mode
|
|
410
511
|
*/
|
|
411
512
|
getName(parseMode: ParseMode): string;
|
|
412
513
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
413
514
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
414
515
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
516
|
+
getType(options: GetTypeOptions): InterfaceType;
|
|
415
517
|
}
|
|
416
518
|
export declare class InterfaceFieldStatement extends Statement implements TypedefProvider {
|
|
417
|
-
type?: TypeExpression;
|
|
418
|
-
namespaceName?: NamespacedVariableNameExpression;
|
|
419
519
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
420
|
-
constructor(
|
|
421
|
-
|
|
520
|
+
constructor(options: {
|
|
521
|
+
name: Identifier;
|
|
522
|
+
as?: Token;
|
|
523
|
+
typeExpression?: TypeExpression;
|
|
524
|
+
optional?: Token;
|
|
525
|
+
});
|
|
526
|
+
readonly kind = AstNodeKind.InterfaceFieldStatement;
|
|
527
|
+
typeExpression?: TypeExpression;
|
|
528
|
+
range: Range;
|
|
422
529
|
tokens: {
|
|
423
530
|
name: Identifier;
|
|
424
531
|
as: Token;
|
|
532
|
+
optional?: Token;
|
|
425
533
|
};
|
|
426
|
-
|
|
427
|
-
get name():
|
|
534
|
+
getLeadingTrivia(): Token[];
|
|
535
|
+
get name(): string;
|
|
536
|
+
get isOptional(): boolean;
|
|
428
537
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
429
538
|
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
539
|
+
getType(options: GetTypeOptions): BscType;
|
|
430
540
|
}
|
|
431
|
-
export declare class InterfaceMethodStatement extends
|
|
541
|
+
export declare class InterfaceMethodStatement extends Statement implements TypedefProvider {
|
|
432
542
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
433
|
-
constructor(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
readonly
|
|
444
|
-
|
|
445
|
-
readonly parentClassName?: NamespacedVariableNameExpression;
|
|
446
|
-
readonly namespaceName?: NamespacedVariableNameExpression;
|
|
447
|
-
readonly currentSymbolTable?: SymbolTable;
|
|
448
|
-
readonly symbolTable: SymbolTable;
|
|
449
|
-
readonly memberTable: SymbolTable;
|
|
450
|
-
constructor(classKeyword: Token,
|
|
543
|
+
constructor(options: {
|
|
544
|
+
functionType?: Token;
|
|
545
|
+
name: Identifier;
|
|
546
|
+
leftParen?: Token;
|
|
547
|
+
params?: FunctionParameterExpression[];
|
|
548
|
+
rightParen?: Token;
|
|
549
|
+
as?: Token;
|
|
550
|
+
returnTypeExpression?: TypeExpression;
|
|
551
|
+
optional?: Token;
|
|
552
|
+
});
|
|
553
|
+
readonly kind = AstNodeKind.InterfaceMethodStatement;
|
|
554
|
+
get range(): Range;
|
|
451
555
|
/**
|
|
452
|
-
*
|
|
556
|
+
* Get the name of this method.
|
|
453
557
|
*/
|
|
454
|
-
name: Identifier, body: Statement[], end: Token, extendsKeyword?: Token, parentClassName?: NamespacedVariableNameExpression, namespaceName?: NamespacedVariableNameExpression, currentSymbolTable?: SymbolTable);
|
|
455
558
|
getName(parseMode: ParseMode): string;
|
|
559
|
+
tokens: {
|
|
560
|
+
optional?: Token;
|
|
561
|
+
functionType: Token;
|
|
562
|
+
name: Identifier;
|
|
563
|
+
leftParen?: Token;
|
|
564
|
+
rightParen?: Token;
|
|
565
|
+
as?: Token;
|
|
566
|
+
};
|
|
567
|
+
params: FunctionParameterExpression[];
|
|
568
|
+
returnTypeExpression?: TypeExpression;
|
|
569
|
+
get isOptional(): boolean;
|
|
570
|
+
getLeadingTrivia(): Token[];
|
|
571
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
572
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
573
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
574
|
+
}
|
|
575
|
+
export declare class ClassStatement extends Statement implements TypedefProvider {
|
|
576
|
+
constructor(options: {
|
|
577
|
+
class?: Token;
|
|
578
|
+
/**
|
|
579
|
+
* The name of the class (without namespace prefix)
|
|
580
|
+
*/
|
|
581
|
+
name: Identifier;
|
|
582
|
+
body: Statement[];
|
|
583
|
+
endClass?: Token;
|
|
584
|
+
extends?: Token;
|
|
585
|
+
parentClassName?: TypeExpression;
|
|
586
|
+
});
|
|
587
|
+
readonly kind = AstNodeKind.ClassStatement;
|
|
588
|
+
tokens: {
|
|
589
|
+
class?: Token;
|
|
590
|
+
/**
|
|
591
|
+
* The name of the class (without namespace prefix)
|
|
592
|
+
*/
|
|
593
|
+
name: Identifier;
|
|
594
|
+
endClass?: Token;
|
|
595
|
+
extends?: Token;
|
|
596
|
+
};
|
|
597
|
+
readonly body: Statement[];
|
|
598
|
+
readonly parentClassName: TypeExpression;
|
|
599
|
+
getName(parseMode: ParseMode): string;
|
|
600
|
+
getLeadingTrivia(): Token[];
|
|
456
601
|
memberMap: Record<string, MemberStatement>;
|
|
457
602
|
methods: MethodStatement[];
|
|
458
603
|
fields: FieldStatement[];
|
|
459
604
|
readonly range: Range;
|
|
460
|
-
getThisBscType(): CustomType;
|
|
461
|
-
getConstructorFunctionType(): import("../types/TypedFunctionType").TypedFunctionType;
|
|
462
|
-
buildSymbolTable(parentClass?: InheritableStatement): void;
|
|
463
605
|
transpile(state: BrsTranspileState): any[];
|
|
464
606
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
465
607
|
/**
|
|
@@ -468,18 +610,14 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
468
610
|
* The base class is index 0, its child is index 1, and so on.
|
|
469
611
|
*/
|
|
470
612
|
getParentClassIndex(state: BrsTranspileState): number;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Gets an array of possible parent class names, taking into account the namespace this class was created under
|
|
474
|
-
* @returns array of possible parent class names
|
|
475
|
-
*/
|
|
476
|
-
getPossibleFullParentNames(): string[];
|
|
613
|
+
hasParentClass(): boolean;
|
|
477
614
|
/**
|
|
478
615
|
* Get all ancestor classes, in closest-to-furthest order (i.e. 0 is parent, 1 is grandparent, etc...).
|
|
479
616
|
* This will return an empty array if no ancestors were found
|
|
480
617
|
*/
|
|
481
618
|
getAncestors(state: BrsTranspileState): ClassStatement[];
|
|
482
619
|
private getBuilderName;
|
|
620
|
+
getConstructorType(): TypedFunctionType;
|
|
483
621
|
/**
|
|
484
622
|
* Get the constructor function for this class (if exists), or undefined if not exist
|
|
485
623
|
*/
|
|
@@ -501,16 +639,30 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
501
639
|
*/
|
|
502
640
|
private getTranspiledClassFunction;
|
|
503
641
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
642
|
+
getType(options: GetTypeOptions): ClassType;
|
|
504
643
|
}
|
|
505
644
|
export declare class MethodStatement extends FunctionStatement {
|
|
506
|
-
|
|
507
|
-
|
|
645
|
+
constructor(options: {
|
|
646
|
+
modifiers?: Token | Token[];
|
|
647
|
+
name: Identifier;
|
|
648
|
+
func: FunctionExpression;
|
|
649
|
+
override?: Token;
|
|
650
|
+
});
|
|
651
|
+
readonly kind: AstNodeKind;
|
|
508
652
|
modifiers: Token[];
|
|
653
|
+
readonly tokens: {
|
|
654
|
+
name: Identifier;
|
|
655
|
+
override?: Token;
|
|
656
|
+
};
|
|
509
657
|
get accessModifier(): Token;
|
|
510
|
-
|
|
511
|
-
|
|
658
|
+
readonly range: Range;
|
|
659
|
+
/**
|
|
660
|
+
* Get the name of this method.
|
|
661
|
+
*/
|
|
662
|
+
getName(parseMode: ParseMode): string;
|
|
663
|
+
getLeadingTrivia(): Token[];
|
|
512
664
|
transpile(state: BrsTranspileState): any[];
|
|
513
|
-
getTypedef(state: BrsTranspileState): string[];
|
|
665
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
514
666
|
/**
|
|
515
667
|
* All child classes must call the parent constructor. The type checker will warn users when they don't call it in their own class,
|
|
516
668
|
* but we still need to call it even if they have omitted it. This injects the super call if it's missing
|
|
@@ -523,87 +675,110 @@ export declare class MethodStatement extends FunctionStatement {
|
|
|
523
675
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
524
676
|
}
|
|
525
677
|
export declare class FieldStatement extends Statement implements TypedefProvider {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
678
|
+
constructor(options: {
|
|
679
|
+
accessModifier?: Token;
|
|
680
|
+
name: Identifier;
|
|
681
|
+
as?: Token;
|
|
682
|
+
typeExpression?: TypeExpression;
|
|
683
|
+
equals?: Token;
|
|
684
|
+
initialValue?: Expression;
|
|
685
|
+
optional?: Token;
|
|
686
|
+
});
|
|
687
|
+
readonly tokens: {
|
|
688
|
+
accessModifier?: Token;
|
|
689
|
+
name: Identifier;
|
|
690
|
+
as?: Token;
|
|
691
|
+
equals?: Token;
|
|
692
|
+
optional?: Token;
|
|
693
|
+
};
|
|
694
|
+
typeExpression?: TypeExpression;
|
|
695
|
+
initialValue?: Expression;
|
|
696
|
+
readonly kind = AstNodeKind.FieldStatement;
|
|
535
697
|
/**
|
|
536
698
|
* Derive a ValueKind from the type token, or the initial value.
|
|
537
699
|
* Defaults to `DynamicType`
|
|
538
700
|
*/
|
|
539
|
-
getType(
|
|
701
|
+
getType(options: GetTypeOptions): BscType;
|
|
702
|
+
readonly range: Range;
|
|
703
|
+
getLeadingTrivia(): Token[];
|
|
704
|
+
get isOptional(): boolean;
|
|
540
705
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
541
706
|
getTypedef(state: BrsTranspileState): any[];
|
|
542
707
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
543
708
|
}
|
|
544
709
|
export declare type MemberStatement = FieldStatement | MethodStatement;
|
|
545
|
-
export declare type InterfaceMemberStatement = InterfaceFieldStatement | InterfaceMethodStatement;
|
|
546
|
-
export declare type MemberFieldStatement = FieldStatement | InterfaceFieldStatement;
|
|
547
|
-
export declare type MemberMethodStatement = MethodStatement | InterfaceMethodStatement;
|
|
548
710
|
export declare class TryCatchStatement extends Statement {
|
|
549
|
-
|
|
550
|
-
try
|
|
711
|
+
constructor(options?: {
|
|
712
|
+
try?: Token;
|
|
551
713
|
endTry?: Token;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
try
|
|
714
|
+
tryBranch?: Block;
|
|
715
|
+
catchStatement?: CatchStatement;
|
|
716
|
+
});
|
|
717
|
+
readonly tokens: {
|
|
718
|
+
try?: Token;
|
|
557
719
|
endTry?: Token;
|
|
558
|
-
}
|
|
720
|
+
};
|
|
721
|
+
tryBranch: Block;
|
|
722
|
+
catchStatement: CatchStatement;
|
|
723
|
+
readonly kind = AstNodeKind.TryCatchStatement;
|
|
559
724
|
readonly range: Range;
|
|
560
725
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
561
726
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
562
727
|
}
|
|
563
728
|
export declare class CatchStatement extends Statement {
|
|
564
|
-
|
|
565
|
-
catch
|
|
729
|
+
constructor(options?: {
|
|
730
|
+
catch?: Token;
|
|
731
|
+
exceptionVariable?: Identifier;
|
|
732
|
+
catchBranch?: Block;
|
|
733
|
+
});
|
|
734
|
+
readonly tokens: {
|
|
735
|
+
catch?: Token;
|
|
736
|
+
exceptionVariable?: Identifier;
|
|
566
737
|
};
|
|
567
|
-
exceptionVariable?: Identifier;
|
|
568
738
|
catchBranch?: Block;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}, exceptionVariable?: Identifier, catchBranch?: Block);
|
|
572
|
-
get range(): Range;
|
|
739
|
+
readonly kind = AstNodeKind.CatchStatement;
|
|
740
|
+
range: Range;
|
|
573
741
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
574
742
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
575
743
|
}
|
|
576
744
|
export declare class ThrowStatement extends Statement {
|
|
577
|
-
|
|
745
|
+
constructor(options?: {
|
|
746
|
+
throw?: Token;
|
|
747
|
+
expression?: Expression;
|
|
748
|
+
});
|
|
749
|
+
readonly tokens: {
|
|
750
|
+
throw?: Token;
|
|
751
|
+
};
|
|
578
752
|
expression?: Expression;
|
|
579
|
-
|
|
580
|
-
|
|
753
|
+
readonly kind = AstNodeKind.ThrowStatement;
|
|
754
|
+
range: Range;
|
|
581
755
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
582
756
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
583
757
|
}
|
|
584
758
|
export declare class EnumStatement extends Statement implements TypedefProvider {
|
|
759
|
+
constructor(options: {
|
|
760
|
+
enum?: Token;
|
|
761
|
+
name: Identifier;
|
|
762
|
+
endEnum?: Token;
|
|
763
|
+
body: Array<EnumMemberStatement | CommentStatement>;
|
|
764
|
+
});
|
|
585
765
|
tokens: {
|
|
586
|
-
enum
|
|
766
|
+
enum?: Token;
|
|
587
767
|
name: Identifier;
|
|
588
|
-
endEnum
|
|
768
|
+
endEnum?: Token;
|
|
589
769
|
};
|
|
590
770
|
body: Array<EnumMemberStatement | CommentStatement>;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
enum: Token;
|
|
595
|
-
name: Identifier;
|
|
596
|
-
endEnum: Token;
|
|
597
|
-
}, body: Array<EnumMemberStatement | CommentStatement>, namespaceName?: NamespacedVariableNameExpression);
|
|
598
|
-
readonly range: Range;
|
|
771
|
+
readonly kind = AstNodeKind.EnumStatement;
|
|
772
|
+
symbolTable: SymbolTable;
|
|
773
|
+
get range(): Range;
|
|
599
774
|
getMembers(): EnumMemberStatement[];
|
|
775
|
+
getLeadingTrivia(): Token[];
|
|
600
776
|
/**
|
|
601
777
|
* Get a map of member names and their values.
|
|
602
778
|
* All values are stored as their AST LiteralExpression representation (i.e. string enum values include the wrapping quotes)
|
|
603
779
|
*/
|
|
604
780
|
getMemberValueMap(): Map<string, string>;
|
|
605
781
|
getMemberValue(name: string): string;
|
|
606
|
-
buildSymbolTable(): void;
|
|
607
782
|
/**
|
|
608
783
|
* The name of the enum (without the namespace prefix)
|
|
609
784
|
*/
|
|
@@ -612,45 +787,51 @@ export declare class EnumStatement extends Statement implements TypedefProvider
|
|
|
612
787
|
* The name of the enum WITH its leading namespace (if applicable)
|
|
613
788
|
*/
|
|
614
789
|
get fullName(): string;
|
|
615
|
-
getThisBscType(): EnumType;
|
|
616
790
|
transpile(state: BrsTranspileState): any[];
|
|
617
791
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
618
792
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
793
|
+
getType(options: GetTypeOptions): EnumType;
|
|
619
794
|
}
|
|
620
795
|
export declare class EnumMemberStatement extends Statement implements TypedefProvider {
|
|
796
|
+
constructor(options: {
|
|
797
|
+
name: Identifier;
|
|
798
|
+
equals?: Token;
|
|
799
|
+
value?: Expression;
|
|
800
|
+
});
|
|
621
801
|
tokens: {
|
|
622
802
|
name: Identifier;
|
|
623
|
-
|
|
803
|
+
equals?: Token;
|
|
624
804
|
};
|
|
625
805
|
value?: Expression;
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
equal?: Token;
|
|
629
|
-
}, value?: Expression);
|
|
630
|
-
readonly range: Range;
|
|
806
|
+
readonly kind = AstNodeKind.EnumMemberStatement;
|
|
807
|
+
get range(): Range;
|
|
631
808
|
/**
|
|
632
809
|
* The name of the member
|
|
633
810
|
*/
|
|
634
811
|
get name(): string;
|
|
812
|
+
getLeadingTrivia(): Token[];
|
|
635
813
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
636
814
|
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
637
815
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
816
|
+
getType(options: GetTypeOptions): EnumMemberType;
|
|
638
817
|
}
|
|
639
818
|
export declare class ConstStatement extends Statement implements TypedefProvider {
|
|
819
|
+
constructor(options: {
|
|
820
|
+
const?: Token;
|
|
821
|
+
name: Identifier;
|
|
822
|
+
equals?: Token;
|
|
823
|
+
value: Expression;
|
|
824
|
+
});
|
|
640
825
|
tokens: {
|
|
641
826
|
const: Token;
|
|
642
827
|
name: Identifier;
|
|
643
828
|
equals: Token;
|
|
644
829
|
};
|
|
645
830
|
value: Expression;
|
|
646
|
-
readonly
|
|
647
|
-
constructor(tokens: {
|
|
648
|
-
const: Token;
|
|
649
|
-
name: Identifier;
|
|
650
|
-
equals: Token;
|
|
651
|
-
}, value: Expression, namespaceName?: NamespacedVariableNameExpression);
|
|
831
|
+
readonly kind = AstNodeKind.ConstStatement;
|
|
652
832
|
range: Range;
|
|
653
833
|
get name(): string;
|
|
834
|
+
getLeadingTrivia(): Token[];
|
|
654
835
|
/**
|
|
655
836
|
* The name of the statement WITH its leading namespace (if applicable)
|
|
656
837
|
*/
|
|
@@ -658,4 +839,19 @@ export declare class ConstStatement extends Statement implements TypedefProvider
|
|
|
658
839
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
659
840
|
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
660
841
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
842
|
+
getType(options: GetTypeOptions): BscType;
|
|
843
|
+
}
|
|
844
|
+
export declare class ContinueStatement extends Statement {
|
|
845
|
+
constructor(options: {
|
|
846
|
+
continue?: Token;
|
|
847
|
+
loopType: Token;
|
|
848
|
+
});
|
|
849
|
+
tokens: {
|
|
850
|
+
continue?: Token;
|
|
851
|
+
loopType: Token;
|
|
852
|
+
};
|
|
853
|
+
readonly kind = AstNodeKind.ContinueStatement;
|
|
854
|
+
range: Range;
|
|
855
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
856
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
661
857
|
}
|