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