brighterscript 1.0.0-alpha.24 → 1.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +521 -233
- package/README.md +45 -139
- package/bsconfig.schema.json +46 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +40 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +61 -13
- package/dist/DiagnosticMessages.js +116 -19
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +23 -11
- package/dist/LanguageServer.js +150 -69
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +158 -79
- package/dist/Program.js +841 -706
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +130 -103
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +86 -137
- package/dist/Scope.js +453 -519
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +89 -34
- package/dist/SymbolTable.js +239 -114
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +4 -11
- package/dist/XmlScope.js +75 -88
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +69 -65
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +54 -24
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +132 -104
- package/dist/astUtils/reflection.js +220 -174
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +256 -157
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +53 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +208 -52
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +11 -2
- package/dist/bscPlugin/BscPlugin.js +37 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +136 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +16 -13
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +16 -16
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +52 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +517 -26
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +7 -7
- package/dist/bscPlugin/hover/HoverProcessor.js +123 -125
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +371 -53
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +2 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +83 -23
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +83 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +38 -12
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +13 -5
- package/dist/bscPlugin/validation/BrsFileValidator.js +262 -52
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +230 -14
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +58 -27
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -286
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2527 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +104 -13
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +523 -493
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +111 -117
- package/dist/files/BrsFile.js +684 -1142
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1783 -1233
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +70 -32
- package/dist/files/XmlFile.js +106 -118
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +48 -40
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +84 -24
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -21
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +421 -162
- package/dist/interfaces.js +27 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +181 -135
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +8 -0
- package/dist/lexer/TokenKind.js +24 -4
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +376 -283
- package/dist/parser/Expression.js +742 -585
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +151 -145
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +48 -201
- package/dist/parser/Parser.js +705 -1026
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +861 -848
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +468 -272
- package/dist/parser/Statement.js +904 -631
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +47 -23
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +62 -21
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +92 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -59
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +96 -57
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +89 -89
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +82 -33
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +98 -302
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +36 -34
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +2 -2
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +5 -5
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +5892 -10081
- package/dist/roku-types/index.d.ts +622 -1719
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +171 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +9 -5
- package/dist/types/DynamicType.js +15 -4
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +9 -8
- package/dist/types/ObjectType.js +21 -11
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +143 -139
- package/dist/util.js +864 -385
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +8 -25
- package/dist/validators/ClassValidator.js +99 -179
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -152
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
|
@@ -1,108 +1,82 @@
|
|
|
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
|
|
7
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
8
|
+
import { type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
9
9
|
import { VoidType } from '../types/VoidType';
|
|
10
10
|
import { DynamicType } from '../types/DynamicType';
|
|
11
|
-
import type { BscType
|
|
12
|
-
import { SymbolTable } from '../SymbolTable';
|
|
13
|
-
import { ArrayType } from '../types/ArrayType';
|
|
11
|
+
import type { BscType } from '../types/BscType';
|
|
14
12
|
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
13
|
+
import { AstNodeKind, Expression } from './AstNode';
|
|
14
|
+
import { SourceNode } from 'source-map';
|
|
15
|
+
import type { TranspileState } from './TranspileState';
|
|
16
|
+
import { StringType } from '../types/StringType';
|
|
15
17
|
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
18
|
export declare class BinaryExpression extends Expression {
|
|
19
|
+
constructor(options: {
|
|
20
|
+
left: Expression;
|
|
21
|
+
operator: Token;
|
|
22
|
+
right: Expression;
|
|
23
|
+
});
|
|
24
|
+
tokens: {
|
|
25
|
+
operator: Token;
|
|
26
|
+
};
|
|
38
27
|
left: Expression;
|
|
39
|
-
operator: Token;
|
|
40
28
|
right: Expression;
|
|
41
|
-
|
|
29
|
+
readonly kind = AstNodeKind.BinaryExpression;
|
|
42
30
|
readonly range: Range;
|
|
43
|
-
transpile(state: BrsTranspileState): (string |
|
|
31
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
44
32
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
33
|
+
getType(options: GetTypeOptions): BscType;
|
|
45
34
|
}
|
|
46
35
|
export declare class CallExpression extends Expression {
|
|
36
|
+
static MaximumArguments: number;
|
|
37
|
+
constructor(options: {
|
|
38
|
+
callee: Expression;
|
|
39
|
+
openingParen: Token;
|
|
40
|
+
args?: Expression[];
|
|
41
|
+
closingParen: Token;
|
|
42
|
+
});
|
|
47
43
|
readonly callee: Expression;
|
|
48
|
-
/**
|
|
49
|
-
* Can either be `(`, or `?(` for optional chaining
|
|
50
|
-
*/
|
|
51
|
-
readonly openingParen: Token;
|
|
52
|
-
readonly closingParen: Token;
|
|
53
44
|
readonly args: Expression[];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
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);
|
|
45
|
+
tokens: {
|
|
46
|
+
/**
|
|
47
|
+
* Can either be `(`, or `?(` for optional chaining - defaults to '('
|
|
48
|
+
*/
|
|
49
|
+
readonly openingParen?: Token;
|
|
50
|
+
readonly closingParen?: Token;
|
|
51
|
+
};
|
|
52
|
+
readonly kind = AstNodeKind.CallExpression;
|
|
68
53
|
readonly range: Range;
|
|
69
|
-
transpile(state: BrsTranspileState, nameOverride?: string):
|
|
54
|
+
transpile(state: BrsTranspileState, nameOverride?: string): (string | SourceNode)[];
|
|
70
55
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
56
|
+
getType(options: GetTypeOptions): any;
|
|
71
57
|
}
|
|
72
58
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
59
|
+
constructor(options: {
|
|
60
|
+
functionType?: Token;
|
|
61
|
+
leftParen?: Token;
|
|
62
|
+
parameters?: FunctionParameterExpression[];
|
|
63
|
+
rightParen?: Token;
|
|
64
|
+
as?: Token;
|
|
65
|
+
returnTypeExpression?: TypeExpression;
|
|
66
|
+
body: Block;
|
|
67
|
+
endFunctionType?: Token;
|
|
68
|
+
});
|
|
69
|
+
readonly kind = AstNodeKind.FunctionExpression;
|
|
73
70
|
readonly parameters: FunctionParameterExpression[];
|
|
74
71
|
body: Block;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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;
|
|
72
|
+
returnTypeExpression?: TypeExpression;
|
|
73
|
+
readonly tokens: {
|
|
74
|
+
functionType?: Token;
|
|
75
|
+
endFunctionType?: Token;
|
|
76
|
+
leftParen?: Token;
|
|
77
|
+
rightParen?: Token;
|
|
78
|
+
as?: Token;
|
|
79
|
+
};
|
|
106
80
|
/**
|
|
107
81
|
* The list of function calls that are declared within this function scope. This excludes CallExpressions
|
|
108
82
|
* declared in child functions
|
|
@@ -112,117 +86,134 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
112
86
|
* If this function is part of a FunctionStatement, this will be set. Otherwise this will be undefined
|
|
113
87
|
*/
|
|
114
88
|
functionStatement?: FunctionStatement;
|
|
89
|
+
getLeadingTrivia(): Token[];
|
|
115
90
|
/**
|
|
116
|
-
*
|
|
91
|
+
* The range of the function, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
92
|
+
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
117
93
|
*/
|
|
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;
|
|
94
|
+
get range(): Range;
|
|
124
95
|
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): any[];
|
|
125
|
-
getTypedef(state: BrsTranspileState
|
|
96
|
+
getTypedef(state: BrsTranspileState): SourceNode[];
|
|
126
97
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
127
|
-
|
|
98
|
+
getType(options: GetTypeOptions): TypedFunctionType;
|
|
128
99
|
}
|
|
129
100
|
export declare class FunctionParameterExpression extends Expression {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
101
|
+
constructor(options: {
|
|
102
|
+
name: Identifier;
|
|
103
|
+
equals?: Token;
|
|
104
|
+
defaultValue?: Expression;
|
|
105
|
+
as?: Token;
|
|
106
|
+
typeExpression?: TypeExpression;
|
|
107
|
+
});
|
|
108
|
+
readonly kind = AstNodeKind.FunctionParameterExpression;
|
|
109
|
+
tokens: {
|
|
110
|
+
name: Identifier;
|
|
111
|
+
equals?: Token;
|
|
112
|
+
as?: Token;
|
|
113
|
+
};
|
|
133
114
|
defaultValue?: Expression;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
constructor(name: Identifier, typeInContext: BscType, equalsToken?: Token, defaultValue?: Expression, asToken?: Token, type?: TypeExpression, namespaceName?: NamespacedVariableNameExpression);
|
|
138
|
-
readonly range: Range;
|
|
139
|
-
getType(): BscType;
|
|
115
|
+
typeExpression?: TypeExpression;
|
|
116
|
+
getType(options: GetTypeOptions): BscType;
|
|
117
|
+
get range(): Range;
|
|
140
118
|
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;
|
|
119
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
151
120
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
152
121
|
}
|
|
153
122
|
export declare class DottedGetExpression extends Expression {
|
|
123
|
+
constructor(options: {
|
|
124
|
+
obj: Expression;
|
|
125
|
+
name: Identifier;
|
|
126
|
+
/**
|
|
127
|
+
* Can either be `.`, or `?.` for optional chaining - defaults in transpile to '.'
|
|
128
|
+
*/
|
|
129
|
+
dot?: Token;
|
|
130
|
+
});
|
|
131
|
+
readonly tokens: {
|
|
132
|
+
name: Identifier;
|
|
133
|
+
dot?: Token;
|
|
134
|
+
};
|
|
154
135
|
readonly obj: Expression;
|
|
155
|
-
readonly
|
|
156
|
-
/**
|
|
157
|
-
* Can either be `.`, or `?.` for optional chaining
|
|
158
|
-
*/
|
|
159
|
-
readonly dot: Token;
|
|
160
|
-
constructor(obj: Expression, name: Identifier,
|
|
161
|
-
/**
|
|
162
|
-
* Can either be `.`, or `?.` for optional chaining
|
|
163
|
-
*/
|
|
164
|
-
dot: Token);
|
|
136
|
+
readonly kind = AstNodeKind.DottedGetExpression;
|
|
165
137
|
readonly range: Range;
|
|
166
|
-
transpile(state: BrsTranspileState): (string |
|
|
138
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
167
139
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
140
|
+
getType(options: GetTypeOptions): BscType;
|
|
141
|
+
getName(parseMode: ParseMode): string;
|
|
168
142
|
}
|
|
169
143
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
144
|
+
constructor(options: {
|
|
145
|
+
obj: Expression;
|
|
146
|
+
/**
|
|
147
|
+
* Can either be `@`, or `?@` for optional chaining - defaults to '@'
|
|
148
|
+
*/
|
|
149
|
+
at?: Token;
|
|
150
|
+
name: Identifier;
|
|
151
|
+
});
|
|
152
|
+
readonly kind = AstNodeKind.XmlAttributeGetExpression;
|
|
153
|
+
tokens: {
|
|
154
|
+
name: Identifier;
|
|
155
|
+
at?: Token;
|
|
156
|
+
};
|
|
170
157
|
readonly obj: Expression;
|
|
171
|
-
readonly name: Identifier;
|
|
172
|
-
/**
|
|
173
|
-
* Can either be `@`, or `?@` for optional chaining
|
|
174
|
-
*/
|
|
175
|
-
readonly at: Token;
|
|
176
|
-
constructor(obj: Expression, name: Identifier,
|
|
177
|
-
/**
|
|
178
|
-
* Can either be `@`, or `?@` for optional chaining
|
|
179
|
-
*/
|
|
180
|
-
at: Token);
|
|
181
158
|
readonly range: Range;
|
|
182
|
-
transpile(state: BrsTranspileState): (string |
|
|
159
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
183
160
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
184
161
|
}
|
|
185
162
|
export declare class IndexedGetExpression extends Expression {
|
|
163
|
+
constructor(options: {
|
|
164
|
+
obj: Expression;
|
|
165
|
+
indexes: Expression[];
|
|
166
|
+
/**
|
|
167
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
168
|
+
*/
|
|
169
|
+
openingSquare?: Token;
|
|
170
|
+
closingSquare?: Token;
|
|
171
|
+
questionDot?: Token;
|
|
172
|
+
});
|
|
173
|
+
readonly kind = AstNodeKind.IndexedGetExpression;
|
|
186
174
|
obj: Expression;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.`
|
|
197
|
-
*/
|
|
198
|
-
openingSquare: Token, closingSquare: Token, questionDotToken?: Token);
|
|
175
|
+
indexes: Expression[];
|
|
176
|
+
tokens: {
|
|
177
|
+
/**
|
|
178
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
179
|
+
*/
|
|
180
|
+
openingSquare?: Token;
|
|
181
|
+
closingSquare?: Token;
|
|
182
|
+
questionDot?: Token;
|
|
183
|
+
};
|
|
199
184
|
readonly range: Range;
|
|
200
|
-
transpile(state: BrsTranspileState):
|
|
185
|
+
transpile(state: BrsTranspileState): any[];
|
|
201
186
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
187
|
+
getType(options: GetTypeOptions): BscType;
|
|
202
188
|
}
|
|
203
189
|
export declare class GroupingExpression extends Expression {
|
|
190
|
+
constructor(options: {
|
|
191
|
+
leftParen?: Token;
|
|
192
|
+
rightParen?: Token;
|
|
193
|
+
expression: Expression;
|
|
194
|
+
});
|
|
204
195
|
readonly tokens: {
|
|
205
|
-
|
|
206
|
-
|
|
196
|
+
leftParen?: Token;
|
|
197
|
+
rightParen?: Token;
|
|
207
198
|
};
|
|
208
199
|
expression: Expression;
|
|
209
|
-
|
|
210
|
-
left: Token;
|
|
211
|
-
right: Token;
|
|
212
|
-
}, expression: Expression);
|
|
200
|
+
readonly kind = AstNodeKind.GroupingExpression;
|
|
213
201
|
readonly range: Range;
|
|
214
|
-
transpile(state: BrsTranspileState):
|
|
202
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
215
203
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
204
|
+
getType(options: GetTypeOptions): BscType;
|
|
216
205
|
}
|
|
217
206
|
export declare class LiteralExpression extends Expression {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
207
|
+
constructor(options: {
|
|
208
|
+
value: Token;
|
|
209
|
+
});
|
|
210
|
+
tokens: {
|
|
211
|
+
value: Token;
|
|
212
|
+
};
|
|
213
|
+
readonly kind = AstNodeKind.LiteralExpression;
|
|
214
|
+
get range(): Range;
|
|
215
|
+
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;
|
|
216
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
226
217
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
227
218
|
}
|
|
228
219
|
/**
|
|
@@ -230,76 +221,120 @@ export declare class LiteralExpression extends Expression {
|
|
|
230
221
|
* during template string transpile by identifying these expressions explicitly and skipping the bslib_toString around them
|
|
231
222
|
*/
|
|
232
223
|
export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
charCode: number;
|
|
224
|
+
constructor(options: {
|
|
225
|
+
value: Token & {
|
|
226
|
+
charCode: number;
|
|
227
|
+
};
|
|
238
228
|
});
|
|
229
|
+
readonly kind = AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
230
|
+
tokens: {
|
|
231
|
+
value: Token & {
|
|
232
|
+
charCode: number;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
239
235
|
readonly range: Range;
|
|
240
|
-
transpile(state: BrsTranspileState):
|
|
236
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
241
237
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
242
238
|
}
|
|
243
239
|
export declare class ArrayLiteralExpression extends Expression {
|
|
240
|
+
constructor(options: {
|
|
241
|
+
elements: Array<Expression | CommentStatement>;
|
|
242
|
+
open?: Token;
|
|
243
|
+
close?: Token;
|
|
244
|
+
});
|
|
244
245
|
readonly elements: Array<Expression | CommentStatement>;
|
|
245
|
-
readonly
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
readonly tokens: {
|
|
247
|
+
open?: Token;
|
|
248
|
+
close?: Token;
|
|
249
|
+
};
|
|
250
|
+
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
249
251
|
readonly range: Range;
|
|
250
252
|
transpile(state: BrsTranspileState): any[];
|
|
251
253
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
254
|
+
getType(options: GetTypeOptions): BscType;
|
|
252
255
|
}
|
|
253
256
|
export declare class AAMemberExpression extends Expression {
|
|
254
|
-
|
|
255
|
-
|
|
257
|
+
constructor(options: {
|
|
258
|
+
key: Token;
|
|
259
|
+
colon?: Token;
|
|
260
|
+
/** The expression evaluated to determine the member's initial value. */
|
|
261
|
+
value: Expression;
|
|
262
|
+
comma?: Token;
|
|
263
|
+
});
|
|
264
|
+
readonly kind = AstNodeKind.AAMemberExpression;
|
|
265
|
+
range: Range;
|
|
266
|
+
tokens: {
|
|
267
|
+
key: Token;
|
|
268
|
+
colon?: Token;
|
|
269
|
+
comma?: Token;
|
|
270
|
+
};
|
|
256
271
|
/** The expression evaluated to determine the member's initial value. */
|
|
257
272
|
value: Expression;
|
|
258
|
-
type: BscType;
|
|
259
|
-
constructor(keyToken: Token, colonToken: Token,
|
|
260
|
-
/** The expression evaluated to determine the member's initial value. */
|
|
261
|
-
value: Expression, type: BscType);
|
|
262
|
-
readonly range: Range;
|
|
263
|
-
commaToken?: Token;
|
|
264
273
|
transpile(state: BrsTranspileState): any[];
|
|
265
274
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
275
|
+
getType(options: GetTypeOptions): BscType;
|
|
266
276
|
}
|
|
267
|
-
export declare class AALiteralExpression extends Expression
|
|
277
|
+
export declare class AALiteralExpression extends Expression {
|
|
278
|
+
constructor(options: {
|
|
279
|
+
elements: Array<AAMemberExpression | CommentStatement>;
|
|
280
|
+
open?: Token;
|
|
281
|
+
close?: Token;
|
|
282
|
+
});
|
|
268
283
|
readonly elements: Array<AAMemberExpression | CommentStatement>;
|
|
269
|
-
readonly
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
284
|
+
readonly tokens: {
|
|
285
|
+
open?: Token;
|
|
286
|
+
close?: Token;
|
|
287
|
+
};
|
|
288
|
+
readonly kind = AstNodeKind.AALiteralExpression;
|
|
273
289
|
readonly range: Range;
|
|
274
|
-
readonly symbolTable: SymbolTable;
|
|
275
|
-
readonly memberTable: SymbolTable;
|
|
276
|
-
buildSymbolTable(): void;
|
|
277
290
|
transpile(state: BrsTranspileState): any[];
|
|
278
291
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
292
|
+
getType(options: GetTypeOptions): BscType;
|
|
279
293
|
}
|
|
280
294
|
export declare class UnaryExpression extends Expression {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
295
|
+
constructor(options: {
|
|
296
|
+
operator: Token;
|
|
297
|
+
right: Expression;
|
|
298
|
+
});
|
|
299
|
+
readonly kind = AstNodeKind.UnaryExpression;
|
|
284
300
|
readonly range: Range;
|
|
285
|
-
|
|
301
|
+
tokens: {
|
|
302
|
+
operator: Token;
|
|
303
|
+
};
|
|
304
|
+
right: Expression;
|
|
305
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
286
306
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
307
|
+
getType(options: GetTypeOptions): BscType;
|
|
287
308
|
}
|
|
288
309
|
export declare class VariableExpression extends Expression {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
310
|
+
constructor(options: {
|
|
311
|
+
name: Identifier;
|
|
312
|
+
});
|
|
313
|
+
readonly tokens: {
|
|
314
|
+
name: Identifier;
|
|
315
|
+
};
|
|
316
|
+
readonly kind = AstNodeKind.VariableExpression;
|
|
292
317
|
readonly range: Range;
|
|
293
|
-
getName(parseMode
|
|
318
|
+
getName(parseMode?: ParseMode): string;
|
|
294
319
|
transpile(state: BrsTranspileState): any[];
|
|
295
320
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
321
|
+
getType(options: GetTypeOptions): BscType;
|
|
296
322
|
}
|
|
297
323
|
export declare class SourceLiteralExpression extends Expression {
|
|
298
|
-
|
|
299
|
-
|
|
324
|
+
constructor(options: {
|
|
325
|
+
value: Token;
|
|
326
|
+
});
|
|
300
327
|
readonly range: Range;
|
|
328
|
+
readonly kind = AstNodeKind.SourceLiteralExpression;
|
|
329
|
+
readonly tokens: {
|
|
330
|
+
value: Token;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Find the index of the function in its parent
|
|
334
|
+
*/
|
|
335
|
+
private findFunctionIndex;
|
|
301
336
|
private getFunctionName;
|
|
302
|
-
transpile(state: BrsTranspileState):
|
|
337
|
+
transpile(state: BrsTranspileState): SourceNode[];
|
|
303
338
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
304
339
|
}
|
|
305
340
|
/**
|
|
@@ -308,69 +343,112 @@ export declare class SourceLiteralExpression extends Expression {
|
|
|
308
343
|
* do more type checking.
|
|
309
344
|
*/
|
|
310
345
|
export declare class NewExpression extends Expression {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
346
|
+
constructor(options: {
|
|
347
|
+
new?: Token;
|
|
348
|
+
call: CallExpression;
|
|
349
|
+
});
|
|
350
|
+
readonly kind = AstNodeKind.NewExpression;
|
|
314
351
|
readonly range: Range;
|
|
352
|
+
readonly tokens: {
|
|
353
|
+
new?: Token;
|
|
354
|
+
};
|
|
355
|
+
readonly call: CallExpression;
|
|
315
356
|
/**
|
|
316
357
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
317
358
|
*/
|
|
318
|
-
get className():
|
|
319
|
-
|
|
320
|
-
transpile(state: BrsTranspileState): any[];
|
|
359
|
+
get className(): DottedGetExpression | VariableExpression;
|
|
360
|
+
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
321
361
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
362
|
+
getType(options: GetTypeOptions): any;
|
|
322
363
|
}
|
|
323
364
|
export declare class CallfuncExpression extends Expression {
|
|
365
|
+
constructor(options: {
|
|
366
|
+
callee: Expression;
|
|
367
|
+
operator?: Token;
|
|
368
|
+
methodName: Identifier;
|
|
369
|
+
openingParen?: Token;
|
|
370
|
+
args?: Expression[];
|
|
371
|
+
closingParen?: Token;
|
|
372
|
+
});
|
|
324
373
|
readonly callee: Expression;
|
|
325
|
-
readonly operator: Token;
|
|
326
|
-
readonly methodName: Identifier;
|
|
327
|
-
readonly openingParen: Token;
|
|
328
374
|
readonly args: Expression[];
|
|
329
|
-
readonly
|
|
330
|
-
|
|
375
|
+
readonly tokens: {
|
|
376
|
+
operator: Token;
|
|
377
|
+
methodName: Identifier;
|
|
378
|
+
openingParen?: Token;
|
|
379
|
+
closingParen?: Token;
|
|
380
|
+
};
|
|
381
|
+
readonly kind = AstNodeKind.CallfuncExpression;
|
|
331
382
|
readonly range: Range;
|
|
332
383
|
transpile(state: BrsTranspileState): any[];
|
|
333
384
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
385
|
+
getType(options: GetTypeOptions): BscType;
|
|
334
386
|
}
|
|
335
387
|
/**
|
|
336
388
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
337
389
|
* This is a single expression that represents the string contatenation of all parts of a single quasi.
|
|
338
390
|
*/
|
|
339
391
|
export declare class TemplateStringQuasiExpression extends Expression {
|
|
392
|
+
constructor(options: {
|
|
393
|
+
expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
394
|
+
});
|
|
340
395
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
341
|
-
|
|
396
|
+
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
342
397
|
readonly range: Range;
|
|
343
398
|
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): any[];
|
|
344
399
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
345
400
|
}
|
|
346
401
|
export declare class TemplateStringExpression extends Expression {
|
|
347
|
-
|
|
402
|
+
constructor(options: {
|
|
403
|
+
openingBacktick?: Token;
|
|
404
|
+
quasis: TemplateStringQuasiExpression[];
|
|
405
|
+
expressions: Expression[];
|
|
406
|
+
closingBacktick?: Token;
|
|
407
|
+
});
|
|
408
|
+
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
409
|
+
readonly tokens: {
|
|
410
|
+
openingBacktick?: Token;
|
|
411
|
+
closingBacktick?: Token;
|
|
412
|
+
};
|
|
348
413
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
349
414
|
readonly expressions: Expression[];
|
|
350
|
-
readonly closingBacktick: Token;
|
|
351
|
-
constructor(openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
352
415
|
readonly range: Range;
|
|
416
|
+
getType(options: GetTypeOptions): StringType;
|
|
353
417
|
transpile(state: BrsTranspileState): any[];
|
|
354
418
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
355
419
|
}
|
|
356
420
|
export declare class TaggedTemplateStringExpression extends Expression {
|
|
357
|
-
|
|
358
|
-
|
|
421
|
+
constructor(options: {
|
|
422
|
+
tagName: Identifier;
|
|
423
|
+
openingBacktick?: Token;
|
|
424
|
+
quasis: TemplateStringQuasiExpression[];
|
|
425
|
+
expressions: Expression[];
|
|
426
|
+
closingBacktick?: Token;
|
|
427
|
+
});
|
|
428
|
+
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
429
|
+
tokens: {
|
|
430
|
+
tagName: Identifier;
|
|
431
|
+
openingBacktick?: Token;
|
|
432
|
+
closingBacktick?: Token;
|
|
433
|
+
};
|
|
359
434
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
360
435
|
readonly expressions: Expression[];
|
|
361
|
-
readonly closingBacktick: Token;
|
|
362
|
-
constructor(tagName: Identifier, openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
363
436
|
readonly range: Range;
|
|
364
437
|
transpile(state: BrsTranspileState): any[];
|
|
365
438
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
366
439
|
}
|
|
367
440
|
export declare class AnnotationExpression extends Expression {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
441
|
+
constructor(options: {
|
|
442
|
+
at?: Token;
|
|
443
|
+
name: Token;
|
|
444
|
+
call?: CallExpression;
|
|
445
|
+
});
|
|
446
|
+
readonly kind = AstNodeKind.AnnotationExpression;
|
|
447
|
+
readonly tokens: {
|
|
448
|
+
at: Token;
|
|
449
|
+
name: Token;
|
|
450
|
+
};
|
|
371
451
|
get range(): Range;
|
|
372
|
-
cacheRange(): Range;
|
|
373
|
-
private _range;
|
|
374
452
|
name: string;
|
|
375
453
|
call: CallExpression;
|
|
376
454
|
/**
|
|
@@ -378,99 +456,114 @@ export declare class AnnotationExpression extends Expression {
|
|
|
378
456
|
* @param strict If false, keep Expression objects not corresponding to JS types
|
|
379
457
|
*/
|
|
380
458
|
getArguments(strict?: boolean): ExpressionValue[];
|
|
459
|
+
getLeadingTrivia(): Token[];
|
|
381
460
|
transpile(state: BrsTranspileState): any[];
|
|
382
461
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
383
|
-
getTypedef(state: BrsTranspileState):
|
|
462
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
384
463
|
}
|
|
385
464
|
export declare class TernaryExpression extends Expression {
|
|
465
|
+
constructor(options: {
|
|
466
|
+
test: Expression;
|
|
467
|
+
questionMark?: Token;
|
|
468
|
+
consequent?: Expression;
|
|
469
|
+
colon?: Token;
|
|
470
|
+
alternate?: Expression;
|
|
471
|
+
});
|
|
472
|
+
readonly kind = AstNodeKind.TernaryExpression;
|
|
473
|
+
range: Range;
|
|
474
|
+
readonly tokens: {
|
|
475
|
+
questionMark?: Token;
|
|
476
|
+
colon?: Token;
|
|
477
|
+
};
|
|
386
478
|
readonly test: Expression;
|
|
387
|
-
readonly questionMarkToken: Token;
|
|
388
479
|
readonly consequent?: Expression;
|
|
389
|
-
readonly colonToken?: Token;
|
|
390
480
|
readonly alternate?: Expression;
|
|
391
|
-
constructor(test: Expression, questionMarkToken: Token, consequent?: Expression, colonToken?: Token, alternate?: Expression);
|
|
392
|
-
readonly range: Range;
|
|
393
481
|
transpile(state: BrsTranspileState): any[];
|
|
394
482
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
395
483
|
}
|
|
396
484
|
export declare class NullCoalescingExpression extends Expression {
|
|
485
|
+
constructor(options: {
|
|
486
|
+
consequent: Expression;
|
|
487
|
+
questionQuestion?: Token;
|
|
488
|
+
alternate: Expression;
|
|
489
|
+
});
|
|
490
|
+
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
491
|
+
readonly range: Range;
|
|
492
|
+
tokens: {
|
|
493
|
+
questionQuestion?: Token;
|
|
494
|
+
};
|
|
397
495
|
consequent: Expression;
|
|
398
|
-
questionQuestionToken: Token;
|
|
399
496
|
alternate: Expression;
|
|
400
|
-
constructor(consequent: Expression, questionQuestionToken: Token, alternate: Expression);
|
|
401
|
-
readonly range: Range;
|
|
402
497
|
transpile(state: BrsTranspileState): any[];
|
|
403
498
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
404
499
|
}
|
|
405
500
|
export declare class RegexLiteralExpression extends Expression {
|
|
501
|
+
constructor(options: {
|
|
502
|
+
regexLiteral: Token;
|
|
503
|
+
});
|
|
504
|
+
readonly kind = AstNodeKind.RegexLiteralExpression;
|
|
406
505
|
tokens: {
|
|
407
506
|
regexLiteral: Token;
|
|
408
507
|
};
|
|
409
|
-
|
|
410
|
-
regexLiteral: Token;
|
|
411
|
-
});
|
|
412
|
-
readonly range: Range;
|
|
508
|
+
get range(): Range;
|
|
413
509
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
414
510
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
415
511
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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;
|
|
434
|
-
/**
|
|
435
|
-
* Is this a valid, (eg. known) type?
|
|
436
|
-
*/
|
|
437
|
-
isValidType(parseMode?: ParseMode): boolean;
|
|
512
|
+
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
513
|
+
[key: string]: ExpressionValue;
|
|
514
|
+
};
|
|
515
|
+
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
516
|
+
constructor(options: {
|
|
517
|
+
/**
|
|
518
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
519
|
+
*/
|
|
520
|
+
expression: Expression;
|
|
521
|
+
});
|
|
522
|
+
readonly kind = AstNodeKind.TypeExpression;
|
|
438
523
|
/**
|
|
439
|
-
*
|
|
440
|
-
* @returns text to display to show the type
|
|
524
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
441
525
|
*/
|
|
442
|
-
|
|
526
|
+
expression: Expression;
|
|
527
|
+
range: Range;
|
|
443
528
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
444
529
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
530
|
+
getType(options: GetTypeOptions): BscType;
|
|
531
|
+
getTypedef(state: TranspileState): (string | SourceNode)[];
|
|
532
|
+
getName(parseMode?: ParseMode): string;
|
|
533
|
+
getNameParts(): string[];
|
|
445
534
|
}
|
|
446
|
-
export declare class
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
535
|
+
export declare class TypeCastExpression extends Expression {
|
|
536
|
+
constructor(options: {
|
|
537
|
+
obj: Expression;
|
|
538
|
+
as?: Token;
|
|
539
|
+
typeExpression?: TypeExpression;
|
|
540
|
+
});
|
|
541
|
+
readonly kind = AstNodeKind.TypeCastExpression;
|
|
542
|
+
obj: Expression;
|
|
543
|
+
tokens: {
|
|
544
|
+
as?: Token;
|
|
545
|
+
};
|
|
546
|
+
typeExpression?: TypeExpression;
|
|
547
|
+
range: Range;
|
|
548
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
549
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
550
|
+
getType(options: GetTypeOptions): BscType;
|
|
551
|
+
}
|
|
552
|
+
export declare class TypedArrayExpression extends Expression {
|
|
553
|
+
constructor(options: {
|
|
554
|
+
innerType: Expression;
|
|
452
555
|
leftBracket?: Token;
|
|
453
556
|
rightBracket?: Token;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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;
|
|
557
|
+
});
|
|
558
|
+
tokens: {
|
|
559
|
+
leftBracket?: Token;
|
|
560
|
+
rightBracket?: Token;
|
|
561
|
+
};
|
|
562
|
+
innerType: Expression;
|
|
563
|
+
readonly kind = AstNodeKind.TypedArrayExpression;
|
|
564
|
+
range: Range;
|
|
565
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
471
566
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
567
|
+
getType(options: GetTypeOptions): BscType;
|
|
472
568
|
}
|
|
473
|
-
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
474
|
-
[key: string]: ExpressionValue;
|
|
475
|
-
};
|
|
476
569
|
export {};
|