brighterscript 1.0.0-alpha.23 → 1.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +585 -218
- package/README.md +45 -139
- package/bsconfig.schema.json +41 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +39 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +79 -15
- package/dist/DiagnosticMessages.js +134 -21
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +23 -11
- package/dist/LanguageServer.js +222 -87
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +162 -81
- package/dist/Program.js +903 -732
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +132 -104
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +95 -134
- package/dist/Scope.js +477 -551
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +95 -29
- package/dist/SymbolTable.js +256 -102
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +4 -6
- package/dist/XmlScope.js +74 -68
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +68 -64
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +26 -16
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +132 -100
- package/dist/astUtils/reflection.js +225 -166
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +208 -126
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +54 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +178 -33
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +12 -2
- package/dist/bscPlugin/BscPlugin.js +41 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +21 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +86 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +57 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +544 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +17 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +188 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +513 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +3 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +102 -29
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +167 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +16 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +123 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +22 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +316 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +264 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +56 -8
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -116
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2454 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +107 -8
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +529 -486
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +124 -112
- package/dist/files/BrsFile.js +819 -1131
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1869 -1277
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +70 -32
- package/dist/files/XmlFile.js +106 -117
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +49 -41
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +104 -40
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -18
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +440 -150
- package/dist/interfaces.js +27 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +187 -134
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +9 -0
- package/dist/lexer/TokenKind.js +30 -5
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +126 -167
- package/dist/parser/Expression.js +524 -394
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +152 -146
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +45 -196
- package/dist/parser/Parser.js +470 -926
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1034 -805
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +208 -122
- package/dist/parser/Statement.js +599 -364
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -21
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +61 -20
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +67 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +123 -81
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +221 -81
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +287 -105
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +111 -300
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +107 -90
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +3 -3
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +15 -11
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +6544 -10519
- package/dist/roku-types/index.d.ts +662 -1934
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +164 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +10 -5
- package/dist/types/DynamicType.js +16 -4
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +9 -8
- package/dist/types/ObjectType.js +21 -11
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +167 -131
- package/dist/util.js +890 -350
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +7 -25
- package/dist/validators/ClassValidator.js +103 -194
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -149
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +0 -8
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +0 -40
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
package/dist/parser/Parser.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { Token
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import type { Expression } from './Expression';
|
|
6
|
-
import { AALiteralExpression, AnnotationExpression, FunctionExpression, NewExpression } from './Expression';
|
|
7
|
-
import type { Diagnostic, Position } from 'vscode-languageserver';
|
|
1
|
+
import type { Token } from '../lexer/Token';
|
|
2
|
+
import { Body } from './Statement';
|
|
3
|
+
import { AnnotationExpression } from './Expression';
|
|
4
|
+
import type { Diagnostic } from 'vscode-languageserver';
|
|
8
5
|
import { Logger } from '../Logger';
|
|
6
|
+
import type { Statement } from './AstNode';
|
|
9
7
|
import { SymbolTable } from '../SymbolTable';
|
|
10
|
-
import type { BscType } from '../types/BscType';
|
|
11
8
|
export declare class Parser {
|
|
12
9
|
/**
|
|
13
10
|
* The array of tokens passed to `parse()`
|
|
@@ -22,21 +19,10 @@ export declare class Parser {
|
|
|
22
19
|
*/
|
|
23
20
|
ast: Body;
|
|
24
21
|
get statements(): Statement[];
|
|
25
|
-
symbolTable: SymbolTable;
|
|
26
|
-
private get currentSymbolTable();
|
|
27
22
|
/**
|
|
28
|
-
*
|
|
29
|
-
* These are initially extracted during parse-time to improve performance, but will also be dynamically regenerated if need be.
|
|
30
|
-
*
|
|
31
|
-
* If a plugin modifies the AST, then the plugin should call Parser#invalidateReferences() to force this object to refresh
|
|
32
|
-
*/
|
|
33
|
-
get references(): References;
|
|
34
|
-
private _references;
|
|
35
|
-
/**
|
|
36
|
-
* Invalidates (clears) the references collection. This should be called anytime the AST has been manipulated.
|
|
23
|
+
* The top-level symbol table for the body of this file.
|
|
37
24
|
*/
|
|
38
|
-
|
|
39
|
-
private addPropertyHints;
|
|
25
|
+
get symbolTable(): SymbolTable;
|
|
40
26
|
/**
|
|
41
27
|
* The list of diagnostics found during the parse process
|
|
42
28
|
*/
|
|
@@ -50,18 +36,6 @@ export declare class Parser {
|
|
|
50
36
|
*/
|
|
51
37
|
options: ParseOptions;
|
|
52
38
|
private globalTerminators;
|
|
53
|
-
/**
|
|
54
|
-
* When a namespace has been started, this gets set. When it's done, this gets unset.
|
|
55
|
-
* It is useful for passing the namespace into certain statements that need it
|
|
56
|
-
*/
|
|
57
|
-
private currentNamespace;
|
|
58
|
-
private get currentNamespaceName();
|
|
59
|
-
/**
|
|
60
|
-
* When a FunctionExpression has been started, this gets set. When it's done, this gets unset.
|
|
61
|
-
* It's useful for passing the function into statements and expressions that need to be located
|
|
62
|
-
* by function later on.
|
|
63
|
-
*/
|
|
64
|
-
private currentFunctionExpression;
|
|
65
39
|
/**
|
|
66
40
|
* A list of identifiers that are permitted to be used as local variables. We store this in a property because we augment the list in the constructor
|
|
67
41
|
* based on the parse mode
|
|
@@ -84,7 +58,7 @@ export declare class Parser {
|
|
|
84
58
|
* @param toParse the array of tokens to parse. May not contain any whitespace tokens
|
|
85
59
|
* @returns the same instance of the parser which contains the diagnostics and statements
|
|
86
60
|
*/
|
|
87
|
-
parse(
|
|
61
|
+
parse(toParse: Token[] | string, options?: ParseOptions): this;
|
|
88
62
|
private logger;
|
|
89
63
|
private body;
|
|
90
64
|
private sanitizeParseOptions;
|
|
@@ -108,9 +82,14 @@ export declare class Parser {
|
|
|
108
82
|
private identifier;
|
|
109
83
|
private enumMemberStatement;
|
|
110
84
|
/**
|
|
111
|
-
* Create a new
|
|
85
|
+
* Create a new InterfaceMethodStatement. This should only be called from within `interfaceDeclaration`
|
|
112
86
|
*/
|
|
113
87
|
private interfaceFieldStatement;
|
|
88
|
+
private consumeAsTokenAndTypeExpression;
|
|
89
|
+
/**
|
|
90
|
+
* Create a new InterfaceMethodStatement. This should only be called from within `interfaceDeclaration()`
|
|
91
|
+
*/
|
|
92
|
+
private interfaceMethodStatement;
|
|
114
93
|
private interfaceDeclaration;
|
|
115
94
|
private enumDeclaration;
|
|
116
95
|
/**
|
|
@@ -122,7 +101,6 @@ export declare class Parser {
|
|
|
122
101
|
* An array of CallExpression for the current function body
|
|
123
102
|
*/
|
|
124
103
|
private callExpressions;
|
|
125
|
-
private functionStatement;
|
|
126
104
|
private functionDeclaration;
|
|
127
105
|
private functionParameter;
|
|
128
106
|
private assignment;
|
|
@@ -138,17 +116,18 @@ export declare class Parser {
|
|
|
138
116
|
/**
|
|
139
117
|
* Get an expression with identifiers separated by periods. Useful for namespaces and class extends
|
|
140
118
|
*/
|
|
141
|
-
private
|
|
119
|
+
private identifyingExpression;
|
|
142
120
|
/**
|
|
143
121
|
* Add an 'unexpected token' diagnostic for any token found between current and the first stopToken found.
|
|
144
122
|
*/
|
|
145
123
|
private flagUntil;
|
|
146
124
|
/**
|
|
147
125
|
* Consume tokens until one of the `stopTokenKinds` is encountered
|
|
148
|
-
* @param tokenKinds
|
|
149
|
-
* @
|
|
126
|
+
* @param stopTokenKinds a list of tokenKinds where any tokenKind in this list will result in a match
|
|
127
|
+
* @returns - the list of tokens consumed, EXCLUDING the `stopTokenKind` (you can use `this.peek()` to see which one it was)
|
|
150
128
|
*/
|
|
151
129
|
private consumeUntil;
|
|
130
|
+
private constDeclaration;
|
|
152
131
|
private libraryStatement;
|
|
153
132
|
private importStatement;
|
|
154
133
|
private annotationExpression;
|
|
@@ -177,6 +156,10 @@ export declare class Parser {
|
|
|
177
156
|
* @returns an AST representation of an `label` statement.
|
|
178
157
|
*/
|
|
179
158
|
private labelStatement;
|
|
159
|
+
/**
|
|
160
|
+
* Parses a `continue` statement
|
|
161
|
+
*/
|
|
162
|
+
private continueStatement;
|
|
180
163
|
/**
|
|
181
164
|
* Parses a `goto` statement
|
|
182
165
|
* @returns an AST representation of an `goto` statement.
|
|
@@ -210,7 +193,6 @@ export declare class Parser {
|
|
|
210
193
|
private anonymousFunction;
|
|
211
194
|
private boolean;
|
|
212
195
|
private relational;
|
|
213
|
-
private addExpressionsToReferences;
|
|
214
196
|
private additive;
|
|
215
197
|
private multiplicative;
|
|
216
198
|
private exponential;
|
|
@@ -224,11 +206,17 @@ export declare class Parser {
|
|
|
224
206
|
private call;
|
|
225
207
|
private finishCall;
|
|
226
208
|
/**
|
|
227
|
-
*
|
|
228
|
-
* Allows for built-in types (double, string, etc.) or namespaced custom types in Brighterscript mode
|
|
229
|
-
* Will return a token of whatever is next to be parsed (unless `advanceIfUnknown` is false, in which case undefined will be returned instead
|
|
209
|
+
* Creates a TypeExpression, which wraps standard ASTNodes that represent a BscType
|
|
230
210
|
*/
|
|
231
211
|
private typeExpression;
|
|
212
|
+
/**
|
|
213
|
+
* Gets a single "part" of a type of a potential Union type
|
|
214
|
+
* Note: this does not NEED to be part of a union type, but the logic is the same
|
|
215
|
+
*
|
|
216
|
+
* @param changedTokens an array that is modified with any tokens that have been changed from their default kind to identifiers - eg. when a keyword is used as type
|
|
217
|
+
* @returns an expression that was successfully parsed
|
|
218
|
+
*/
|
|
219
|
+
private getTypeExpressionPart;
|
|
232
220
|
private primary;
|
|
233
221
|
private arrayLiteral;
|
|
234
222
|
private aaLiteral;
|
|
@@ -238,18 +226,22 @@ export declare class Parser {
|
|
|
238
226
|
private match;
|
|
239
227
|
/**
|
|
240
228
|
* Pop token if we encounter a token in the specified list
|
|
241
|
-
* @param tokenKinds
|
|
229
|
+
* @param tokenKinds a list of tokenKinds where any tokenKind in this list will result in a match
|
|
242
230
|
*/
|
|
243
231
|
private matchAny;
|
|
244
232
|
/**
|
|
245
233
|
* If the next series of tokens matches the given set of tokens, pop them all
|
|
246
|
-
* @param tokenKinds
|
|
234
|
+
* @param tokenKinds a list of tokenKinds used to match the next set of tokens
|
|
247
235
|
*/
|
|
248
236
|
private matchSequence;
|
|
249
237
|
/**
|
|
250
238
|
* Get next token matching a specified list, or fail with an error
|
|
251
239
|
*/
|
|
252
240
|
private consume;
|
|
241
|
+
/**
|
|
242
|
+
* Consume next token IF it matches the specified kind. Otherwise, do nothing and return undefined
|
|
243
|
+
*/
|
|
244
|
+
private consumeTokenIf;
|
|
253
245
|
private consumeToken;
|
|
254
246
|
/**
|
|
255
247
|
* Consume, or add a message if not found. But then continue and return undefined
|
|
@@ -268,6 +260,14 @@ export declare class Parser {
|
|
|
268
260
|
private peekNext;
|
|
269
261
|
private peek;
|
|
270
262
|
private previous;
|
|
263
|
+
/**
|
|
264
|
+
* Sometimes we catch an error that is a diagnostic.
|
|
265
|
+
* If that's the case, we want to continue parsing.
|
|
266
|
+
* Otherwise, re-throw the error
|
|
267
|
+
*
|
|
268
|
+
* @param error error caught in a try/catch
|
|
269
|
+
*/
|
|
270
|
+
private rethrowNonDiagnosticError;
|
|
271
271
|
/**
|
|
272
272
|
* Get the token that is {offset} indexes away from {this.current}
|
|
273
273
|
* @param offset the number of index steps away from current index to fetch
|
|
@@ -279,51 +279,6 @@ export declare class Parser {
|
|
|
279
279
|
*/
|
|
280
280
|
private getMatchingTokenAtOffset;
|
|
281
281
|
private synchronize;
|
|
282
|
-
/**
|
|
283
|
-
* Get the token at the specified position
|
|
284
|
-
* @param position
|
|
285
|
-
*/
|
|
286
|
-
getTokenAt(position: Position): Token;
|
|
287
|
-
/**
|
|
288
|
-
* Get the token closest to the position. if no token is found, the previous token is returned
|
|
289
|
-
* @param position
|
|
290
|
-
* @param tokens
|
|
291
|
-
*/
|
|
292
|
-
getClosestToken(position: Position): Token;
|
|
293
|
-
isPositionNextToTokenKind(position: Position, tokenKind: TokenKind): boolean;
|
|
294
|
-
getTokenBefore(currentToken: Token, tokenKind: TokenKind): Token;
|
|
295
|
-
tokenFollows(currentToken: Token, tokenKind: TokenKind): boolean;
|
|
296
|
-
getTokensUntil(currentToken: Token, tokenKind: TokenKind, direction?: -1 | 1): any[];
|
|
297
|
-
getPreviousToken(token: Token): Token;
|
|
298
|
-
getPreviousTokenFromIndex(idx: number): TokenWithIndex;
|
|
299
|
-
getPreviousTokenIgnoreNests(currentTokenIndex: number, leftBracketType: TokenKind, rightBracketType: TokenKind): TokenWithIndex;
|
|
300
|
-
/**
|
|
301
|
-
* Finds the previous token in a chain (e.g. 'm.obj.func(someFunc()).value'), skipping over any arguments of function calls
|
|
302
|
-
* If this function was called with the token at 'value' above, the previous identifier in the chain is 'func'
|
|
303
|
-
* @param currentTokenIndex token index to start from
|
|
304
|
-
* @param allowCurrent can the current token be the token that's the identifier?
|
|
305
|
-
* @returns the previous identifer
|
|
306
|
-
*/
|
|
307
|
-
getPreviousTokenInChain(currentTokenIndex: number, allowCurrent?: boolean): TokenChainMember;
|
|
308
|
-
private isAcceptableChainToken;
|
|
309
|
-
/**
|
|
310
|
-
* Builds up a chain of tokens, starting with the first in the chain, and ending with currentToken
|
|
311
|
-
* e.g. m.prop.method().field (with 'field' as currentToken) -> ["m", "prop", "method", "field"], with each element as a token
|
|
312
|
-
* @param currentToken the token that is the end of the chain
|
|
313
|
-
* @returns array of tokens
|
|
314
|
-
*/
|
|
315
|
-
getTokenChain(currentToken: Token): TokenChain;
|
|
316
|
-
/**
|
|
317
|
-
* References are found during the initial parse.
|
|
318
|
-
* However, sometimes plugins can modify the AST, requiring a full walk to re-compute all references.
|
|
319
|
-
* This does that walk.
|
|
320
|
-
*/
|
|
321
|
-
private findReferences;
|
|
322
|
-
getContainingClass(currentToken: Token): ClassStatement;
|
|
323
|
-
getContainingAA(currentToken: Token): AALiteralExpression;
|
|
324
|
-
getContainingNamespace(currentToken: Token): NamespaceStatement;
|
|
325
|
-
getContainingFunctionExpression(currentToken: Token): FunctionExpression;
|
|
326
|
-
getContainingFunctionExpressionByPosition(position: Position): FunctionExpression;
|
|
327
282
|
dispose(): void;
|
|
328
283
|
}
|
|
329
284
|
export declare enum ParseMode {
|
|
@@ -340,109 +295,3 @@ export interface ParseOptions {
|
|
|
340
295
|
*/
|
|
341
296
|
logger?: Logger;
|
|
342
297
|
}
|
|
343
|
-
export declare class References {
|
|
344
|
-
private cache;
|
|
345
|
-
assignmentStatements: AssignmentStatement[];
|
|
346
|
-
classStatements: ClassStatement[];
|
|
347
|
-
dottedSetStatements: DottedSetStatement[];
|
|
348
|
-
aaLiterals: AALiteralExpression[];
|
|
349
|
-
get classStatementLookup(): Map<string, ClassStatement>;
|
|
350
|
-
private _classStatementLookup;
|
|
351
|
-
functionExpressions: FunctionExpression[];
|
|
352
|
-
functionStatements: FunctionStatement[];
|
|
353
|
-
/**
|
|
354
|
-
* A map of function statements, indexed by fully-namespaced lower function name.
|
|
355
|
-
*/
|
|
356
|
-
get functionStatementLookup(): Map<string, FunctionStatement>;
|
|
357
|
-
private _functionStatementLookup;
|
|
358
|
-
interfaceStatements: InterfaceStatement[];
|
|
359
|
-
get interfaceStatementLookup(): Map<string, InterfaceStatement>;
|
|
360
|
-
private _interfaceStatementLookup;
|
|
361
|
-
enumStatements: EnumStatement[];
|
|
362
|
-
get enumStatementLookup(): Map<string, EnumStatement>;
|
|
363
|
-
/**
|
|
364
|
-
* A collection of full expressions. This excludes intermediary expressions.
|
|
365
|
-
*
|
|
366
|
-
* Example 1:
|
|
367
|
-
* `a.b.c` is composed of `a` (variableExpression) `.b` (DottedGetExpression) `.c` (DottedGetExpression)
|
|
368
|
-
* This will only contain the final `.c` DottedGetExpression because `.b` and `a` can both be derived by walking back from the `.c` DottedGetExpression.
|
|
369
|
-
*
|
|
370
|
-
* Example 2:
|
|
371
|
-
* `name.space.doSomething(a.b.c)` will result in 2 entries in this list. the `CallExpression` for `doSomething`, and the `.c` DottedGetExpression.
|
|
372
|
-
*
|
|
373
|
-
* Example 3:
|
|
374
|
-
* `value = SomeEnum.value > 2 or SomeEnum.otherValue < 10` will result in 4 entries. `SomeEnum.value`, `2`, `SomeEnum.otherValue`, `10`
|
|
375
|
-
*/
|
|
376
|
-
expressions: Set<Expression>;
|
|
377
|
-
importStatements: ImportStatement[];
|
|
378
|
-
libraryStatements: LibraryStatement[];
|
|
379
|
-
namespaceStatements: NamespaceStatement[];
|
|
380
|
-
newExpressions: NewExpression[];
|
|
381
|
-
propertyHints: Record<string, string>;
|
|
382
|
-
}
|
|
383
|
-
export interface LocalVarEntry {
|
|
384
|
-
lowerName: string;
|
|
385
|
-
nameToken: Identifier;
|
|
386
|
-
type: BscType;
|
|
387
|
-
}
|
|
388
|
-
export declare enum TokenUsage {
|
|
389
|
-
Direct = 1,
|
|
390
|
-
Call = 2,
|
|
391
|
-
ArrayReference = 3
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* A member of a token chain - a wrapper around a token, which also gives some context for how it is used, and if the type is knowable
|
|
395
|
-
*/
|
|
396
|
-
export interface TokenChainMember {
|
|
397
|
-
/**
|
|
398
|
-
* The token
|
|
399
|
-
*/
|
|
400
|
-
token: Token;
|
|
401
|
-
/**
|
|
402
|
-
* Is it impossible to know the the type of this token (for now)
|
|
403
|
-
*/
|
|
404
|
-
tokenTypeIsNotKnowable?: boolean;
|
|
405
|
-
/**
|
|
406
|
-
* How was this token used?
|
|
407
|
-
*/
|
|
408
|
-
usage: TokenUsage;
|
|
409
|
-
/**
|
|
410
|
-
* Index of the token in the parser's token list
|
|
411
|
-
*/
|
|
412
|
-
index: number;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* A token paired with the index it is at in the file
|
|
416
|
-
* Used for when we need to get a token, but may also need the previous or next token
|
|
417
|
-
* This way, we can access the adjacent tokens via their index instead of search
|
|
418
|
-
*/
|
|
419
|
-
export interface TokenWithIndex {
|
|
420
|
-
/**
|
|
421
|
-
* The token
|
|
422
|
-
*/
|
|
423
|
-
token: Token;
|
|
424
|
-
/**
|
|
425
|
-
* Index of the token in the parser's token list
|
|
426
|
-
*/
|
|
427
|
-
index: number;
|
|
428
|
-
/**
|
|
429
|
-
* Is it impossible to know the the type of this token (for now)
|
|
430
|
-
*/
|
|
431
|
-
tokenTypeIsNotKnowable?: boolean;
|
|
432
|
-
/**
|
|
433
|
-
* does this token have brackets (either parens or square brackets) after it
|
|
434
|
-
*/
|
|
435
|
-
hasBrackets?: boolean;
|
|
436
|
-
}
|
|
437
|
-
export interface TokenChain {
|
|
438
|
-
chain: TokenChainMember[];
|
|
439
|
-
includesUnknowableTokenType?: boolean;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Gets the type of an expression. If it can not be processed, will return DynamicType
|
|
443
|
-
*
|
|
444
|
-
* @param expression the Expression to process
|
|
445
|
-
* @param functionExpression the wrapping function expression
|
|
446
|
-
* @return the best guess type of that expression
|
|
447
|
-
*/
|
|
448
|
-
export declare function getBscTypeFromExpression(expression: Expression, functionExpression: FunctionExpression): BscType;
|