brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -138
- package/bsconfig.schema.json +121 -5
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +45 -0
- package/dist/AstValidationSegmenter.js +322 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +72 -39
- package/dist/BusyStatusTracker.d.ts +61 -0
- package/dist/BusyStatusTracker.js +148 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +3 -8
- package/dist/Cache.js +9 -14
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +12 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +11 -8
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +642 -0
- package/dist/CrossScopeValidator.js.map +1 -0
- package/dist/DependencyGraph.d.ts +8 -3
- package/dist/DependencyGraph.js +49 -16
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +21 -5
- package/dist/DiagnosticCollection.js +77 -24
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +27 -6
- package/dist/DiagnosticFilterer.js +273 -60
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +82 -0
- package/dist/DiagnosticManager.js +406 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +558 -196
- package/dist/DiagnosticMessages.js +870 -340
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +45 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +100 -105
- package/dist/LanguageServer.js +444 -745
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +17 -13
- package/dist/Logger.js +64 -34
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +32 -10
- package/dist/PluginInterface.js +117 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +241 -98
- package/dist/Program.js +1432 -717
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +47 -23
- package/dist/ProgramBuilder.js +224 -178
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +149 -109
- package/dist/Scope.js +557 -550
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.js +5 -1
- package/dist/SemanticTokenUtils.js.map +1 -1
- package/dist/Stopwatch.d.ts +4 -0
- package/dist/Stopwatch.js +8 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +136 -24
- package/dist/SymbolTable.js +565 -64
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTypeFlag.d.ts +9 -0
- package/dist/SymbolTypeFlag.js +14 -0
- package/dist/SymbolTypeFlag.js.map +1 -0
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +5 -15
- package/dist/XmlScope.js +34 -90
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +334 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/CachedLookups.spec.js +39 -0
- package/dist/astUtils/CachedLookups.spec.js.map +1 -0
- package/dist/astUtils/Editor.d.ts +69 -0
- package/dist/astUtils/Editor.js +245 -0
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/Editor.spec.js +258 -0
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +54 -19
- package/dist/astUtils/creators.js +242 -42
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +196 -85
- package/dist/astUtils/reflection.js +497 -144
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -167
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +14 -14
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +116 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +629 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +12 -7
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +24 -4
- package/dist/bscPlugin/BscPlugin.js +88 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +143 -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 +137 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +6 -5
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -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 +212 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -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 +18 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +230 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
- package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
- package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +164 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +564 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
- package/dist/bscPlugin/serialize/BslibManager.js +46 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
- package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -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/BrsFileAfterValidator.d.ts +7 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +37 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +638 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1517 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +141 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1323 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +6135 -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 +36 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +126 -27
- package/dist/cli.js.map +1 -1
- package/dist/common/Sequencer.d.ts +53 -0
- package/dist/common/Sequencer.js +233 -0
- package/dist/common/Sequencer.js.map +1 -0
- package/dist/common/Sequencer.spec.d.ts +1 -0
- package/dist/common/Sequencer.spec.js +75 -0
- package/dist/common/Sequencer.spec.js.map +1 -0
- package/dist/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +10 -3
- package/dist/diagnosticUtils.js +64 -25
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.d.ts +2 -2
- package/dist/examples/plugins/removePrint.js +8 -12
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +24 -0
- package/dist/files/AssetFile.js +25 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +1213 -259
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +145 -87
- package/dist/files/BrsFile.js +836 -934
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +4226 -902
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +102 -0
- package/dist/files/BscFile.js +15 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +21 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/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 +80 -41
- package/dist/files/XmlFile.js +161 -137
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +444 -336
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +62 -52
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
- package/dist/files/tests/optionalChaning.spec.js +152 -0
- package/dist/files/tests/optionalChaning.spec.js.map +1 -0
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +424 -184
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +32 -4
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +942 -125
- package/dist/interfaces.js +21 -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 +51 -12
- package/dist/lexer/Lexer.js +215 -65
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +812 -568
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +27 -11
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +40 -2
- package/dist/lexer/TokenKind.js +147 -10
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +14 -0
- package/dist/logging.js +29 -0
- package/dist/logging.js.map +1 -0
- package/dist/lsp/ActionQueue.d.ts +35 -0
- package/dist/lsp/ActionQueue.js +115 -0
- package/dist/lsp/ActionQueue.js.map +1 -0
- package/dist/lsp/ActionQueue.spec.d.ts +1 -0
- package/dist/lsp/ActionQueue.spec.js +80 -0
- package/dist/lsp/ActionQueue.spec.js.map +1 -0
- package/dist/lsp/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/DocumentManager.spec.d.ts +1 -0
- package/dist/lsp/DocumentManager.spec.js +103 -0
- package/dist/lsp/DocumentManager.spec.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +239 -0
- package/dist/lsp/LspProject.js +3 -0
- package/dist/lsp/LspProject.js.map +1 -0
- package/dist/lsp/PathFilterer.d.ts +75 -0
- package/dist/lsp/PathFilterer.js +196 -0
- package/dist/lsp/PathFilterer.js.map +1 -0
- package/dist/lsp/PathFilterer.spec.d.ts +1 -0
- package/dist/lsp/PathFilterer.spec.js +182 -0
- package/dist/lsp/PathFilterer.spec.js.map +1 -0
- package/dist/lsp/Project.d.ts +168 -0
- package/dist/lsp/Project.js +437 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/Project.spec.d.ts +1 -0
- package/dist/lsp/Project.spec.js +267 -0
- package/dist/lsp/Project.spec.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +242 -0
- package/dist/lsp/ProjectManager.js +824 -0
- package/dist/lsp/ProjectManager.js.map +1 -0
- package/dist/lsp/ProjectManager.spec.d.ts +1 -0
- package/dist/lsp/ProjectManager.spec.js +913 -0
- package/dist/lsp/ProjectManager.spec.js.map +1 -0
- package/dist/lsp/ReaderWriterManager.d.ts +21 -0
- package/dist/lsp/ReaderWriterManager.js +60 -0
- package/dist/lsp/ReaderWriterManager.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.d.ts +99 -0
- package/dist/lsp/worker/MessageHandler.js +138 -0
- package/dist/lsp/worker/MessageHandler.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
- package/dist/lsp/worker/MessageHandler.spec.js +64 -0
- package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.d.ts +38 -0
- package/dist/lsp/worker/WorkerPool.js +78 -0
- package/dist/lsp/worker/WorkerPool.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
- package/dist/lsp/worker/WorkerPool.spec.js +59 -0
- package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
- package/dist/lsp/worker/WorkerThreadProject.js +189 -0
- package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
- package/dist/lsp/worker/run.d.ts +1 -0
- package/dist/lsp/worker/run.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +203 -0
- package/dist/parser/AstNode.js +303 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +1455 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.d.ts +56 -0
- package/dist/parser/BrightScriptDocParser.js +294 -0
- package/dist/parser/BrightScriptDocParser.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
- package/dist/parser/BrightScriptDocParser.spec.js +310 -0
- package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +22 -3
- package/dist/parser/BrsTranspileState.js +19 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +553 -221
- package/dist/parser/Expression.js +1414 -505
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Expression.spec.d.ts +1 -0
- package/dist/parser/Expression.spec.js +40 -0
- package/dist/parser/Expression.spec.js.map +1 -0
- package/dist/parser/Parser.Class.spec.js +255 -125
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +117 -124
- package/dist/parser/Parser.js +1669 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +2111 -525
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +29 -13
- package/dist/parser/SGParser.js +85 -56
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -45
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +134 -46
- package/dist/parser/SGTypes.js +206 -115
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +849 -267
- package/dist/parser/Statement.js +2412 -625
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +133 -36
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +26 -12
- package/dist/parser/TranspileState.js +115 -24
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +3 -9
- package/dist/parser/tests/Parser.spec.js +7 -13
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +83 -75
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +382 -239
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +52 -45
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +51 -43
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +41 -34
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +173 -55
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +20 -20
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +291 -282
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +193 -110
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +76 -60
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +50 -50
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +281 -94
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
- 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 +126 -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 +44 -44
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +500 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +61 -55
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +29 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Enum.spec.js +744 -0
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
- package/dist/parser/tests/statement/For.spec.d.ts +1 -0
- package/dist/parser/tests/statement/For.spec.js +45 -0
- package/dist/parser/tests/statement/For.spec.js.map +1 -0
- package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ForEach.spec.js +36 -0
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
- package/dist/parser/tests/statement/Function.spec.js +226 -215
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +16 -15
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +64 -61
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +127 -168
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +131 -117
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +14 -13
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +11 -8
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +6 -6
- package/dist/preprocessor/Manifest.js +17 -38
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.d.ts +1 -0
- package/dist/preprocessor/Manifest.spec.js +78 -103
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/roku-types/data.json +20347 -0
- package/dist/roku-types/index.d.ts +5726 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +12 -5
- package/dist/types/ArrayType.js +89 -24
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +39 -11
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +15 -0
- package/dist/types/AssociativeArrayType.js +64 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +10 -0
- package/dist/types/BaseFunctionType.js +26 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +9 -5
- package/dist/types/BooleanType.js +19 -8
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -4
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +41 -3
- package/dist/types/BscType.js +152 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +28 -0
- package/dist/types/BscTypeKind.js +33 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
- package/dist/types/BuiltInInterfaceAdder.js +212 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/CallFuncableType.d.ts +24 -0
- package/dist/types/CallFuncableType.js +91 -0
- package/dist/types/CallFuncableType.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +60 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +76 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +22 -0
- package/dist/types/ComponentType.js +107 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +21 -17
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -4
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +13 -5
- package/dist/types/DynamicType.js +26 -5
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +42 -0
- package/dist/types/EnumType.js +98 -0
- package/dist/types/EnumType.js.map +1 -0
- 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 +10 -5
- package/dist/types/FloatType.js +21 -17
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -4
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +8 -22
- package/dist/types/FunctionType.js +25 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +29 -0
- package/dist/types/InheritableType.js +173 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/InlineInterfaceType.d.ts +5 -0
- package/dist/types/InlineInterfaceType.js +17 -0
- package/dist/types/InlineInterfaceType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +21 -17
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -4
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +30 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +227 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +253 -0
- package/dist/types/IntersectionType.js.map +1 -0
- package/dist/types/IntersectionType.spec.d.ts +1 -0
- package/dist/types/IntersectionType.spec.js +150 -0
- package/dist/types/IntersectionType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +10 -5
- package/dist/types/InvalidType.js +21 -9
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -4
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +21 -17
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -4
- 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 +12 -5
- package/dist/types/ObjectType.js +25 -8
- 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 +123 -0
- package/dist/types/ReferenceType.js +720 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +151 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +12 -5
- package/dist/types/StringType.js +23 -8
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -3
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypeStatementType.d.ts +18 -0
- package/dist/types/TypeStatementType.js +45 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +147 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +122 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.d.ts +11 -6
- package/dist/types/UninitializedType.js +20 -11
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +27 -0
- package/dist/types/UnionType.js +193 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +205 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +11 -5
- package/dist/types/VoidType.js +22 -8
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/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 +174 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +51 -0
- package/dist/types/helpers.js +323 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/roFunctionType.d.ts +11 -0
- package/dist/types/roFunctionType.js +37 -0
- package/dist/types/roFunctionType.js.map +1 -0
- package/dist/types/roFunctionType.spec.d.ts +1 -0
- package/dist/types/roFunctionType.spec.js +20 -0
- package/dist/types/roFunctionType.spec.js.map +1 -0
- package/dist/util.d.ts +288 -187
- package/dist/util.js +2018 -575
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +93 -138
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +185 -138
- package/CHANGELOG.md +0 -1188
- package/dist/astUtils/index.d.ts +0 -7
- package/dist/astUtils/index.js +0 -26
- package/dist/astUtils/index.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
- package/dist/lexer/index.d.ts +0 -3
- package/dist/lexer/index.js +0 -17
- package/dist/lexer/index.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.js +0 -16
- package/dist/parser/index.js.map +0 -1
- package/dist/preprocessor/Chunk.d.ts +0 -82
- package/dist/preprocessor/Chunk.js +0 -77
- package/dist/preprocessor/Chunk.js.map +0 -1
- package/dist/preprocessor/Preprocessor.d.ts +0 -60
- package/dist/preprocessor/Preprocessor.js +0 -156
- package/dist/preprocessor/Preprocessor.js.map +0 -1
- package/dist/preprocessor/Preprocessor.spec.js +0 -152
- package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
- package/dist/preprocessor/PreprocessorParser.js +0 -194
- package/dist/preprocessor/PreprocessorParser.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
- package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
- package/dist/preprocessor/index.d.ts +0 -3
- package/dist/preprocessor/index.js +0 -16
- package/dist/preprocessor/index.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -10
- package/dist/types/CustomType.js +0 -35
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -15
- package/dist/types/LazyType.js +0 -32
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isConditionalCompileConstStatement = exports.isConditionalCompileStatement = exports.isThrowStatement = exports.isCatchStatement = exports.isTryCatchStatement = exports.isContinueStatement = exports.isConstStatement = exports.isEnumMemberStatement = exports.isEnumStatement = exports.isMemberMethod = exports.isMemberField = exports.isInterfaceFieldStatement = exports.isInterfaceMethodStatement = exports.isInterfaceStatement = exports.isFieldStatement = exports.isMethodStatement = exports.isImportStatement = exports.isClassStatement = exports.isNamespaceStatement = exports.isLibraryStatement = exports.isIndexedSetStatement = exports.isDottedSetStatement = exports.isDimStatement = exports.isWhileStatement = exports.isForEachStatement = exports.isForStatement = exports.isStopStatement = exports.isEndStatement = exports.isNullCoalescingExpression = exports.isTernaryExpression = exports.isReturnStatement = exports.isLabelStatement = exports.isGotoStatement = exports.isPrintStatement = exports.isIncrementStatement = exports.isIfStatement = exports.isFunctionStatement = exports.isExitStatement = exports.isExpressionStatement = exports.isBlock = exports.isAssignmentStatement = exports.isBody = exports.isStatement = exports.isProject = exports.isProgram = exports.isXmlScope = exports.isBscFile = exports.isAssetFile = exports.isXmlFile = exports.isBrsFile = void 0;
|
|
4
|
+
exports.isRoLongIntegerType = exports.isLongIntegerType = exports.isIntegerTypeLike = exports.isRoIntType = exports.isIntegerType = exports.isBooleanTypeLike = exports.isRoBooleanType = exports.isBooleanType = exports.isFunctionTypeLike = exports.isRoFunctionType = exports.isFunctionType = exports.isTypedFunctionType = exports.isStringTypeLike = exports.isRoStringType = exports.isStringType = exports.isInlineInterfaceMemberExpression = exports.isInlineInterfaceExpression = exports.isPrintSeparatorExpression = exports.isTypedArrayExpression = exports.isTypecastExpression = exports.isTypeExpression = exports.isTypedefProvider = exports.isAnnotationExpression = exports.isFunctionParameterExpression = exports.isTaggedTemplateStringExpression = exports.isTemplateStringExpression = exports.isTemplateStringQuasiExpression = exports.isCallfuncExpression = exports.isNewExpression = exports.isSourceLiteralExpression = exports.isVariableExpression = exports.isUnaryExpression = exports.isAAMemberExpression = exports.isAALiteralExpression = exports.isArrayLiteralExpression = exports.isEscapedCharCodeLiteralExpression = exports.isLiteralExpression = exports.isGroupingExpression = exports.isIndexedGetExpression = exports.isXmlAttributeGetExpression = exports.isDottedGetExpression = exports.isFunctionExpression = exports.isCallExpression = exports.isBinaryExpression = exports.isExpression = exports.isTypeStatement = exports.isAliasStatement = exports.isTypecastStatement = exports.isAugmentedAssignmentStatement = exports.isConditionalCompileErrorStatement = void 0;
|
|
5
|
+
exports.isIterableType = exports.isCompoundType = exports.isCompoundTypeOf = exports.isIntersectionTypeOf = exports.isUnionTypeOf = exports.isTypeStatementTypeOf = exports.isNativeType = exports.isBuiltInType = exports.isCallFuncableTypeLike = exports.isArrayTypeLike = exports.isAssociativeArrayTypeLike = exports.isPrimitiveTypeLike = exports.isPrimitiveType = exports.isNumberTypeLike = exports.isNumberType = exports.isAnyReferenceType = exports.isCallableType = exports.isCallFuncableType = exports.isInheritableType = exports.isTypeStatementType = exports.isAssociativeArrayType = exports.isArrayType = exports.isUninitializedType = exports.isIntersectionType = exports.isUnionType = exports.isNamespaceType = exports.isReferenceTypeWithDefault = exports.isParamTypeFromValueReferenceType = exports.isArrayDefaultTypeReferenceType = exports.isBinaryOperatorReferenceType = exports.isTypePropertyReferenceType = exports.isEnumMemberType = exports.isEnumType = exports.isReferenceType = exports.isObjectType = exports.isInterfaceType = exports.isDynamicType = exports.isComponentType = exports.isClassType = exports.isVoidType = exports.isInvalidTypeLike = exports.isRoInvalidType = exports.isInvalidType = exports.isDoubleTypeLike = exports.isRoDoubleType = exports.isDoubleType = exports.isFloatTypeLike = exports.isRoFloatType = exports.isFloatType = exports.isLongIntegerTypeLike = void 0;
|
|
6
|
+
exports.isBsDiagnostic = exports.isLiteralDouble = exports.isLiteralFloat = exports.isLiteralLongInteger = exports.isLiteralInteger = exports.isLiteralNumber = exports.isLiteralString = exports.isLiteralBoolean = exports.isLiteralInvalid = void 0;
|
|
4
7
|
const visitors_1 = require("./visitors");
|
|
8
|
+
const AstNode_1 = require("../parser/AstNode");
|
|
9
|
+
const BscTypeKind_1 = require("../types/BscTypeKind");
|
|
10
|
+
const TokenKind_1 = require("../lexer/TokenKind");
|
|
5
11
|
// File reflection
|
|
6
12
|
function isBrsFile(file) {
|
|
7
13
|
return (file === null || file === void 0 ? void 0 : file.constructor.name) === 'BrsFile';
|
|
@@ -11,13 +17,29 @@ function isXmlFile(file) {
|
|
|
11
17
|
return (file === null || file === void 0 ? void 0 : file.constructor.name) === 'XmlFile';
|
|
12
18
|
}
|
|
13
19
|
exports.isXmlFile = isXmlFile;
|
|
20
|
+
function isAssetFile(file) {
|
|
21
|
+
return (file === null || file === void 0 ? void 0 : file.constructor.name) === 'AssetFile';
|
|
22
|
+
}
|
|
23
|
+
exports.isAssetFile = isAssetFile;
|
|
24
|
+
function isBscFile(file) {
|
|
25
|
+
return isBrsFile(file) || isXmlFile(file) || isAssetFile(file);
|
|
26
|
+
}
|
|
27
|
+
exports.isBscFile = isBscFile;
|
|
14
28
|
function isXmlScope(scope) {
|
|
15
29
|
return (scope === null || scope === void 0 ? void 0 : scope.constructor.name) === 'XmlScope';
|
|
16
30
|
}
|
|
17
31
|
exports.isXmlScope = isXmlScope;
|
|
32
|
+
function isProgram(arg) {
|
|
33
|
+
return (arg === null || arg === void 0 ? void 0 : arg.constructor.name) === 'Program';
|
|
34
|
+
}
|
|
35
|
+
exports.isProgram = isProgram;
|
|
36
|
+
function isProject(arg) {
|
|
37
|
+
return (arg === null || arg === void 0 ? void 0 : arg.constructor.name) === 'Project';
|
|
38
|
+
}
|
|
39
|
+
exports.isProject = isProject;
|
|
18
40
|
// Statements reflection
|
|
19
41
|
/**
|
|
20
|
-
* Determine if the
|
|
42
|
+
* Determine if the variablvalue is a descendent of the Statement base class.
|
|
21
43
|
* Due to performance restrictions, this expects all statements to
|
|
22
44
|
* directly extend Statement or FunctionStatement,
|
|
23
45
|
* so it only checks the immediate parent's class name.
|
|
@@ -33,8 +55,7 @@ function isBody(element) {
|
|
|
33
55
|
}
|
|
34
56
|
exports.isBody = isBody;
|
|
35
57
|
function isAssignmentStatement(element) {
|
|
36
|
-
|
|
37
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'AssignmentStatement';
|
|
58
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.AssignmentStatement;
|
|
38
59
|
}
|
|
39
60
|
exports.isAssignmentStatement = isAssignmentStatement;
|
|
40
61
|
function isBlock(element) {
|
|
@@ -43,126 +64,190 @@ function isBlock(element) {
|
|
|
43
64
|
}
|
|
44
65
|
exports.isBlock = isBlock;
|
|
45
66
|
function isExpressionStatement(element) {
|
|
46
|
-
|
|
47
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ExpressionStatement';
|
|
67
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ExpressionStatement;
|
|
48
68
|
}
|
|
49
69
|
exports.isExpressionStatement = isExpressionStatement;
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'CommentStatement';
|
|
70
|
+
function isExitStatement(element) {
|
|
71
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ExitStatement;
|
|
53
72
|
}
|
|
54
|
-
exports.
|
|
55
|
-
function isExitForStatement(element) {
|
|
56
|
-
var _a;
|
|
57
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ExitForStatement';
|
|
58
|
-
}
|
|
59
|
-
exports.isExitForStatement = isExitForStatement;
|
|
60
|
-
function isExitWhileStatement(element) {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ExitWhileStatement';
|
|
63
|
-
}
|
|
64
|
-
exports.isExitWhileStatement = isExitWhileStatement;
|
|
73
|
+
exports.isExitStatement = isExitStatement;
|
|
65
74
|
function isFunctionStatement(element) {
|
|
66
|
-
|
|
67
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'FunctionStatement';
|
|
75
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.FunctionStatement;
|
|
68
76
|
}
|
|
69
77
|
exports.isFunctionStatement = isFunctionStatement;
|
|
70
78
|
function isIfStatement(element) {
|
|
71
|
-
|
|
72
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'IfStatement';
|
|
79
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.IfStatement;
|
|
73
80
|
}
|
|
74
81
|
exports.isIfStatement = isIfStatement;
|
|
75
82
|
function isIncrementStatement(element) {
|
|
76
|
-
|
|
77
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'IncrementStatement';
|
|
83
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.IncrementStatement;
|
|
78
84
|
}
|
|
79
85
|
exports.isIncrementStatement = isIncrementStatement;
|
|
80
86
|
function isPrintStatement(element) {
|
|
81
|
-
|
|
82
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'PrintStatement';
|
|
87
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.PrintStatement;
|
|
83
88
|
}
|
|
84
89
|
exports.isPrintStatement = isPrintStatement;
|
|
85
90
|
function isGotoStatement(element) {
|
|
86
|
-
|
|
87
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'GotoStatement';
|
|
91
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.GotoStatement;
|
|
88
92
|
}
|
|
89
93
|
exports.isGotoStatement = isGotoStatement;
|
|
90
94
|
function isLabelStatement(element) {
|
|
91
|
-
|
|
92
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'LabelStatement';
|
|
95
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.LabelStatement;
|
|
93
96
|
}
|
|
94
97
|
exports.isLabelStatement = isLabelStatement;
|
|
95
98
|
function isReturnStatement(element) {
|
|
96
|
-
|
|
97
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ReturnStatement';
|
|
99
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ReturnStatement;
|
|
98
100
|
}
|
|
99
101
|
exports.isReturnStatement = isReturnStatement;
|
|
100
|
-
function
|
|
102
|
+
function isTernaryExpression(element) {
|
|
101
103
|
var _a;
|
|
102
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === '
|
|
104
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'TernaryExpression';
|
|
105
|
+
}
|
|
106
|
+
exports.isTernaryExpression = isTernaryExpression;
|
|
107
|
+
function isNullCoalescingExpression(element) {
|
|
108
|
+
var _a;
|
|
109
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'NullCoalescingExpression';
|
|
110
|
+
}
|
|
111
|
+
exports.isNullCoalescingExpression = isNullCoalescingExpression;
|
|
112
|
+
function isEndStatement(element) {
|
|
113
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.EndStatement;
|
|
103
114
|
}
|
|
104
115
|
exports.isEndStatement = isEndStatement;
|
|
105
116
|
function isStopStatement(element) {
|
|
106
|
-
|
|
107
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'StopStatement';
|
|
117
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.StopStatement;
|
|
108
118
|
}
|
|
109
119
|
exports.isStopStatement = isStopStatement;
|
|
110
120
|
function isForStatement(element) {
|
|
111
|
-
|
|
112
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ForStatement';
|
|
121
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ForStatement;
|
|
113
122
|
}
|
|
114
123
|
exports.isForStatement = isForStatement;
|
|
115
124
|
function isForEachStatement(element) {
|
|
116
|
-
|
|
117
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ForEachStatement';
|
|
125
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ForEachStatement;
|
|
118
126
|
}
|
|
119
127
|
exports.isForEachStatement = isForEachStatement;
|
|
120
128
|
function isWhileStatement(element) {
|
|
121
|
-
|
|
122
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'WhileStatement';
|
|
129
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.WhileStatement;
|
|
123
130
|
}
|
|
124
131
|
exports.isWhileStatement = isWhileStatement;
|
|
125
|
-
function
|
|
132
|
+
function isDimStatement(element) {
|
|
126
133
|
var _a;
|
|
127
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === '
|
|
134
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'DimStatement';
|
|
135
|
+
}
|
|
136
|
+
exports.isDimStatement = isDimStatement;
|
|
137
|
+
function isDottedSetStatement(element) {
|
|
138
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.DottedSetStatement;
|
|
128
139
|
}
|
|
129
140
|
exports.isDottedSetStatement = isDottedSetStatement;
|
|
130
141
|
function isIndexedSetStatement(element) {
|
|
131
|
-
|
|
132
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'IndexedSetStatement';
|
|
142
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.IndexedSetStatement;
|
|
133
143
|
}
|
|
134
144
|
exports.isIndexedSetStatement = isIndexedSetStatement;
|
|
135
145
|
function isLibraryStatement(element) {
|
|
136
|
-
|
|
137
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'LibraryStatement';
|
|
146
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.LibraryStatement;
|
|
138
147
|
}
|
|
139
148
|
exports.isLibraryStatement = isLibraryStatement;
|
|
140
149
|
function isNamespaceStatement(element) {
|
|
141
|
-
|
|
142
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'NamespaceStatement';
|
|
150
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.NamespaceStatement;
|
|
143
151
|
}
|
|
144
152
|
exports.isNamespaceStatement = isNamespaceStatement;
|
|
145
153
|
function isClassStatement(element) {
|
|
146
|
-
|
|
147
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ClassStatement';
|
|
154
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ClassStatement;
|
|
148
155
|
}
|
|
149
156
|
exports.isClassStatement = isClassStatement;
|
|
150
157
|
function isImportStatement(element) {
|
|
151
|
-
|
|
152
|
-
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ImportStatement';
|
|
158
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ImportStatement;
|
|
153
159
|
}
|
|
154
160
|
exports.isImportStatement = isImportStatement;
|
|
155
|
-
function
|
|
156
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
161
|
+
function isMethodStatement(element) {
|
|
162
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.MethodStatement;
|
|
163
|
+
}
|
|
164
|
+
exports.isMethodStatement = isMethodStatement;
|
|
165
|
+
function isFieldStatement(element) {
|
|
166
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.FieldStatement;
|
|
167
|
+
}
|
|
168
|
+
exports.isFieldStatement = isFieldStatement;
|
|
169
|
+
function isInterfaceStatement(element) {
|
|
170
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.InterfaceStatement;
|
|
171
|
+
}
|
|
172
|
+
exports.isInterfaceStatement = isInterfaceStatement;
|
|
173
|
+
function isInterfaceMethodStatement(element) {
|
|
174
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.InterfaceMethodStatement;
|
|
175
|
+
}
|
|
176
|
+
exports.isInterfaceMethodStatement = isInterfaceMethodStatement;
|
|
177
|
+
function isInterfaceFieldStatement(element) {
|
|
178
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.InterfaceFieldStatement;
|
|
179
|
+
}
|
|
180
|
+
exports.isInterfaceFieldStatement = isInterfaceFieldStatement;
|
|
181
|
+
function isMemberField(element) {
|
|
182
|
+
return isFieldStatement(element) || isInterfaceFieldStatement(element);
|
|
183
|
+
}
|
|
184
|
+
exports.isMemberField = isMemberField;
|
|
185
|
+
function isMemberMethod(element) {
|
|
186
|
+
return isMethodStatement(element) || isInterfaceMethodStatement(element);
|
|
187
|
+
}
|
|
188
|
+
exports.isMemberMethod = isMemberMethod;
|
|
189
|
+
function isEnumStatement(element) {
|
|
190
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.EnumStatement;
|
|
191
|
+
}
|
|
192
|
+
exports.isEnumStatement = isEnumStatement;
|
|
193
|
+
function isEnumMemberStatement(element) {
|
|
194
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.EnumMemberStatement;
|
|
195
|
+
}
|
|
196
|
+
exports.isEnumMemberStatement = isEnumMemberStatement;
|
|
197
|
+
function isConstStatement(element) {
|
|
198
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ConstStatement;
|
|
199
|
+
}
|
|
200
|
+
exports.isConstStatement = isConstStatement;
|
|
201
|
+
function isContinueStatement(element) {
|
|
202
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ContinueStatement;
|
|
157
203
|
}
|
|
158
|
-
exports.
|
|
159
|
-
function
|
|
160
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
204
|
+
exports.isContinueStatement = isContinueStatement;
|
|
205
|
+
function isTryCatchStatement(element) {
|
|
206
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TryCatchStatement;
|
|
161
207
|
}
|
|
162
|
-
exports.
|
|
208
|
+
exports.isTryCatchStatement = isTryCatchStatement;
|
|
209
|
+
function isCatchStatement(element) {
|
|
210
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.CatchStatement;
|
|
211
|
+
}
|
|
212
|
+
exports.isCatchStatement = isCatchStatement;
|
|
213
|
+
function isThrowStatement(element) {
|
|
214
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ThrowStatement;
|
|
215
|
+
}
|
|
216
|
+
exports.isThrowStatement = isThrowStatement;
|
|
217
|
+
function isConditionalCompileStatement(element) {
|
|
218
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ConditionalCompileStatement;
|
|
219
|
+
}
|
|
220
|
+
exports.isConditionalCompileStatement = isConditionalCompileStatement;
|
|
221
|
+
function isConditionalCompileConstStatement(element) {
|
|
222
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ConditionalCompileConstStatement;
|
|
223
|
+
}
|
|
224
|
+
exports.isConditionalCompileConstStatement = isConditionalCompileConstStatement;
|
|
225
|
+
function isConditionalCompileErrorStatement(element) {
|
|
226
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ConditionalCompileErrorStatement;
|
|
227
|
+
}
|
|
228
|
+
exports.isConditionalCompileErrorStatement = isConditionalCompileErrorStatement;
|
|
229
|
+
function isAugmentedAssignmentStatement(element) {
|
|
230
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.AugmentedAssignmentStatement;
|
|
231
|
+
}
|
|
232
|
+
exports.isAugmentedAssignmentStatement = isAugmentedAssignmentStatement;
|
|
233
|
+
function isTypecastStatement(element) {
|
|
234
|
+
var _a;
|
|
235
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'TypecastStatement';
|
|
236
|
+
}
|
|
237
|
+
exports.isTypecastStatement = isTypecastStatement;
|
|
238
|
+
function isAliasStatement(element) {
|
|
239
|
+
var _a;
|
|
240
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'AliasStatement';
|
|
241
|
+
}
|
|
242
|
+
exports.isAliasStatement = isAliasStatement;
|
|
243
|
+
function isTypeStatement(element) {
|
|
244
|
+
var _a;
|
|
245
|
+
return ((_a = element === null || element === void 0 ? void 0 : element.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'TypeStatement';
|
|
246
|
+
}
|
|
247
|
+
exports.isTypeStatement = isTypeStatement;
|
|
163
248
|
// Expressions reflection
|
|
164
249
|
/**
|
|
165
|
-
* Determine if the
|
|
250
|
+
* Determine if the variablvalue is a descendent of the Expression base class.
|
|
166
251
|
* Due to performance restrictions, this expects all statements to directly extend Expression,
|
|
167
252
|
* so it only checks the immediate parent's class name. For example:
|
|
168
253
|
* this will work for StringLiteralExpression -> Expression,
|
|
@@ -174,188 +259,456 @@ function isExpression(element) {
|
|
|
174
259
|
}
|
|
175
260
|
exports.isExpression = isExpression;
|
|
176
261
|
function isBinaryExpression(element) {
|
|
177
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
262
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.BinaryExpression;
|
|
178
263
|
}
|
|
179
264
|
exports.isBinaryExpression = isBinaryExpression;
|
|
180
265
|
function isCallExpression(element) {
|
|
181
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
266
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.CallExpression;
|
|
182
267
|
}
|
|
183
268
|
exports.isCallExpression = isCallExpression;
|
|
184
269
|
function isFunctionExpression(element) {
|
|
185
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
270
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.FunctionExpression;
|
|
186
271
|
}
|
|
187
272
|
exports.isFunctionExpression = isFunctionExpression;
|
|
188
|
-
function isNamespacedVariableNameExpression(element) {
|
|
189
|
-
return (element === null || element === void 0 ? void 0 : element.constructor.name) === 'NamespacedVariableNameExpression';
|
|
190
|
-
}
|
|
191
|
-
exports.isNamespacedVariableNameExpression = isNamespacedVariableNameExpression;
|
|
192
273
|
function isDottedGetExpression(element) {
|
|
193
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
274
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.DottedGetExpression;
|
|
194
275
|
}
|
|
195
276
|
exports.isDottedGetExpression = isDottedGetExpression;
|
|
196
277
|
function isXmlAttributeGetExpression(element) {
|
|
197
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
278
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.XmlAttributeGetExpression;
|
|
198
279
|
}
|
|
199
280
|
exports.isXmlAttributeGetExpression = isXmlAttributeGetExpression;
|
|
200
281
|
function isIndexedGetExpression(element) {
|
|
201
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
282
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.IndexedGetExpression;
|
|
202
283
|
}
|
|
203
284
|
exports.isIndexedGetExpression = isIndexedGetExpression;
|
|
204
285
|
function isGroupingExpression(element) {
|
|
205
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
286
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.GroupingExpression;
|
|
206
287
|
}
|
|
207
288
|
exports.isGroupingExpression = isGroupingExpression;
|
|
208
289
|
function isLiteralExpression(element) {
|
|
209
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
290
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.LiteralExpression;
|
|
210
291
|
}
|
|
211
292
|
exports.isLiteralExpression = isLiteralExpression;
|
|
212
293
|
function isEscapedCharCodeLiteralExpression(element) {
|
|
213
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
294
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
214
295
|
}
|
|
215
296
|
exports.isEscapedCharCodeLiteralExpression = isEscapedCharCodeLiteralExpression;
|
|
216
297
|
function isArrayLiteralExpression(element) {
|
|
217
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
298
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.ArrayLiteralExpression;
|
|
218
299
|
}
|
|
219
300
|
exports.isArrayLiteralExpression = isArrayLiteralExpression;
|
|
220
301
|
function isAALiteralExpression(element) {
|
|
221
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
302
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.AALiteralExpression;
|
|
222
303
|
}
|
|
223
304
|
exports.isAALiteralExpression = isAALiteralExpression;
|
|
305
|
+
function isAAMemberExpression(element) {
|
|
306
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.AAMemberExpression;
|
|
307
|
+
}
|
|
308
|
+
exports.isAAMemberExpression = isAAMemberExpression;
|
|
224
309
|
function isUnaryExpression(element) {
|
|
225
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
310
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.UnaryExpression;
|
|
226
311
|
}
|
|
227
312
|
exports.isUnaryExpression = isUnaryExpression;
|
|
228
313
|
function isVariableExpression(element) {
|
|
229
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
314
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.VariableExpression;
|
|
230
315
|
}
|
|
231
316
|
exports.isVariableExpression = isVariableExpression;
|
|
232
317
|
function isSourceLiteralExpression(element) {
|
|
233
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
318
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.SourceLiteralExpression;
|
|
234
319
|
}
|
|
235
320
|
exports.isSourceLiteralExpression = isSourceLiteralExpression;
|
|
236
321
|
function isNewExpression(element) {
|
|
237
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
322
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.NewExpression;
|
|
238
323
|
}
|
|
239
324
|
exports.isNewExpression = isNewExpression;
|
|
240
325
|
function isCallfuncExpression(element) {
|
|
241
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
326
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.CallfuncExpression;
|
|
242
327
|
}
|
|
243
328
|
exports.isCallfuncExpression = isCallfuncExpression;
|
|
244
329
|
function isTemplateStringQuasiExpression(element) {
|
|
245
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
330
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TemplateStringQuasiExpression;
|
|
246
331
|
}
|
|
247
332
|
exports.isTemplateStringQuasiExpression = isTemplateStringQuasiExpression;
|
|
248
333
|
function isTemplateStringExpression(element) {
|
|
249
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
334
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TemplateStringExpression;
|
|
250
335
|
}
|
|
251
336
|
exports.isTemplateStringExpression = isTemplateStringExpression;
|
|
252
337
|
function isTaggedTemplateStringExpression(element) {
|
|
253
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
338
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TaggedTemplateStringExpression;
|
|
254
339
|
}
|
|
255
340
|
exports.isTaggedTemplateStringExpression = isTaggedTemplateStringExpression;
|
|
256
341
|
function isFunctionParameterExpression(element) {
|
|
257
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
342
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.FunctionParameterExpression;
|
|
258
343
|
}
|
|
259
344
|
exports.isFunctionParameterExpression = isFunctionParameterExpression;
|
|
260
345
|
function isAnnotationExpression(element) {
|
|
261
|
-
return (element === null || element === void 0 ? void 0 : element.
|
|
346
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.AnnotationExpression;
|
|
262
347
|
}
|
|
263
348
|
exports.isAnnotationExpression = isAnnotationExpression;
|
|
349
|
+
function isTypedefProvider(element) {
|
|
350
|
+
return 'getTypedef' in element;
|
|
351
|
+
}
|
|
352
|
+
exports.isTypedefProvider = isTypedefProvider;
|
|
353
|
+
function isTypeExpression(element) {
|
|
354
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TypeExpression;
|
|
355
|
+
}
|
|
356
|
+
exports.isTypeExpression = isTypeExpression;
|
|
357
|
+
function isTypecastExpression(element) {
|
|
358
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TypecastExpression;
|
|
359
|
+
}
|
|
360
|
+
exports.isTypecastExpression = isTypecastExpression;
|
|
361
|
+
function isTypedArrayExpression(element) {
|
|
362
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.TypedArrayExpression;
|
|
363
|
+
}
|
|
364
|
+
exports.isTypedArrayExpression = isTypedArrayExpression;
|
|
365
|
+
function isPrintSeparatorExpression(element) {
|
|
366
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.PrintSeparatorExpression;
|
|
367
|
+
}
|
|
368
|
+
exports.isPrintSeparatorExpression = isPrintSeparatorExpression;
|
|
369
|
+
function isInlineInterfaceExpression(element) {
|
|
370
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.InlineInterfaceExpression;
|
|
371
|
+
}
|
|
372
|
+
exports.isInlineInterfaceExpression = isInlineInterfaceExpression;
|
|
373
|
+
function isInlineInterfaceMemberExpression(element) {
|
|
374
|
+
return (element === null || element === void 0 ? void 0 : element.kind) === AstNode_1.AstNodeKind.InlineInterfaceMemberExpression;
|
|
375
|
+
}
|
|
376
|
+
exports.isInlineInterfaceMemberExpression = isInlineInterfaceMemberExpression;
|
|
264
377
|
// BscType reflection
|
|
265
|
-
// Note: these are Hardcoded to avoid circular dependencies
|
|
266
378
|
function isStringType(value) {
|
|
267
|
-
return (value === null || value === void 0 ? void 0 : value.
|
|
379
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.StringType;
|
|
268
380
|
}
|
|
269
381
|
exports.isStringType = isStringType;
|
|
270
|
-
function
|
|
271
|
-
return (
|
|
382
|
+
function isRoStringType(value) {
|
|
383
|
+
return isBuiltInType(value, 'roString');
|
|
384
|
+
}
|
|
385
|
+
exports.isRoStringType = isRoStringType;
|
|
386
|
+
function isStringTypeLike(value) {
|
|
387
|
+
return isStringType(value) || isRoStringType(value) || isCompoundTypeOf(value, isStringTypeLike);
|
|
388
|
+
}
|
|
389
|
+
exports.isStringTypeLike = isStringTypeLike;
|
|
390
|
+
function isTypedFunctionType(value) {
|
|
391
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.TypedFunctionType;
|
|
392
|
+
}
|
|
393
|
+
exports.isTypedFunctionType = isTypedFunctionType;
|
|
394
|
+
function isFunctionType(value) {
|
|
395
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.FunctionType;
|
|
272
396
|
}
|
|
273
397
|
exports.isFunctionType = isFunctionType;
|
|
274
|
-
function
|
|
275
|
-
return (
|
|
398
|
+
function isRoFunctionType(value) {
|
|
399
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.RoFunctionType || isBuiltInType(value, 'roFunction');
|
|
400
|
+
}
|
|
401
|
+
exports.isRoFunctionType = isRoFunctionType;
|
|
402
|
+
function isFunctionTypeLike(value) {
|
|
403
|
+
return isFunctionType(value) || isRoFunctionType(value) || isCompoundTypeOf(value, isFunctionTypeLike);
|
|
404
|
+
}
|
|
405
|
+
exports.isFunctionTypeLike = isFunctionTypeLike;
|
|
406
|
+
function isBooleanType(value) {
|
|
407
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.BooleanType;
|
|
276
408
|
}
|
|
277
409
|
exports.isBooleanType = isBooleanType;
|
|
278
|
-
function
|
|
279
|
-
return (
|
|
410
|
+
function isRoBooleanType(value) {
|
|
411
|
+
return isBuiltInType(value, 'roBoolean');
|
|
412
|
+
}
|
|
413
|
+
exports.isRoBooleanType = isRoBooleanType;
|
|
414
|
+
function isBooleanTypeLike(value) {
|
|
415
|
+
return isBooleanType(value) || isRoBooleanType(value) || isCompoundTypeOf(value, isBooleanTypeLike);
|
|
416
|
+
}
|
|
417
|
+
exports.isBooleanTypeLike = isBooleanTypeLike;
|
|
418
|
+
function isIntegerType(value) {
|
|
419
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.IntegerType;
|
|
280
420
|
}
|
|
281
421
|
exports.isIntegerType = isIntegerType;
|
|
282
|
-
function
|
|
283
|
-
return (
|
|
422
|
+
function isRoIntType(value) {
|
|
423
|
+
return isBuiltInType(value, 'roInt');
|
|
424
|
+
}
|
|
425
|
+
exports.isRoIntType = isRoIntType;
|
|
426
|
+
function isIntegerTypeLike(value) {
|
|
427
|
+
return isIntegerType(value) || isRoIntType(value) || isCompoundTypeOf(value, isIntegerTypeLike);
|
|
428
|
+
}
|
|
429
|
+
exports.isIntegerTypeLike = isIntegerTypeLike;
|
|
430
|
+
function isLongIntegerType(value) {
|
|
431
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.LongIntegerType;
|
|
284
432
|
}
|
|
285
433
|
exports.isLongIntegerType = isLongIntegerType;
|
|
286
|
-
function
|
|
287
|
-
return (
|
|
434
|
+
function isRoLongIntegerType(value) {
|
|
435
|
+
return isBuiltInType(value, 'roLongInteger');
|
|
436
|
+
}
|
|
437
|
+
exports.isRoLongIntegerType = isRoLongIntegerType;
|
|
438
|
+
function isLongIntegerTypeLike(value) {
|
|
439
|
+
return isLongIntegerType(value) || isRoLongIntegerType(value) || isCompoundTypeOf(value, isLongIntegerTypeLike);
|
|
440
|
+
}
|
|
441
|
+
exports.isLongIntegerTypeLike = isLongIntegerTypeLike;
|
|
442
|
+
function isFloatType(value) {
|
|
443
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.FloatType;
|
|
288
444
|
}
|
|
289
445
|
exports.isFloatType = isFloatType;
|
|
290
|
-
function
|
|
291
|
-
return (
|
|
446
|
+
function isRoFloatType(value) {
|
|
447
|
+
return isBuiltInType(value, 'roFloat');
|
|
448
|
+
}
|
|
449
|
+
exports.isRoFloatType = isRoFloatType;
|
|
450
|
+
function isFloatTypeLike(value) {
|
|
451
|
+
return isFloatType(value) || isRoFloatType(value) || isCompoundTypeOf(value, isFloatTypeLike);
|
|
452
|
+
}
|
|
453
|
+
exports.isFloatTypeLike = isFloatTypeLike;
|
|
454
|
+
function isDoubleType(value) {
|
|
455
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.DoubleType;
|
|
292
456
|
}
|
|
293
457
|
exports.isDoubleType = isDoubleType;
|
|
294
|
-
function
|
|
295
|
-
return (
|
|
458
|
+
function isRoDoubleType(value) {
|
|
459
|
+
return isBuiltInType(value, 'roDouble');
|
|
460
|
+
}
|
|
461
|
+
exports.isRoDoubleType = isRoDoubleType;
|
|
462
|
+
function isDoubleTypeLike(value) {
|
|
463
|
+
return isDoubleType(value) || isRoDoubleType(value) || isCompoundTypeOf(value, isDoubleTypeLike);
|
|
464
|
+
}
|
|
465
|
+
exports.isDoubleTypeLike = isDoubleTypeLike;
|
|
466
|
+
function isInvalidType(value) {
|
|
467
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.InvalidType;
|
|
296
468
|
}
|
|
297
469
|
exports.isInvalidType = isInvalidType;
|
|
298
|
-
function
|
|
299
|
-
return (
|
|
470
|
+
function isRoInvalidType(value) {
|
|
471
|
+
return isBuiltInType(value, 'roInvalid');
|
|
472
|
+
}
|
|
473
|
+
exports.isRoInvalidType = isRoInvalidType;
|
|
474
|
+
function isInvalidTypeLike(value) {
|
|
475
|
+
return isInvalidType(value) || isRoInvalidType(value) || isCompoundTypeOf(value, isInvalidTypeLike);
|
|
476
|
+
}
|
|
477
|
+
exports.isInvalidTypeLike = isInvalidTypeLike;
|
|
478
|
+
function isVoidType(value) {
|
|
479
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.VoidType;
|
|
300
480
|
}
|
|
301
481
|
exports.isVoidType = isVoidType;
|
|
302
|
-
function
|
|
303
|
-
return (
|
|
482
|
+
function isClassType(value) {
|
|
483
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.ClassType;
|
|
304
484
|
}
|
|
305
|
-
exports.
|
|
306
|
-
function
|
|
307
|
-
return (
|
|
485
|
+
exports.isClassType = isClassType;
|
|
486
|
+
function isComponentType(value) {
|
|
487
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.ComponentType;
|
|
308
488
|
}
|
|
309
|
-
exports.
|
|
310
|
-
function
|
|
311
|
-
return (
|
|
489
|
+
exports.isComponentType = isComponentType;
|
|
490
|
+
function isDynamicType(value) {
|
|
491
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.DynamicType;
|
|
492
|
+
}
|
|
493
|
+
exports.isDynamicType = isDynamicType;
|
|
494
|
+
function isInterfaceType(value) {
|
|
495
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.InterfaceType;
|
|
312
496
|
}
|
|
313
497
|
exports.isInterfaceType = isInterfaceType;
|
|
314
|
-
function
|
|
315
|
-
return (
|
|
498
|
+
function isObjectType(value) {
|
|
499
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.ObjectType;
|
|
500
|
+
}
|
|
501
|
+
exports.isObjectType = isObjectType;
|
|
502
|
+
function isReferenceType(value) {
|
|
503
|
+
var _a;
|
|
504
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'ReferenceType';
|
|
505
|
+
}
|
|
506
|
+
exports.isReferenceType = isReferenceType;
|
|
507
|
+
function isEnumType(value) {
|
|
508
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.EnumType;
|
|
509
|
+
}
|
|
510
|
+
exports.isEnumType = isEnumType;
|
|
511
|
+
function isEnumMemberType(value) {
|
|
512
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.EnumMemberType;
|
|
513
|
+
}
|
|
514
|
+
exports.isEnumMemberType = isEnumMemberType;
|
|
515
|
+
function isTypePropertyReferenceType(value) {
|
|
516
|
+
var _a;
|
|
517
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'TypePropertyReferenceType';
|
|
518
|
+
}
|
|
519
|
+
exports.isTypePropertyReferenceType = isTypePropertyReferenceType;
|
|
520
|
+
function isBinaryOperatorReferenceType(value) {
|
|
521
|
+
var _a;
|
|
522
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'BinaryOperatorReferenceType';
|
|
523
|
+
}
|
|
524
|
+
exports.isBinaryOperatorReferenceType = isBinaryOperatorReferenceType;
|
|
525
|
+
function isArrayDefaultTypeReferenceType(value) {
|
|
526
|
+
var _a;
|
|
527
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'ArrayDefaultTypeReferenceType';
|
|
528
|
+
}
|
|
529
|
+
exports.isArrayDefaultTypeReferenceType = isArrayDefaultTypeReferenceType;
|
|
530
|
+
function isParamTypeFromValueReferenceType(value) {
|
|
531
|
+
var _a;
|
|
532
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'ParamTypeFromValueReferenceType';
|
|
533
|
+
}
|
|
534
|
+
exports.isParamTypeFromValueReferenceType = isParamTypeFromValueReferenceType;
|
|
535
|
+
function isReferenceTypeWithDefault(value) {
|
|
536
|
+
var _a;
|
|
537
|
+
return ((_a = value === null || value === void 0 ? void 0 : value.__reflection) === null || _a === void 0 ? void 0 : _a.name) === 'ReferenceTypeWithDefault';
|
|
538
|
+
}
|
|
539
|
+
exports.isReferenceTypeWithDefault = isReferenceTypeWithDefault;
|
|
540
|
+
function isNamespaceType(value) {
|
|
541
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.NamespaceType;
|
|
542
|
+
}
|
|
543
|
+
exports.isNamespaceType = isNamespaceType;
|
|
544
|
+
function isUnionType(value) {
|
|
545
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.UnionType;
|
|
546
|
+
}
|
|
547
|
+
exports.isUnionType = isUnionType;
|
|
548
|
+
function isIntersectionType(value) {
|
|
549
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.IntersectionType;
|
|
550
|
+
}
|
|
551
|
+
exports.isIntersectionType = isIntersectionType;
|
|
552
|
+
function isUninitializedType(value) {
|
|
553
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.UninitializedType;
|
|
554
|
+
}
|
|
555
|
+
exports.isUninitializedType = isUninitializedType;
|
|
556
|
+
function isArrayType(value) {
|
|
557
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.ArrayType;
|
|
316
558
|
}
|
|
317
559
|
exports.isArrayType = isArrayType;
|
|
318
|
-
function
|
|
319
|
-
return (
|
|
560
|
+
function isAssociativeArrayType(value) {
|
|
561
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.AssociativeArrayType;
|
|
320
562
|
}
|
|
321
|
-
exports.
|
|
322
|
-
function
|
|
323
|
-
return (
|
|
563
|
+
exports.isAssociativeArrayType = isAssociativeArrayType;
|
|
564
|
+
function isTypeStatementType(value) {
|
|
565
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.TypeStatementType;
|
|
324
566
|
}
|
|
325
|
-
exports.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
567
|
+
exports.isTypeStatementType = isTypeStatementType;
|
|
568
|
+
function isInheritableType(target) {
|
|
569
|
+
return isClassType(target) || isInterfaceType(target) || isComponentType(target);
|
|
570
|
+
}
|
|
571
|
+
exports.isInheritableType = isInheritableType;
|
|
572
|
+
function isCallFuncableType(target) {
|
|
573
|
+
return isInterfaceType(target) || isComponentType(target) || isCompoundTypeOf(target, isCallFuncableType);
|
|
574
|
+
}
|
|
575
|
+
exports.isCallFuncableType = isCallFuncableType;
|
|
576
|
+
function isCallableType(target) {
|
|
577
|
+
return isFunctionTypeLike(target) || isTypedFunctionType(target) || isObjectType(target) || (isDynamicType(target) && !isAnyReferenceType(target));
|
|
578
|
+
}
|
|
579
|
+
exports.isCallableType = isCallableType;
|
|
580
|
+
function isAnyReferenceType(target) {
|
|
581
|
+
var _a;
|
|
582
|
+
const name = (_a = target === null || target === void 0 ? void 0 : target.__reflection) === null || _a === void 0 ? void 0 : _a.name;
|
|
583
|
+
return name === 'ReferenceType' || name === 'TypePropertyReferenceType' || name === 'BinaryOperatorReferenceType' || name === 'ArrayDefaultTypeReferenceType' || name === 'ParamTypeFromValueReferenceType' || name === 'ReferenceTypeWithDefault';
|
|
584
|
+
}
|
|
585
|
+
exports.isAnyReferenceType = isAnyReferenceType;
|
|
586
|
+
function isNumberType(value) {
|
|
587
|
+
return isIntegerType(value) ||
|
|
588
|
+
isLongIntegerType(value) ||
|
|
589
|
+
isFloatType(value) ||
|
|
590
|
+
isDoubleType(value);
|
|
334
591
|
}
|
|
335
592
|
exports.isNumberType = isNumberType;
|
|
593
|
+
function isNumberTypeLike(value) {
|
|
594
|
+
return isIntegerTypeLike(value) ||
|
|
595
|
+
isLongIntegerTypeLike(value) ||
|
|
596
|
+
isFloatTypeLike(value) ||
|
|
597
|
+
isDoubleTypeLike(value) ||
|
|
598
|
+
isCompoundTypeOf(value, isNumberTypeLike);
|
|
599
|
+
}
|
|
600
|
+
exports.isNumberTypeLike = isNumberTypeLike;
|
|
601
|
+
function isPrimitiveType(value = false) {
|
|
602
|
+
return isNumberType(value) ||
|
|
603
|
+
isBooleanType(value) ||
|
|
604
|
+
isStringType(value);
|
|
605
|
+
}
|
|
606
|
+
exports.isPrimitiveType = isPrimitiveType;
|
|
607
|
+
function isPrimitiveTypeLike(value = false) {
|
|
608
|
+
return isNumberTypeLike(value) ||
|
|
609
|
+
isBooleanTypeLike(value) ||
|
|
610
|
+
isStringTypeLike(value) ||
|
|
611
|
+
isTypeStatementTypeOf(value, isPrimitiveTypeLike);
|
|
612
|
+
}
|
|
613
|
+
exports.isPrimitiveTypeLike = isPrimitiveTypeLike;
|
|
614
|
+
function isAssociativeArrayTypeLike(value) {
|
|
615
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.AssociativeArrayType || isBuiltInType(value, 'roAssociativeArray') || isCompoundTypeOf(value, isAssociativeArrayTypeLike);
|
|
616
|
+
}
|
|
617
|
+
exports.isAssociativeArrayTypeLike = isAssociativeArrayTypeLike;
|
|
618
|
+
function isArrayTypeLike(value) {
|
|
619
|
+
return (value === null || value === void 0 ? void 0 : value.kind) === BscTypeKind_1.BscTypeKind.ArrayType || isBuiltInType(value, 'roArray') || isCompoundTypeOf(value, isArrayTypeLike);
|
|
620
|
+
}
|
|
621
|
+
exports.isArrayTypeLike = isArrayTypeLike;
|
|
622
|
+
function isCallFuncableTypeLike(target) {
|
|
623
|
+
return isCallFuncableType(target) || isCompoundTypeOf(target, isCallFuncableTypeLike);
|
|
624
|
+
}
|
|
625
|
+
exports.isCallFuncableTypeLike = isCallFuncableTypeLike;
|
|
626
|
+
function isBuiltInType(value, name) {
|
|
627
|
+
return (isInterfaceType(value) && value.name.toLowerCase() === name.toLowerCase() && value.isBuiltIn) ||
|
|
628
|
+
(isTypeStatementType(value) && isBuiltInType(value.wrappedType, name));
|
|
629
|
+
}
|
|
630
|
+
exports.isBuiltInType = isBuiltInType;
|
|
631
|
+
const nativeTypeKinds = [
|
|
632
|
+
BscTypeKind_1.BscTypeKind.DynamicType,
|
|
633
|
+
BscTypeKind_1.BscTypeKind.ObjectType,
|
|
634
|
+
BscTypeKind_1.BscTypeKind.VoidType,
|
|
635
|
+
BscTypeKind_1.BscTypeKind.FunctionType
|
|
636
|
+
];
|
|
637
|
+
function isNativeType(value) {
|
|
638
|
+
return isPrimitiveType(value) || nativeTypeKinds.includes(value === null || value === void 0 ? void 0 : value.kind);
|
|
639
|
+
}
|
|
640
|
+
exports.isNativeType = isNativeType;
|
|
641
|
+
function isTypeStatementTypeOf(value, typeGuard) {
|
|
642
|
+
return isTypeStatementType(value) && typeGuard(value.wrappedType);
|
|
643
|
+
}
|
|
644
|
+
exports.isTypeStatementTypeOf = isTypeStatementTypeOf;
|
|
645
|
+
function isUnionTypeOf(value, typeGuard) {
|
|
646
|
+
return isUnionType(value) && value.types.every(typeGuard);
|
|
647
|
+
}
|
|
648
|
+
exports.isUnionTypeOf = isUnionTypeOf;
|
|
649
|
+
function isIntersectionTypeOf(value, typeGuard) {
|
|
650
|
+
return isIntersectionType(value) && value.types.some(typeGuard);
|
|
651
|
+
}
|
|
652
|
+
exports.isIntersectionTypeOf = isIntersectionTypeOf;
|
|
653
|
+
function isCompoundTypeOf(value, typeGuard) {
|
|
654
|
+
return isTypeStatementTypeOf(value, typeGuard) ||
|
|
655
|
+
isUnionTypeOf(value, typeGuard) ||
|
|
656
|
+
isIntersectionTypeOf(value, typeGuard);
|
|
657
|
+
}
|
|
658
|
+
exports.isCompoundTypeOf = isCompoundTypeOf;
|
|
659
|
+
function isCompoundType(value) {
|
|
660
|
+
return isUnionType(value) || isIntersectionType(value);
|
|
661
|
+
}
|
|
662
|
+
exports.isCompoundType = isCompoundType;
|
|
663
|
+
function isIterableType(value) {
|
|
664
|
+
if (isDynamicType(value) || isObjectType(value)) {
|
|
665
|
+
return true;
|
|
666
|
+
}
|
|
667
|
+
if (isArrayTypeLike(value) || isAssociativeArrayTypeLike(value)) {
|
|
668
|
+
return true;
|
|
669
|
+
}
|
|
670
|
+
if (isBuiltInType(value, 'roByteArray') || isBuiltInType(value, 'roList') || isBuiltInType(value, 'roXMLList') || isBuiltInType(value, 'roMessagePort')) {
|
|
671
|
+
return true;
|
|
672
|
+
}
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
exports.isIterableType = isIterableType;
|
|
336
676
|
// Literal reflection
|
|
337
|
-
function isLiteralInvalid(
|
|
338
|
-
return isLiteralExpression(
|
|
677
|
+
function isLiteralInvalid(value) {
|
|
678
|
+
return isLiteralExpression(value) && value.tokens.value.kind === TokenKind_1.TokenKind.Invalid;
|
|
339
679
|
}
|
|
340
680
|
exports.isLiteralInvalid = isLiteralInvalid;
|
|
341
|
-
function isLiteralBoolean(
|
|
342
|
-
return isLiteralExpression(
|
|
681
|
+
function isLiteralBoolean(value) {
|
|
682
|
+
return isLiteralExpression(value) && isBooleanType(value.getType());
|
|
343
683
|
}
|
|
344
684
|
exports.isLiteralBoolean = isLiteralBoolean;
|
|
345
|
-
function isLiteralString(
|
|
346
|
-
return isLiteralExpression(
|
|
685
|
+
function isLiteralString(value) {
|
|
686
|
+
return isLiteralExpression(value) && isStringType(value.getType());
|
|
347
687
|
}
|
|
348
688
|
exports.isLiteralString = isLiteralString;
|
|
349
|
-
function isLiteralNumber(
|
|
350
|
-
return isLiteralExpression(
|
|
689
|
+
function isLiteralNumber(value) {
|
|
690
|
+
return isLiteralExpression(value) && isNumberType(value.getType());
|
|
351
691
|
}
|
|
352
692
|
exports.isLiteralNumber = isLiteralNumber;
|
|
353
|
-
function
|
|
354
|
-
return (
|
|
693
|
+
function isLiteralInteger(value) {
|
|
694
|
+
return isLiteralExpression(value) && isIntegerType(value.getType());
|
|
695
|
+
}
|
|
696
|
+
exports.isLiteralInteger = isLiteralInteger;
|
|
697
|
+
function isLiteralLongInteger(value) {
|
|
698
|
+
return isLiteralExpression(value) && isLongIntegerType(value.getType());
|
|
699
|
+
}
|
|
700
|
+
exports.isLiteralLongInteger = isLiteralLongInteger;
|
|
701
|
+
function isLiteralFloat(value) {
|
|
702
|
+
return isLiteralExpression(value) && isFloatType(value.getType());
|
|
703
|
+
}
|
|
704
|
+
exports.isLiteralFloat = isLiteralFloat;
|
|
705
|
+
function isLiteralDouble(value) {
|
|
706
|
+
return isLiteralExpression(value) && isDoubleType(value.getType());
|
|
355
707
|
}
|
|
356
|
-
exports.
|
|
357
|
-
|
|
358
|
-
|
|
708
|
+
exports.isLiteralDouble = isLiteralDouble;
|
|
709
|
+
// Diagnostics
|
|
710
|
+
function isBsDiagnostic(value) {
|
|
711
|
+
return value.message;
|
|
359
712
|
}
|
|
360
|
-
exports.
|
|
713
|
+
exports.isBsDiagnostic = isBsDiagnostic;
|
|
361
714
|
//# sourceMappingURL=reflection.js.map
|