brighterscript 1.0.0-alpha.23 → 1.0.0-alpha.25
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 +585 -218
- package/README.md +45 -139
- package/bsconfig.schema.json +41 -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 +39 -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 +79 -15
- package/dist/DiagnosticMessages.js +134 -21
- 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 +222 -87
- 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 +162 -81
- package/dist/Program.js +903 -732
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +132 -104
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +95 -134
- package/dist/Scope.js +477 -551
- 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 +95 -29
- package/dist/SymbolTable.js +256 -102
- 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 -6
- package/dist/XmlScope.js +74 -68
- 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} +68 -64
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +26 -16
- 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 -100
- package/dist/astUtils/reflection.js +225 -166
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +208 -126
- 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 +54 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +178 -33
- 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 +12 -2
- package/dist/bscPlugin/BscPlugin.js +41 -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 +135 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +21 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +86 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +57 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +544 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.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 +17 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +188 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +513 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +3 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +102 -29
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +167 -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/BrsFileTranspileProcessor.d.ts +16 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +123 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +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 +22 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +316 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +264 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- 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 +56 -8
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -116
- 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 +2454 -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 +107 -8
- 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 +529 -486
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +124 -112
- package/dist/files/BrsFile.js +819 -1131
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1869 -1277
- 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 -117
- 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 +49 -41
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +104 -40
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -18
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +440 -150
- 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 +187 -134
- 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 +9 -0
- package/dist/lexer/TokenKind.js +30 -5
- 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 +126 -167
- package/dist/parser/Expression.js +524 -394
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +152 -146
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +45 -196
- package/dist/parser/Parser.js +470 -926
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1034 -805
- 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 +208 -122
- package/dist/parser/Statement.js +599 -364
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -21
- 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 +61 -20
- 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 +67 -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 +123 -81
- 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 +221 -81
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +287 -105
- 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.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +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 +111 -300
- 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 +107 -90
- 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 +3 -3
- 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 +15 -11
- 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 +6544 -10519
- package/dist/roku-types/index.d.ts +662 -1934
- 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 +164 -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 +10 -5
- package/dist/types/DynamicType.js +16 -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 +167 -131
- package/dist/util.js +890 -350
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +7 -25
- package/dist/validators/ClassValidator.js +103 -194
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -149
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +0 -8
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +0 -40
- 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/hover/HoverProcessor.spec.d.ts} +0 -0
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
import type { Token, Identifier } from '../lexer/Token';
|
|
2
|
-
import type { Block, CommentStatement, FunctionStatement
|
|
2
|
+
import type { Block, CommentStatement, FunctionStatement } from './Statement';
|
|
3
3
|
import type { Range } from 'vscode-languageserver';
|
|
4
4
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
5
5
|
import { ParseMode } from './Parser';
|
|
6
6
|
import type { WalkOptions, WalkVisitor } from '../astUtils/visitors';
|
|
7
|
-
import {
|
|
8
|
-
import type {
|
|
9
|
-
import { VoidType } from '../types/VoidType';
|
|
10
|
-
import { DynamicType } from '../types/DynamicType';
|
|
11
|
-
import type { BscType, SymbolContainer } from '../types/BscType';
|
|
12
|
-
import { SymbolTable } from '../SymbolTable';
|
|
7
|
+
import type { GetTypeOptions, TranspileResult, TypedefProvider } from '../interfaces';
|
|
8
|
+
import type { BscType } from '../types/BscType';
|
|
13
9
|
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
14
|
-
import {
|
|
10
|
+
import { AstNodeKind, Expression } from './AstNode';
|
|
11
|
+
import { SourceNode } from 'source-map';
|
|
12
|
+
import type { TranspileState } from './TranspileState';
|
|
13
|
+
import { StringType } from '../types/StringType';
|
|
14
|
+
import { DynamicType } from '../types/DynamicType';
|
|
15
|
+
import { VoidType } from '../types/VoidType';
|
|
15
16
|
export declare type ExpressionVisitor = (expression: Expression, parent: Expression) => void;
|
|
16
|
-
/** A BrightScript expression */
|
|
17
|
-
export declare abstract class Expression {
|
|
18
|
-
/**
|
|
19
|
-
* The starting and ending location of the expression.
|
|
20
|
-
*/
|
|
21
|
-
abstract range: Range;
|
|
22
|
-
abstract transpile(state: BrsTranspileState): TranspileResult;
|
|
23
|
-
/**
|
|
24
|
-
* When being considered by the walk visitor, this describes what type of element the current class is.
|
|
25
|
-
*/
|
|
26
|
-
visitMode: InternalWalkMode;
|
|
27
|
-
abstract walk(visitor: WalkVisitor, options: WalkOptions): any;
|
|
28
|
-
}
|
|
29
17
|
export declare class BinaryExpression extends Expression {
|
|
30
18
|
left: Expression;
|
|
31
19
|
operator: Token;
|
|
32
20
|
right: Expression;
|
|
33
21
|
constructor(left: Expression, operator: Token, right: Expression);
|
|
22
|
+
readonly kind = AstNodeKind.BinaryExpression;
|
|
34
23
|
readonly range: Range;
|
|
35
|
-
transpile(state: BrsTranspileState): (string |
|
|
24
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
36
25
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
26
|
+
getType(options: GetTypeOptions): BscType;
|
|
37
27
|
}
|
|
38
28
|
export declare class CallExpression extends Expression {
|
|
39
29
|
readonly callee: Expression;
|
|
@@ -43,23 +33,17 @@ export declare class CallExpression extends Expression {
|
|
|
43
33
|
readonly openingParen: Token;
|
|
44
34
|
readonly closingParen: Token;
|
|
45
35
|
readonly args: Expression[];
|
|
46
|
-
/**
|
|
47
|
-
* The namespace that currently wraps this call expression. This is NOT the namespace of the callee...that will be represented in the callee expression itself.
|
|
48
|
-
*/
|
|
49
|
-
readonly namespaceName: NamespacedVariableNameExpression;
|
|
50
36
|
static MaximumArguments: number;
|
|
51
37
|
constructor(callee: Expression,
|
|
52
38
|
/**
|
|
53
39
|
* Can either be `(`, or `?(` for optional chaining
|
|
54
40
|
*/
|
|
55
|
-
openingParen: Token, closingParen: Token, args: Expression[],
|
|
56
|
-
|
|
57
|
-
* The namespace that currently wraps this call expression. This is NOT the namespace of the callee...that will be represented in the callee expression itself.
|
|
58
|
-
*/
|
|
59
|
-
namespaceName: NamespacedVariableNameExpression);
|
|
41
|
+
openingParen: Token, closingParen: Token, args: Expression[], unused?: any);
|
|
42
|
+
readonly kind = AstNodeKind.CallExpression;
|
|
60
43
|
readonly range: Range;
|
|
61
|
-
transpile(state: BrsTranspileState, nameOverride?: string):
|
|
44
|
+
transpile(state: BrsTranspileState, nameOverride?: string): (string | SourceNode)[];
|
|
62
45
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
46
|
+
getType(options: GetTypeOptions): any;
|
|
63
47
|
}
|
|
64
48
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
65
49
|
readonly parameters: FunctionParameterExpression[];
|
|
@@ -69,31 +53,9 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
69
53
|
readonly leftParen: Token;
|
|
70
54
|
readonly rightParen: Token;
|
|
71
55
|
readonly asToken?: Token;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*/
|
|
76
|
-
readonly parentFunction?: FunctionExpression;
|
|
77
|
-
readonly namespaceName?: NamespacedVariableNameExpression;
|
|
78
|
-
readonly parentSymbolTable?: SymbolTable;
|
|
79
|
-
constructor(parameters: FunctionParameterExpression[], body: Block, functionType: Token | null, end: Token, leftParen: Token, rightParen: Token, asToken?: Token, returnType?: TypeExpression,
|
|
80
|
-
/**
|
|
81
|
-
* If this function is enclosed within another function, this will reference that parent function
|
|
82
|
-
*/
|
|
83
|
-
parentFunction?: FunctionExpression, namespaceName?: NamespacedVariableNameExpression, parentSymbolTable?: SymbolTable);
|
|
84
|
-
get range(): Range;
|
|
85
|
-
/**
|
|
86
|
-
* The range of the function
|
|
87
|
-
*/
|
|
88
|
-
cacheRange(): Range;
|
|
89
|
-
private _range;
|
|
90
|
-
readonly symbolTable: SymbolTable;
|
|
91
|
-
labelStatements: LabelStatement[];
|
|
92
|
-
private _returnType;
|
|
93
|
-
/**
|
|
94
|
-
* The type this function returns
|
|
95
|
-
*/
|
|
96
|
-
getReturnType(): BscType;
|
|
56
|
+
returnTypeExpression?: TypeExpression;
|
|
57
|
+
constructor(parameters: FunctionParameterExpression[], body: Block, functionType: Token | null, end: Token, leftParen: Token, rightParen: Token, asToken?: Token, returnTypeExpression?: TypeExpression);
|
|
58
|
+
readonly kind = AstNodeKind.FunctionExpression;
|
|
97
59
|
/**
|
|
98
60
|
* The list of function calls that are declared within this function scope. This excludes CallExpressions
|
|
99
61
|
* declared in child functions
|
|
@@ -103,42 +65,29 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
103
65
|
* If this function is part of a FunctionStatement, this will be set. Otherwise this will be undefined
|
|
104
66
|
*/
|
|
105
67
|
functionStatement?: FunctionStatement;
|
|
68
|
+
getLeadingTrivia(): Token[];
|
|
106
69
|
/**
|
|
107
|
-
*
|
|
70
|
+
* The range of the function, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
71
|
+
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
108
72
|
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The range of the function declaration, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
112
|
-
* and ending with the last character in the returnTypeToken, or the 's' in 'as', or the rightParen
|
|
113
|
-
*/
|
|
114
|
-
get functionDeclarationRange(): Range;
|
|
73
|
+
get range(): Range;
|
|
115
74
|
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): any[];
|
|
116
|
-
getTypedef(state: BrsTranspileState
|
|
75
|
+
getTypedef(state: BrsTranspileState): SourceNode[];
|
|
117
76
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
118
|
-
|
|
77
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
119
78
|
}
|
|
120
79
|
export declare class FunctionParameterExpression extends Expression {
|
|
121
80
|
name: Identifier;
|
|
122
|
-
|
|
123
|
-
equalsToken?: Token;
|
|
81
|
+
equalToken?: Token;
|
|
124
82
|
defaultValue?: Expression;
|
|
125
83
|
asToken?: Token;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
84
|
+
typeExpression?: TypeExpression;
|
|
85
|
+
constructor(name: Identifier, equalToken?: Token, defaultValue?: Expression, asToken?: Token, typeExpression?: TypeExpression);
|
|
86
|
+
readonly kind = AstNodeKind.FunctionParameterExpression;
|
|
87
|
+
getType(options: GetTypeOptions): BscType;
|
|
88
|
+
get range(): Range;
|
|
131
89
|
transpile(state: BrsTranspileState): any[];
|
|
132
|
-
|
|
133
|
-
get isOptional(): boolean;
|
|
134
|
-
}
|
|
135
|
-
export declare class NamespacedVariableNameExpression extends Expression {
|
|
136
|
-
readonly expression: DottedGetExpression | VariableExpression;
|
|
137
|
-
constructor(expression: DottedGetExpression | VariableExpression);
|
|
138
|
-
readonly range: Range;
|
|
139
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
140
|
-
getNameParts(): string[];
|
|
141
|
-
getName(parseMode?: ParseMode): string;
|
|
90
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
142
91
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
143
92
|
}
|
|
144
93
|
export declare class DottedGetExpression extends Expression {
|
|
@@ -153,9 +102,12 @@ export declare class DottedGetExpression extends Expression {
|
|
|
153
102
|
* Can either be `.`, or `?.` for optional chaining
|
|
154
103
|
*/
|
|
155
104
|
dot: Token);
|
|
105
|
+
readonly kind = AstNodeKind.DottedGetExpression;
|
|
156
106
|
readonly range: Range;
|
|
157
|
-
transpile(state: BrsTranspileState): (string |
|
|
107
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
158
108
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
109
|
+
getType(options: GetTypeOptions): BscType;
|
|
110
|
+
getName(parseMode: ParseMode): string;
|
|
159
111
|
}
|
|
160
112
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
161
113
|
readonly obj: Expression;
|
|
@@ -169,8 +121,9 @@ export declare class XmlAttributeGetExpression extends Expression {
|
|
|
169
121
|
* Can either be `@`, or `?@` for optional chaining
|
|
170
122
|
*/
|
|
171
123
|
at: Token);
|
|
124
|
+
readonly kind = AstNodeKind.XmlAttributeGetExpression;
|
|
172
125
|
readonly range: Range;
|
|
173
|
-
transpile(state: BrsTranspileState): (string |
|
|
126
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
174
127
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
175
128
|
}
|
|
176
129
|
export declare class IndexedGetExpression extends Expression {
|
|
@@ -187,9 +140,11 @@ export declare class IndexedGetExpression extends Expression {
|
|
|
187
140
|
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.`
|
|
188
141
|
*/
|
|
189
142
|
openingSquare: Token, closingSquare: Token, questionDotToken?: Token);
|
|
143
|
+
readonly kind = AstNodeKind.IndexedGetExpression;
|
|
190
144
|
readonly range: Range;
|
|
191
|
-
transpile(state: BrsTranspileState): (string |
|
|
145
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
192
146
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
147
|
+
getType(options: GetTypeOptions): BscType;
|
|
193
148
|
}
|
|
194
149
|
export declare class GroupingExpression extends Expression {
|
|
195
150
|
readonly tokens: {
|
|
@@ -201,19 +156,19 @@ export declare class GroupingExpression extends Expression {
|
|
|
201
156
|
left: Token;
|
|
202
157
|
right: Token;
|
|
203
158
|
}, expression: Expression);
|
|
159
|
+
readonly kind = AstNodeKind.GroupingExpression;
|
|
204
160
|
readonly range: Range;
|
|
205
|
-
transpile(state: BrsTranspileState):
|
|
161
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
206
162
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
163
|
+
getType(options: GetTypeOptions): BscType;
|
|
207
164
|
}
|
|
208
165
|
export declare class LiteralExpression extends Expression {
|
|
209
166
|
token: Token;
|
|
210
167
|
constructor(token: Token);
|
|
211
|
-
readonly
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
type: BscType;
|
|
216
|
-
transpile(state: BrsTranspileState): import("source-map").SourceNode[];
|
|
168
|
+
readonly kind = AstNodeKind.LiteralExpression;
|
|
169
|
+
get range(): Range;
|
|
170
|
+
getType(options?: GetTypeOptions): DynamicType | import("../types").ObjectType | StringType | import("../types").IntegerType | import("../types").BooleanType | import("../types").FloatType | import("../types").DoubleType | import("../types").LongIntegerType | VoidType | import("../types/FunctionType").FunctionType;
|
|
171
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
217
172
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
218
173
|
}
|
|
219
174
|
/**
|
|
@@ -227,8 +182,9 @@ export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
|
227
182
|
constructor(token: Token & {
|
|
228
183
|
charCode: number;
|
|
229
184
|
});
|
|
185
|
+
readonly kind = AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
230
186
|
readonly range: Range;
|
|
231
|
-
transpile(state: BrsTranspileState):
|
|
187
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
232
188
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
233
189
|
}
|
|
234
190
|
export declare class ArrayLiteralExpression extends Expression {
|
|
@@ -237,60 +193,69 @@ export declare class ArrayLiteralExpression extends Expression {
|
|
|
237
193
|
readonly close: Token;
|
|
238
194
|
readonly hasSpread: boolean;
|
|
239
195
|
constructor(elements: Array<Expression | CommentStatement>, open: Token, close: Token, hasSpread?: boolean);
|
|
196
|
+
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
240
197
|
readonly range: Range;
|
|
241
198
|
transpile(state: BrsTranspileState): any[];
|
|
242
199
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
200
|
+
getType(options: GetTypeOptions): BscType;
|
|
243
201
|
}
|
|
244
202
|
export declare class AAMemberExpression extends Expression {
|
|
245
203
|
keyToken: Token;
|
|
246
204
|
colonToken: Token;
|
|
247
205
|
/** The expression evaluated to determine the member's initial value. */
|
|
248
206
|
value: Expression;
|
|
249
|
-
type: BscType;
|
|
250
207
|
constructor(keyToken: Token, colonToken: Token,
|
|
251
208
|
/** The expression evaluated to determine the member's initial value. */
|
|
252
|
-
value: Expression
|
|
253
|
-
readonly
|
|
209
|
+
value: Expression);
|
|
210
|
+
readonly kind = AstNodeKind.AAMemberExpression;
|
|
211
|
+
range: Range;
|
|
254
212
|
commaToken?: Token;
|
|
255
213
|
transpile(state: BrsTranspileState): any[];
|
|
256
214
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
215
|
+
getType(options: GetTypeOptions): BscType;
|
|
257
216
|
}
|
|
258
|
-
export declare class AALiteralExpression extends Expression
|
|
217
|
+
export declare class AALiteralExpression extends Expression {
|
|
259
218
|
readonly elements: Array<AAMemberExpression | CommentStatement>;
|
|
260
219
|
readonly open: Token;
|
|
261
220
|
readonly close: Token;
|
|
262
|
-
|
|
263
|
-
|
|
221
|
+
constructor(elements: Array<AAMemberExpression | CommentStatement>, open: Token, close: Token);
|
|
222
|
+
readonly kind = AstNodeKind.AALiteralExpression;
|
|
264
223
|
readonly range: Range;
|
|
265
|
-
readonly symbolTable: SymbolTable;
|
|
266
|
-
readonly memberTable: SymbolTable;
|
|
267
|
-
buildSymbolTable(): void;
|
|
268
224
|
transpile(state: BrsTranspileState): any[];
|
|
269
225
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
226
|
+
getType(options: GetTypeOptions): BscType;
|
|
270
227
|
}
|
|
271
228
|
export declare class UnaryExpression extends Expression {
|
|
272
229
|
operator: Token;
|
|
273
230
|
right: Expression;
|
|
274
231
|
constructor(operator: Token, right: Expression);
|
|
232
|
+
readonly kind = AstNodeKind.UnaryExpression;
|
|
275
233
|
readonly range: Range;
|
|
276
|
-
transpile(state: BrsTranspileState): (string |
|
|
234
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
277
235
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
236
|
+
getType(options: GetTypeOptions): BscType;
|
|
278
237
|
}
|
|
279
238
|
export declare class VariableExpression extends Expression {
|
|
280
|
-
name: Identifier;
|
|
281
|
-
|
|
282
|
-
|
|
239
|
+
readonly name: Identifier;
|
|
240
|
+
constructor(name: Identifier);
|
|
241
|
+
readonly kind = AstNodeKind.VariableExpression;
|
|
283
242
|
readonly range: Range;
|
|
284
243
|
getName(parseMode: ParseMode): string;
|
|
285
244
|
transpile(state: BrsTranspileState): any[];
|
|
286
245
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
246
|
+
getType(options: GetTypeOptions): BscType;
|
|
287
247
|
}
|
|
288
248
|
export declare class SourceLiteralExpression extends Expression {
|
|
289
249
|
readonly token: Token;
|
|
290
250
|
constructor(token: Token);
|
|
291
251
|
readonly range: Range;
|
|
252
|
+
readonly kind = AstNodeKind.SourceLiteralExpression;
|
|
253
|
+
/**
|
|
254
|
+
* Find the index of the function in its parent
|
|
255
|
+
*/
|
|
256
|
+
private findFunctionIndex;
|
|
292
257
|
private getFunctionName;
|
|
293
|
-
transpile(state: BrsTranspileState):
|
|
258
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
294
259
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
295
260
|
}
|
|
296
261
|
/**
|
|
@@ -302,14 +267,15 @@ export declare class NewExpression extends Expression {
|
|
|
302
267
|
readonly newKeyword: Token;
|
|
303
268
|
readonly call: CallExpression;
|
|
304
269
|
constructor(newKeyword: Token, call: CallExpression);
|
|
270
|
+
readonly kind = AstNodeKind.NewExpression;
|
|
305
271
|
readonly range: Range;
|
|
306
272
|
/**
|
|
307
273
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
308
274
|
*/
|
|
309
|
-
get className():
|
|
310
|
-
|
|
311
|
-
transpile(state: BrsTranspileState): any[];
|
|
275
|
+
get className(): DottedGetExpression | VariableExpression;
|
|
276
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
312
277
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
278
|
+
getType(options: GetTypeOptions): any;
|
|
313
279
|
}
|
|
314
280
|
export declare class CallfuncExpression extends Expression {
|
|
315
281
|
readonly callee: Expression;
|
|
@@ -319,9 +285,11 @@ export declare class CallfuncExpression extends Expression {
|
|
|
319
285
|
readonly args: Expression[];
|
|
320
286
|
readonly closingParen: Token;
|
|
321
287
|
constructor(callee: Expression, operator: Token, methodName: Identifier, openingParen: Token, args: Expression[], closingParen: Token);
|
|
288
|
+
readonly kind = AstNodeKind.CallfuncExpression;
|
|
322
289
|
readonly range: Range;
|
|
323
290
|
transpile(state: BrsTranspileState): any[];
|
|
324
291
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
292
|
+
getType(options: GetTypeOptions): BscType;
|
|
325
293
|
}
|
|
326
294
|
/**
|
|
327
295
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
@@ -330,6 +298,7 @@ export declare class CallfuncExpression extends Expression {
|
|
|
330
298
|
export declare class TemplateStringQuasiExpression extends Expression {
|
|
331
299
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
332
300
|
constructor(expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>);
|
|
301
|
+
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
333
302
|
readonly range: Range;
|
|
334
303
|
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): any[];
|
|
335
304
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -340,7 +309,9 @@ export declare class TemplateStringExpression extends Expression {
|
|
|
340
309
|
readonly expressions: Expression[];
|
|
341
310
|
readonly closingBacktick: Token;
|
|
342
311
|
constructor(openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
312
|
+
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
343
313
|
readonly range: Range;
|
|
314
|
+
getType(options: GetTypeOptions): StringType;
|
|
344
315
|
transpile(state: BrsTranspileState): any[];
|
|
345
316
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
346
317
|
}
|
|
@@ -351,6 +322,7 @@ export declare class TaggedTemplateStringExpression extends Expression {
|
|
|
351
322
|
readonly expressions: Expression[];
|
|
352
323
|
readonly closingBacktick: Token;
|
|
353
324
|
constructor(tagName: Identifier, openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
325
|
+
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
354
326
|
readonly range: Range;
|
|
355
327
|
transpile(state: BrsTranspileState): any[];
|
|
356
328
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -359,9 +331,8 @@ export declare class AnnotationExpression extends Expression {
|
|
|
359
331
|
readonly atToken: Token;
|
|
360
332
|
readonly nameToken: Token;
|
|
361
333
|
constructor(atToken: Token, nameToken: Token);
|
|
334
|
+
readonly kind = AstNodeKind.AnnotationExpression;
|
|
362
335
|
get range(): Range;
|
|
363
|
-
cacheRange(): Range;
|
|
364
|
-
private _range;
|
|
365
336
|
name: string;
|
|
366
337
|
call: CallExpression;
|
|
367
338
|
/**
|
|
@@ -369,9 +340,10 @@ export declare class AnnotationExpression extends Expression {
|
|
|
369
340
|
* @param strict If false, keep Expression objects not corresponding to JS types
|
|
370
341
|
*/
|
|
371
342
|
getArguments(strict?: boolean): ExpressionValue[];
|
|
343
|
+
getLeadingTrivia(): Token[];
|
|
372
344
|
transpile(state: BrsTranspileState): any[];
|
|
373
345
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
374
|
-
getTypedef(state: BrsTranspileState):
|
|
346
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
375
347
|
}
|
|
376
348
|
export declare class TernaryExpression extends Expression {
|
|
377
349
|
readonly test: Expression;
|
|
@@ -380,7 +352,8 @@ export declare class TernaryExpression extends Expression {
|
|
|
380
352
|
readonly colonToken?: Token;
|
|
381
353
|
readonly alternate?: Expression;
|
|
382
354
|
constructor(test: Expression, questionMarkToken: Token, consequent?: Expression, colonToken?: Token, alternate?: Expression);
|
|
383
|
-
readonly
|
|
355
|
+
readonly kind = AstNodeKind.TernaryExpression;
|
|
356
|
+
range: Range;
|
|
384
357
|
transpile(state: BrsTranspileState): any[];
|
|
385
358
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
386
359
|
}
|
|
@@ -389,6 +362,7 @@ export declare class NullCoalescingExpression extends Expression {
|
|
|
389
362
|
questionQuestionToken: Token;
|
|
390
363
|
alternate: Expression;
|
|
391
364
|
constructor(consequent: Expression, questionQuestionToken: Token, alternate: Expression);
|
|
365
|
+
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
392
366
|
readonly range: Range;
|
|
393
367
|
transpile(state: BrsTranspileState): any[];
|
|
394
368
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -400,68 +374,53 @@ export declare class RegexLiteralExpression extends Expression {
|
|
|
400
374
|
constructor(tokens: {
|
|
401
375
|
regexLiteral: Token;
|
|
402
376
|
});
|
|
403
|
-
readonly
|
|
377
|
+
readonly kind = AstNodeKind.RegexLiteralExpression;
|
|
378
|
+
get range(): Range;
|
|
404
379
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
405
380
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
406
381
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
type?: Token;
|
|
412
|
-
}, namespaceName?: NamespacedVariableNameExpression);
|
|
413
|
-
readonly range: Range;
|
|
414
|
-
private _type;
|
|
415
|
-
/**
|
|
416
|
-
* The this TypeExpression refers to
|
|
417
|
-
*/
|
|
418
|
-
get type(): BscType;
|
|
419
|
-
/**
|
|
420
|
-
* Derive a BscType from the type token
|
|
421
|
-
* Can deal with multiple brackets to make multidimensional arrays, eg. float[][]
|
|
422
|
-
* Defaults to `DynamicType`
|
|
423
|
-
*/
|
|
424
|
-
getType(parseMode?: ParseMode): DynamicType | BscType | import("../types/FloatType").FloatType | import("../types/IntegerType").IntegerType | import("../types/DoubleType").DoubleType | import("../types/LongIntegerType").LongIntegerType | import("../types/StringType").StringType | import("../types/BooleanType").BooleanType | import("../types/FunctionType").FunctionType | import("../types/InvalidType").InvalidType | VoidType;
|
|
382
|
+
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
383
|
+
[key: string]: ExpressionValue;
|
|
384
|
+
};
|
|
385
|
+
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
425
386
|
/**
|
|
426
|
-
*
|
|
387
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
427
388
|
*/
|
|
428
|
-
|
|
389
|
+
expression: Expression;
|
|
390
|
+
constructor(
|
|
429
391
|
/**
|
|
430
|
-
*
|
|
431
|
-
* @returns text to display to show the type
|
|
392
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
432
393
|
*/
|
|
433
|
-
|
|
394
|
+
expression: Expression);
|
|
395
|
+
readonly kind = AstNodeKind.TypeExpression;
|
|
396
|
+
range: Range;
|
|
434
397
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
435
398
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
399
|
+
getType(options: GetTypeOptions): BscType;
|
|
400
|
+
getTypedef(state: TranspileState): (string | SourceNode)[];
|
|
401
|
+
getName(parseMode?: ParseMode): string;
|
|
402
|
+
getNameParts(): string[];
|
|
436
403
|
}
|
|
437
|
-
export declare class
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
constructor(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}, namespaceName?: NamespacedVariableNameExpression);
|
|
446
|
-
readonly range: Range;
|
|
447
|
-
private get defaultTypeExpression();
|
|
448
|
-
/**
|
|
449
|
-
* Derive a BscType from the type token
|
|
450
|
-
* Returns an array type with the inner types based on the inner type expressions
|
|
451
|
-
*/
|
|
452
|
-
getType(parseMode?: ParseMode): ArrayType;
|
|
453
|
-
/**
|
|
454
|
-
* Is this a valid, (eg. known) type?
|
|
455
|
-
*/
|
|
456
|
-
isValidType(parseMode?: ParseMode): boolean;
|
|
457
|
-
/**
|
|
458
|
-
* Gives a human readable string that says the type
|
|
459
|
-
* @returns text to display to show the type
|
|
460
|
-
*/
|
|
461
|
-
getText(): string;
|
|
404
|
+
export declare class TypeCastExpression extends Expression {
|
|
405
|
+
obj: Expression;
|
|
406
|
+
asToken?: Token;
|
|
407
|
+
typeExpression?: TypeExpression;
|
|
408
|
+
constructor(obj: Expression, asToken?: Token, typeExpression?: TypeExpression);
|
|
409
|
+
readonly kind = AstNodeKind.TypeCastExpression;
|
|
410
|
+
range: Range;
|
|
411
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
462
412
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
413
|
+
getType(options: GetTypeOptions): BscType;
|
|
414
|
+
}
|
|
415
|
+
export declare class TypedArrayExpression extends Expression {
|
|
416
|
+
innerType: Expression;
|
|
417
|
+
leftBracket: Token;
|
|
418
|
+
rightBracket: Token;
|
|
419
|
+
constructor(innerType: Expression, leftBracket: Token, rightBracket: Token);
|
|
420
|
+
readonly kind = AstNodeKind.TypedArrayExpression;
|
|
421
|
+
range: Range;
|
|
422
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
423
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
424
|
+
getType(options: GetTypeOptions): BscType;
|
|
463
425
|
}
|
|
464
|
-
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
465
|
-
[key: string]: ExpressionValue;
|
|
466
|
-
};
|
|
467
426
|
export {};
|