brighterscript 1.0.0-alpha.23 → 1.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +585 -218
- package/README.md +45 -139
- package/bsconfig.schema.json +41 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +39 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +79 -15
- package/dist/DiagnosticMessages.js +134 -21
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +23 -11
- package/dist/LanguageServer.js +222 -87
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +162 -81
- package/dist/Program.js +903 -732
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +132 -104
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +95 -134
- package/dist/Scope.js +477 -551
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +95 -29
- package/dist/SymbolTable.js +256 -102
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +4 -6
- package/dist/XmlScope.js +74 -68
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +68 -64
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +26 -16
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +132 -100
- package/dist/astUtils/reflection.js +225 -166
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +208 -126
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +54 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +178 -33
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +12 -2
- package/dist/bscPlugin/BscPlugin.js +41 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +21 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +86 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +57 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +544 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +17 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +188 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +513 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +3 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +102 -29
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +167 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +16 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +123 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +22 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +316 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +264 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +56 -8
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -116
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2454 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +107 -8
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +529 -486
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +124 -112
- package/dist/files/BrsFile.js +819 -1131
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1869 -1277
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +70 -32
- package/dist/files/XmlFile.js +106 -117
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +49 -41
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +104 -40
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -18
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +440 -150
- package/dist/interfaces.js +27 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +187 -134
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +9 -0
- package/dist/lexer/TokenKind.js +30 -5
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +126 -167
- package/dist/parser/Expression.js +524 -394
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +152 -146
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +45 -196
- package/dist/parser/Parser.js +470 -926
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1034 -805
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +208 -122
- package/dist/parser/Statement.js +599 -364
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -21
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +61 -20
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +67 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +123 -81
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +221 -81
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +287 -105
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +111 -300
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +107 -90
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +3 -3
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +15 -11
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +6544 -10519
- package/dist/roku-types/index.d.ts +662 -1934
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +164 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +10 -5
- package/dist/types/DynamicType.js +16 -4
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +9 -8
- package/dist/types/ObjectType.js +21 -11
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +167 -131
- package/dist/util.js +890 -350
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +7 -25
- package/dist/validators/ClassValidator.js +103 -194
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -149
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +0 -8
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +0 -40
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TypedArrayExpression = exports.TypeCastExpression = exports.TypeExpression = exports.RegexLiteralExpression = exports.NullCoalescingExpression = exports.TernaryExpression = exports.AnnotationExpression = exports.TaggedTemplateStringExpression = exports.TemplateStringExpression = exports.TemplateStringQuasiExpression = exports.CallfuncExpression = exports.NewExpression = exports.SourceLiteralExpression = exports.VariableExpression = exports.UnaryExpression = exports.AALiteralExpression = exports.AAMemberExpression = exports.ArrayLiteralExpression = exports.EscapedCharCodeLiteralExpression = exports.LiteralExpression = exports.GroupingExpression = exports.IndexedGetExpression = exports.XmlAttributeGetExpression = exports.DottedGetExpression = exports.FunctionParameterExpression = exports.FunctionExpression = exports.CallExpression = exports.BinaryExpression = void 0;
|
|
4
4
|
const TokenKind_1 = require("../lexer/TokenKind");
|
|
5
5
|
const util_1 = require("../util");
|
|
6
6
|
const Parser_1 = require("./Parser");
|
|
7
7
|
const fileUrl = require("file-url");
|
|
8
8
|
const visitors_1 = require("../astUtils/visitors");
|
|
9
|
+
const visitors_2 = require("../astUtils/visitors");
|
|
9
10
|
const reflection_1 = require("../astUtils/reflection");
|
|
10
|
-
const
|
|
11
|
-
const DynamicType_1 = require("../types/DynamicType");
|
|
11
|
+
const interfaces_1 = require("../interfaces");
|
|
12
12
|
const SymbolTable_1 = require("../SymbolTable");
|
|
13
13
|
const TypedFunctionType_1 = require("../types/TypedFunctionType");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class BinaryExpression extends Expression {
|
|
14
|
+
const AstNode_1 = require("./AstNode");
|
|
15
|
+
const SymbolTable_2 = require("../SymbolTable");
|
|
16
|
+
const source_map_1 = require("source-map");
|
|
17
|
+
const StringType_1 = require("../types/StringType");
|
|
18
|
+
const DynamicType_1 = require("../types/DynamicType");
|
|
19
|
+
const VoidType_1 = require("../types/VoidType");
|
|
20
|
+
const ReferenceType_1 = require("../types/ReferenceType");
|
|
21
|
+
const UnionType_1 = require("../types/UnionType");
|
|
22
|
+
const types_1 = require("../types");
|
|
23
|
+
const AssociativeArrayType_1 = require("../types/AssociativeArrayType");
|
|
24
|
+
const creators_1 = require("../astUtils/creators");
|
|
25
|
+
class BinaryExpression extends AstNode_1.Expression {
|
|
27
26
|
constructor(left, operator, right) {
|
|
28
27
|
super();
|
|
29
28
|
this.left = left;
|
|
30
29
|
this.operator = operator;
|
|
31
30
|
this.right = right;
|
|
32
|
-
this.
|
|
31
|
+
this.kind = AstNode_1.AstNodeKind.BinaryExpression;
|
|
32
|
+
this.range = util_1.default.createRangeFromPositions(this.left.range.start, this.right.range.end);
|
|
33
33
|
}
|
|
34
34
|
transpile(state) {
|
|
35
35
|
return [
|
|
@@ -41,30 +41,41 @@ class BinaryExpression extends Expression {
|
|
|
41
41
|
];
|
|
42
42
|
}
|
|
43
43
|
walk(visitor, options) {
|
|
44
|
-
if (options.walkMode &
|
|
45
|
-
(0,
|
|
46
|
-
(0,
|
|
44
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
45
|
+
(0, visitors_2.walk)(this, 'left', visitor, options);
|
|
46
|
+
(0, visitors_2.walk)(this, 'right', visitor, options);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
getType(options) {
|
|
50
|
+
const operatorKind = this.operator.kind;
|
|
51
|
+
if (options.flags & SymbolTable_1.SymbolTypeFlag.typetime) {
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
53
|
+
switch (operatorKind) {
|
|
54
|
+
case TokenKind_1.TokenKind.Or:
|
|
55
|
+
return new UnionType_1.UnionType([this.left.getType(options), this.right.getType(options)]);
|
|
56
|
+
//TODO: Intersection Types?, eg. case TokenKind.And:
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (options.flags & SymbolTable_1.SymbolTypeFlag.runtime) {
|
|
60
|
+
return util_1.default.binaryOperatorResultType(this.left.getType(options), this.operator, this.right.getType(options));
|
|
47
61
|
}
|
|
62
|
+
return DynamicType_1.DynamicType.instance;
|
|
48
63
|
}
|
|
49
64
|
}
|
|
50
65
|
exports.BinaryExpression = BinaryExpression;
|
|
51
|
-
class CallExpression extends Expression {
|
|
66
|
+
class CallExpression extends AstNode_1.Expression {
|
|
52
67
|
constructor(callee,
|
|
53
68
|
/**
|
|
54
69
|
* Can either be `(`, or `?(` for optional chaining
|
|
55
70
|
*/
|
|
56
|
-
openingParen, closingParen, args,
|
|
57
|
-
/**
|
|
58
|
-
* The namespace that currently wraps this call expression. This is NOT the namespace of the callee...that will be represented in the callee expression itself.
|
|
59
|
-
*/
|
|
60
|
-
namespaceName) {
|
|
71
|
+
openingParen, closingParen, args, unused) {
|
|
61
72
|
super();
|
|
62
73
|
this.callee = callee;
|
|
63
74
|
this.openingParen = openingParen;
|
|
64
75
|
this.closingParen = closingParen;
|
|
65
76
|
this.args = args;
|
|
66
|
-
this.
|
|
67
|
-
this.range = util_1.default.createBoundingRange(this.callee, this.closingParen);
|
|
77
|
+
this.kind = AstNode_1.AstNodeKind.CallExpression;
|
|
78
|
+
this.range = util_1.default.createBoundingRange(this.callee, this.openingParen, ...args, this.closingParen);
|
|
68
79
|
}
|
|
69
80
|
transpile(state, nameOverride) {
|
|
70
81
|
let result = [];
|
|
@@ -84,24 +95,39 @@ class CallExpression extends Expression {
|
|
|
84
95
|
let arg = this.args[i];
|
|
85
96
|
result.push(...arg.transpile(state));
|
|
86
97
|
}
|
|
87
|
-
|
|
98
|
+
if (this.closingParen) {
|
|
99
|
+
result.push(state.transpileToken(this.closingParen));
|
|
100
|
+
}
|
|
88
101
|
return result;
|
|
89
102
|
}
|
|
90
103
|
walk(visitor, options) {
|
|
91
|
-
if (options.walkMode &
|
|
92
|
-
(0,
|
|
93
|
-
(0,
|
|
104
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
105
|
+
(0, visitors_2.walk)(this, 'callee', visitor, options);
|
|
106
|
+
(0, visitors_2.walkArray)(this.args, visitor, options, this);
|
|
94
107
|
}
|
|
95
108
|
}
|
|
109
|
+
getType(options) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const calleeType = this.callee.getType(options);
|
|
112
|
+
if (options.ignoreCall) {
|
|
113
|
+
return calleeType;
|
|
114
|
+
}
|
|
115
|
+
if ((0, reflection_1.isNewExpression)(this.parent)) {
|
|
116
|
+
return calleeType;
|
|
117
|
+
}
|
|
118
|
+
if ((0, reflection_1.isCallableType)(calleeType) && (!(0, reflection_1.isReferenceType)(calleeType.returnType) || ((_a = calleeType.returnType) === null || _a === void 0 ? void 0 : _a.isResolvable()))) {
|
|
119
|
+
return calleeType.returnType;
|
|
120
|
+
}
|
|
121
|
+
if (!(0, reflection_1.isReferenceType)(calleeType) && ((_b = calleeType.returnType) === null || _b === void 0 ? void 0 : _b.isResolvable())) {
|
|
122
|
+
return calleeType.returnType;
|
|
123
|
+
}
|
|
124
|
+
return new ReferenceType_1.TypePropertyReferenceType(calleeType, 'returnType');
|
|
125
|
+
}
|
|
96
126
|
}
|
|
97
127
|
exports.CallExpression = CallExpression;
|
|
98
|
-
CallExpression.MaximumArguments =
|
|
99
|
-
class FunctionExpression extends Expression {
|
|
100
|
-
constructor(parameters, body, functionType, end, leftParen, rightParen, asToken,
|
|
101
|
-
/**
|
|
102
|
-
* If this function is enclosed within another function, this will reference that parent function
|
|
103
|
-
*/
|
|
104
|
-
parentFunction, namespaceName, parentSymbolTable) {
|
|
128
|
+
CallExpression.MaximumArguments = 32;
|
|
129
|
+
class FunctionExpression extends AstNode_1.Expression {
|
|
130
|
+
constructor(parameters, body, functionType, end, leftParen, rightParen, asToken, returnTypeExpression) {
|
|
105
131
|
super();
|
|
106
132
|
this.parameters = parameters;
|
|
107
133
|
this.body = body;
|
|
@@ -110,60 +136,29 @@ class FunctionExpression extends Expression {
|
|
|
110
136
|
this.leftParen = leftParen;
|
|
111
137
|
this.rightParen = rightParen;
|
|
112
138
|
this.asToken = asToken;
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
115
|
-
this.namespaceName = namespaceName;
|
|
116
|
-
this.parentSymbolTable = parentSymbolTable;
|
|
117
|
-
this.labelStatements = [];
|
|
139
|
+
this.returnTypeExpression = returnTypeExpression;
|
|
140
|
+
this.kind = AstNode_1.AstNodeKind.FunctionExpression;
|
|
118
141
|
/**
|
|
119
142
|
* The list of function calls that are declared within this function scope. This excludes CallExpressions
|
|
120
143
|
* declared in child functions
|
|
121
144
|
*/
|
|
122
145
|
this.callExpressions = [];
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.childFunctionExpressions = [];
|
|
127
|
-
if (this.returnType) {
|
|
128
|
-
this._returnType = this.returnType.type;
|
|
146
|
+
//if there's a body, and it doesn't have a SymbolTable, assign one
|
|
147
|
+
if (this.body && !this.body.symbolTable) {
|
|
148
|
+
this.body.symbolTable = new SymbolTable_2.SymbolTable(`Function Body`);
|
|
129
149
|
}
|
|
130
|
-
|
|
131
|
-
this._returnType = new VoidType_1.VoidType();
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
this._returnType = new DynamicType_1.DynamicType();
|
|
135
|
-
}
|
|
136
|
-
this.symbolTable = new SymbolTable_1.SymbolTable(parentSymbolTable);
|
|
137
|
-
for (let param of parameters) {
|
|
138
|
-
this.symbolTable.addSymbol(param.name.text, param.name.range, param.getType());
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
get range() {
|
|
142
|
-
return this.cacheRange();
|
|
150
|
+
this.symbolTable = new SymbolTable_2.SymbolTable('FunctionExpression', () => { var _a; return (_a = this.parent) === null || _a === void 0 ? void 0 : _a.getSymbolTable(); });
|
|
143
151
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
cacheRange() {
|
|
148
|
-
var _a;
|
|
149
|
-
if (!this._range) {
|
|
150
|
-
this._range = util_1.default.createBoundingRange(this.functionType, this.leftParen, ...((_a = this.parameters) !== null && _a !== void 0 ? _a : []), this.rightParen, this.asToken, this.returnType, this.body, this.end);
|
|
151
|
-
}
|
|
152
|
-
return this._range;
|
|
152
|
+
getLeadingTrivia() {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
return (_b = (_a = this.functionType) === null || _a === void 0 ? void 0 : _a.leadingTrivia) !== null && _b !== void 0 ? _b : [];
|
|
153
155
|
}
|
|
154
156
|
/**
|
|
155
|
-
* The
|
|
157
|
+
* The range of the function, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
158
|
+
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
156
159
|
*/
|
|
157
|
-
|
|
158
|
-
return this.
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* The range of the function declaration, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
162
|
-
* and ending with the last character in the returnTypeToken, or the 's' in 'as', or the rightParen
|
|
163
|
-
*/
|
|
164
|
-
get functionDeclarationRange() {
|
|
165
|
-
var _a;
|
|
166
|
-
return util_1.default.createBoundingRange(this.functionType, this.leftParen, ...((_a = this.parameters) !== null && _a !== void 0 ? _a : []), this.rightParen, this.asToken, this.returnType);
|
|
160
|
+
get range() {
|
|
161
|
+
return util_1.default.createBoundingRange(this.functionType, this.leftParen, ...this.parameters, this.rightParen, this.asToken, this.returnTypeExpression, this.end);
|
|
167
162
|
}
|
|
168
163
|
transpile(state, name, includeBody = true) {
|
|
169
164
|
let results = [];
|
|
@@ -188,12 +183,12 @@ class FunctionExpression extends Expression {
|
|
|
188
183
|
//right paren
|
|
189
184
|
results.push(state.transpileToken(this.rightParen));
|
|
190
185
|
//as [Type]
|
|
191
|
-
if (this.asToken) {
|
|
186
|
+
if (this.asToken && !state.options.removeParameterTypes && this.returnTypeExpression) {
|
|
192
187
|
results.push(' ',
|
|
193
188
|
//as
|
|
194
189
|
state.transpileToken(this.asToken), ' ',
|
|
195
190
|
//return type
|
|
196
|
-
|
|
191
|
+
...this.returnTypeExpression.transpile(state));
|
|
197
192
|
}
|
|
198
193
|
if (includeBody) {
|
|
199
194
|
state.lineage.unshift(this);
|
|
@@ -201,52 +196,107 @@ class FunctionExpression extends Expression {
|
|
|
201
196
|
state.lineage.shift();
|
|
202
197
|
results.push(...body);
|
|
203
198
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
results.push(state.indent(), state.transpileToken(this.end));
|
|
208
|
-
}
|
|
199
|
+
results.push('\n');
|
|
200
|
+
//'end sub'|'end function'
|
|
201
|
+
results.push(state.indent(), state.transpileToken(this.end));
|
|
209
202
|
return results;
|
|
210
203
|
}
|
|
211
|
-
getTypedef(state
|
|
212
|
-
|
|
204
|
+
getTypedef(state) {
|
|
205
|
+
var _a, _b, _c, _d, _e;
|
|
206
|
+
let results = [
|
|
207
|
+
new source_map_1.SourceNode(1, 0, null, [
|
|
208
|
+
//'function'|'sub'
|
|
209
|
+
(_a = this.functionType) === null || _a === void 0 ? void 0 : _a.text,
|
|
210
|
+
//functionName?
|
|
211
|
+
...((0, reflection_1.isFunctionStatement)(this.parent) || (0, reflection_1.isMethodStatement)(this.parent) ? [' ', (_c = (_b = this.parent.name) === null || _b === void 0 ? void 0 : _b.text) !== null && _c !== void 0 ? _c : ''] : []),
|
|
212
|
+
//leftParen
|
|
213
|
+
'(',
|
|
214
|
+
//parameters
|
|
215
|
+
...((_e = (_d = this.parameters) === null || _d === void 0 ? void 0 : _d.map((param, i) => ([
|
|
216
|
+
//separating comma
|
|
217
|
+
i > 0 ? ', ' : '',
|
|
218
|
+
...param.getTypedef(state)
|
|
219
|
+
]))) !== null && _e !== void 0 ? _e : []),
|
|
220
|
+
//right paren
|
|
221
|
+
')',
|
|
222
|
+
//as <ReturnType>
|
|
223
|
+
...(this.asToken ? [
|
|
224
|
+
' as ',
|
|
225
|
+
...this.returnTypeExpression.getTypedef(state)
|
|
226
|
+
] : []),
|
|
227
|
+
'\n',
|
|
228
|
+
state.indent(),
|
|
229
|
+
//'end sub'|'end function'
|
|
230
|
+
this.end.text
|
|
231
|
+
])
|
|
232
|
+
];
|
|
233
|
+
return results;
|
|
213
234
|
}
|
|
214
235
|
walk(visitor, options) {
|
|
215
|
-
if (options.walkMode &
|
|
216
|
-
(0,
|
|
236
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
237
|
+
(0, visitors_2.walkArray)(this.parameters, visitor, options, this);
|
|
238
|
+
(0, visitors_2.walk)(this, 'returnTypeExpression', visitor, options);
|
|
217
239
|
//This is the core of full-program walking...it allows us to step into sub functions
|
|
218
|
-
if (options.walkMode &
|
|
219
|
-
(0,
|
|
220
|
-
(0, visitors_1.walk)(this, 'body', visitor, options);
|
|
240
|
+
if (options.walkMode & visitors_2.InternalWalkMode.recurseChildFunctions) {
|
|
241
|
+
(0, visitors_2.walk)(this, 'body', visitor, options);
|
|
221
242
|
}
|
|
222
243
|
}
|
|
223
244
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
245
|
+
getType(options) {
|
|
246
|
+
var _a, _b, _c;
|
|
247
|
+
//if there's a defined return type, use that
|
|
248
|
+
let returnType = (_a = this.returnTypeExpression) === null || _a === void 0 ? void 0 : _a.getType(Object.assign(Object.assign({}, options), { typeChain: undefined }));
|
|
249
|
+
const isSub = this.functionType.kind === TokenKind_1.TokenKind.Sub;
|
|
250
|
+
//if we don't have a return type and this is a sub, set the return type to `void`. else use `dynamic`
|
|
251
|
+
if (!returnType) {
|
|
252
|
+
returnType = isSub ? VoidType_1.VoidType.instance : DynamicType_1.DynamicType.instance;
|
|
253
|
+
}
|
|
254
|
+
const resultType = new TypedFunctionType_1.TypedFunctionType(returnType);
|
|
255
|
+
resultType.isSub = isSub;
|
|
227
256
|
for (let param of this.parameters) {
|
|
228
|
-
|
|
257
|
+
resultType.addParameter(param.name.text, param.getType(Object.assign(Object.assign({}, options), { typeChain: undefined })), !!param.defaultValue);
|
|
258
|
+
}
|
|
259
|
+
// Figure out this function's name if we can
|
|
260
|
+
let funcName = '';
|
|
261
|
+
if ((0, reflection_1.isMethodStatement)(this.parent) || (0, reflection_1.isInterfaceMethodStatement)(this.parent)) {
|
|
262
|
+
funcName = this.parent.getName(Parser_1.ParseMode.BrighterScript);
|
|
263
|
+
if (options.typeChain) {
|
|
264
|
+
// Get the typechain info from the parent class
|
|
265
|
+
(_b = this.parent.parent) === null || _b === void 0 ? void 0 : _b.getType(options);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if ((0, reflection_1.isFunctionStatement)(this.parent)) {
|
|
269
|
+
funcName = this.parent.getName(Parser_1.ParseMode.BrighterScript);
|
|
270
|
+
}
|
|
271
|
+
if (funcName) {
|
|
272
|
+
resultType.setName(funcName);
|
|
229
273
|
}
|
|
230
|
-
|
|
274
|
+
(_c = options.typeChain) === null || _c === void 0 ? void 0 : _c.push(new interfaces_1.TypeChainEntry(funcName, resultType, options.data, this.range));
|
|
275
|
+
return resultType;
|
|
231
276
|
}
|
|
232
277
|
}
|
|
233
278
|
exports.FunctionExpression = FunctionExpression;
|
|
234
|
-
class FunctionParameterExpression extends Expression {
|
|
235
|
-
constructor(name,
|
|
279
|
+
class FunctionParameterExpression extends AstNode_1.Expression {
|
|
280
|
+
constructor(name, equalToken, defaultValue, asToken, typeExpression) {
|
|
236
281
|
super();
|
|
237
282
|
this.name = name;
|
|
238
|
-
this.
|
|
239
|
-
this.equalsToken = equalsToken;
|
|
283
|
+
this.equalToken = equalToken;
|
|
240
284
|
this.defaultValue = defaultValue;
|
|
241
285
|
this.asToken = asToken;
|
|
242
|
-
this.
|
|
243
|
-
this.
|
|
244
|
-
this.range = util_1.default.createBoundingRange(this.name, this.equalsToken, this.defaultValue, this.asToken, this.type);
|
|
286
|
+
this.typeExpression = typeExpression;
|
|
287
|
+
this.kind = AstNode_1.AstNodeKind.FunctionParameterExpression;
|
|
245
288
|
}
|
|
246
|
-
getType() {
|
|
247
|
-
|
|
289
|
+
getType(options) {
|
|
290
|
+
var _a, _b, _c, _d, _e;
|
|
291
|
+
const paramType = (_d = (_b = (_a = this.typeExpression) === null || _a === void 0 ? void 0 : _a.getType(Object.assign(Object.assign({}, options), { flags: SymbolTable_1.SymbolTypeFlag.typetime, typeChain: undefined }))) !== null && _b !== void 0 ? _b : (_c = this.defaultValue) === null || _c === void 0 ? void 0 : _c.getType(Object.assign(Object.assign({}, options), { flags: SymbolTable_1.SymbolTypeFlag.runtime, typeChain: undefined }))) !== null && _d !== void 0 ? _d : DynamicType_1.DynamicType.instance;
|
|
292
|
+
(_e = options.typeChain) === null || _e === void 0 ? void 0 : _e.push(new interfaces_1.TypeChainEntry(this.name.text, paramType, options.data, this.range));
|
|
293
|
+
return paramType;
|
|
294
|
+
}
|
|
295
|
+
get range() {
|
|
296
|
+
return util_1.default.createBoundingRange(this.name, this.asToken, this.typeExpression, this.defaultValue);
|
|
248
297
|
}
|
|
249
298
|
transpile(state) {
|
|
299
|
+
var _a, _b;
|
|
250
300
|
let result = [
|
|
251
301
|
//name
|
|
252
302
|
state.transpileToken(this.name)
|
|
@@ -257,70 +307,41 @@ class FunctionParameterExpression extends Expression {
|
|
|
257
307
|
result.push(this.defaultValue.transpile(state));
|
|
258
308
|
}
|
|
259
309
|
//type declaration
|
|
260
|
-
if (this.asToken) {
|
|
310
|
+
if (this.asToken && !state.options.removeParameterTypes) {
|
|
261
311
|
result.push(' ');
|
|
262
312
|
result.push(state.transpileToken(this.asToken));
|
|
263
313
|
result.push(' ');
|
|
264
|
-
result.push(
|
|
314
|
+
result.push(...((_b = (_a = this.typeExpression) === null || _a === void 0 ? void 0 : _a.transpile(state)) !== null && _b !== void 0 ? _b : []));
|
|
265
315
|
}
|
|
266
316
|
return result;
|
|
267
317
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
if (this.defaultValue && options.walkMode & visitors_1.InternalWalkMode.walkExpressions) {
|
|
271
|
-
(0, visitors_1.walk)(this, 'defaultValue', visitor, options);
|
|
272
|
-
(0, visitors_1.walk)(this, 'type', visitor, options);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
get isOptional() {
|
|
276
|
-
return !!this.defaultValue;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
exports.FunctionParameterExpression = FunctionParameterExpression;
|
|
280
|
-
class NamespacedVariableNameExpression extends Expression {
|
|
281
|
-
constructor(
|
|
282
|
-
//if this is a `DottedGetExpression`, it must be comprised only of `VariableExpression`s
|
|
283
|
-
expression) {
|
|
284
|
-
super();
|
|
285
|
-
this.expression = expression;
|
|
286
|
-
this.range = expression.range;
|
|
287
|
-
}
|
|
288
|
-
transpile(state) {
|
|
318
|
+
getTypedef(state) {
|
|
319
|
+
var _a, _b;
|
|
289
320
|
return [
|
|
290
|
-
|
|
321
|
+
//name
|
|
322
|
+
this.name.text,
|
|
323
|
+
//default value
|
|
324
|
+
...(this.defaultValue ? [
|
|
325
|
+
' = ',
|
|
326
|
+
...this.defaultValue.transpile(state)
|
|
327
|
+
] : []),
|
|
328
|
+
//type declaration
|
|
329
|
+
...(this.asToken ? [
|
|
330
|
+
' as ',
|
|
331
|
+
...((_b = (_a = this.typeExpression) === null || _a === void 0 ? void 0 : _a.getTypedef(state)) !== null && _b !== void 0 ? _b : [''])
|
|
332
|
+
] : [])
|
|
291
333
|
];
|
|
292
334
|
}
|
|
293
|
-
getNameParts() {
|
|
294
|
-
let parts = [];
|
|
295
|
-
if ((0, reflection_1.isVariableExpression)(this.expression)) {
|
|
296
|
-
parts.push(this.expression.name.text);
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
let expr = this.expression;
|
|
300
|
-
parts.push(expr.name.text);
|
|
301
|
-
while ((0, reflection_1.isVariableExpression)(expr) === false) {
|
|
302
|
-
expr = expr.obj;
|
|
303
|
-
parts.unshift(expr.name.text);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return parts;
|
|
307
|
-
}
|
|
308
|
-
getName(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
309
|
-
if (parseMode === Parser_1.ParseMode.BrighterScript) {
|
|
310
|
-
return this.getNameParts().join('.');
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
return this.getNameParts().join('_');
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
335
|
walk(visitor, options) {
|
|
317
|
-
|
|
318
|
-
|
|
336
|
+
// eslint-disable-next-line no-bitwise
|
|
337
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
338
|
+
(0, visitors_2.walk)(this, 'defaultValue', visitor, options);
|
|
339
|
+
(0, visitors_2.walk)(this, 'typeExpression', visitor, options);
|
|
319
340
|
}
|
|
320
341
|
}
|
|
321
342
|
}
|
|
322
|
-
exports.
|
|
323
|
-
class DottedGetExpression extends Expression {
|
|
343
|
+
exports.FunctionParameterExpression = FunctionParameterExpression;
|
|
344
|
+
class DottedGetExpression extends AstNode_1.Expression {
|
|
324
345
|
constructor(obj, name,
|
|
325
346
|
/**
|
|
326
347
|
* Can either be `.`, or `?.` for optional chaining
|
|
@@ -330,12 +351,15 @@ class DottedGetExpression extends Expression {
|
|
|
330
351
|
this.obj = obj;
|
|
331
352
|
this.name = name;
|
|
332
353
|
this.dot = dot;
|
|
354
|
+
this.kind = AstNode_1.AstNodeKind.DottedGetExpression;
|
|
333
355
|
this.range = util_1.default.createBoundingRange(this.obj, this.dot, this.name);
|
|
334
356
|
}
|
|
335
357
|
transpile(state) {
|
|
336
358
|
//if the callee starts with a namespace name, transpile the name
|
|
337
359
|
if (state.file.calleeStartsWithNamespace(this)) {
|
|
338
|
-
return
|
|
360
|
+
return [
|
|
361
|
+
state.sourceNode(this, this.getName(Parser_1.ParseMode.BrightScript))
|
|
362
|
+
];
|
|
339
363
|
}
|
|
340
364
|
else {
|
|
341
365
|
return [
|
|
@@ -346,13 +370,29 @@ class DottedGetExpression extends Expression {
|
|
|
346
370
|
}
|
|
347
371
|
}
|
|
348
372
|
walk(visitor, options) {
|
|
349
|
-
if (options.walkMode &
|
|
350
|
-
(0,
|
|
373
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
374
|
+
(0, visitors_2.walk)(this, 'obj', visitor, options);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
getType(options) {
|
|
378
|
+
var _a, _b, _c, _d, _e, _f;
|
|
379
|
+
const objType = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.getType(options);
|
|
380
|
+
const result = objType === null || objType === void 0 ? void 0 : objType.getMemberType((_b = this.name) === null || _b === void 0 ? void 0 : _b.text, options);
|
|
381
|
+
(_c = options.typeChain) === null || _c === void 0 ? void 0 : _c.push(new interfaces_1.TypeChainEntry((_d = this.name) === null || _d === void 0 ? void 0 : _d.text, result, options.data, (_f = (_e = this.name) === null || _e === void 0 ? void 0 : _e.range) !== null && _f !== void 0 ? _f : this.range));
|
|
382
|
+
if (result || options.flags & SymbolTable_1.SymbolTypeFlag.typetime) {
|
|
383
|
+
// All types should be known at typetime
|
|
384
|
+
return result;
|
|
351
385
|
}
|
|
386
|
+
// It is possible at runtime that a value has been added dynamically to an object, or something
|
|
387
|
+
// TODO: maybe have a strict flag on this?
|
|
388
|
+
return DynamicType_1.DynamicType.instance;
|
|
389
|
+
}
|
|
390
|
+
getName(parseMode) {
|
|
391
|
+
return util_1.default.getAllDottedGetPartsAsString(this, parseMode);
|
|
352
392
|
}
|
|
353
393
|
}
|
|
354
394
|
exports.DottedGetExpression = DottedGetExpression;
|
|
355
|
-
class XmlAttributeGetExpression extends Expression {
|
|
395
|
+
class XmlAttributeGetExpression extends AstNode_1.Expression {
|
|
356
396
|
constructor(obj, name,
|
|
357
397
|
/**
|
|
358
398
|
* Can either be `@`, or `?@` for optional chaining
|
|
@@ -362,6 +402,7 @@ class XmlAttributeGetExpression extends Expression {
|
|
|
362
402
|
this.obj = obj;
|
|
363
403
|
this.name = name;
|
|
364
404
|
this.at = at;
|
|
405
|
+
this.kind = AstNode_1.AstNodeKind.XmlAttributeGetExpression;
|
|
365
406
|
this.range = util_1.default.createBoundingRange(this.obj, this.at, this.name);
|
|
366
407
|
}
|
|
367
408
|
transpile(state) {
|
|
@@ -372,13 +413,13 @@ class XmlAttributeGetExpression extends Expression {
|
|
|
372
413
|
];
|
|
373
414
|
}
|
|
374
415
|
walk(visitor, options) {
|
|
375
|
-
if (options.walkMode &
|
|
376
|
-
(0,
|
|
416
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
417
|
+
(0, visitors_2.walk)(this, 'obj', visitor, options);
|
|
377
418
|
}
|
|
378
419
|
}
|
|
379
420
|
}
|
|
380
421
|
exports.XmlAttributeGetExpression = XmlAttributeGetExpression;
|
|
381
|
-
class IndexedGetExpression extends Expression {
|
|
422
|
+
class IndexedGetExpression extends AstNode_1.Expression {
|
|
382
423
|
constructor(obj, index,
|
|
383
424
|
/**
|
|
384
425
|
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.`
|
|
@@ -391,33 +432,47 @@ class IndexedGetExpression extends Expression {
|
|
|
391
432
|
this.openingSquare = openingSquare;
|
|
392
433
|
this.closingSquare = closingSquare;
|
|
393
434
|
this.questionDotToken = questionDotToken;
|
|
435
|
+
this.kind = AstNode_1.AstNodeKind.IndexedGetExpression;
|
|
394
436
|
this.range = util_1.default.createBoundingRange(this.obj, this.openingSquare, this.questionDotToken, this.openingSquare, this.index, this.closingSquare);
|
|
395
437
|
}
|
|
396
438
|
transpile(state) {
|
|
439
|
+
var _a, _b;
|
|
397
440
|
return [
|
|
398
441
|
...this.obj.transpile(state),
|
|
399
442
|
this.questionDotToken ? state.transpileToken(this.questionDotToken) : '',
|
|
400
443
|
state.transpileToken(this.openingSquare),
|
|
401
|
-
...this.index.transpile(state),
|
|
402
|
-
state.transpileToken(this.closingSquare)
|
|
444
|
+
...((_b = (_a = this.index) === null || _a === void 0 ? void 0 : _a.transpile(state)) !== null && _b !== void 0 ? _b : []),
|
|
445
|
+
this.closingSquare ? state.transpileToken(this.closingSquare) : ''
|
|
403
446
|
];
|
|
404
447
|
}
|
|
405
448
|
walk(visitor, options) {
|
|
406
|
-
if (options.walkMode &
|
|
407
|
-
(0,
|
|
408
|
-
(0,
|
|
449
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
450
|
+
(0, visitors_2.walk)(this, 'obj', visitor, options);
|
|
451
|
+
(0, visitors_2.walk)(this, 'index', visitor, options);
|
|
409
452
|
}
|
|
410
453
|
}
|
|
454
|
+
getType(options) {
|
|
455
|
+
const objType = this.obj.getType(options);
|
|
456
|
+
if ((0, reflection_1.isArrayType)(objType)) {
|
|
457
|
+
// This is used on an array. What is the default type of that array?
|
|
458
|
+
return objType.defaultType;
|
|
459
|
+
}
|
|
460
|
+
return super.getType(options);
|
|
461
|
+
}
|
|
411
462
|
}
|
|
412
463
|
exports.IndexedGetExpression = IndexedGetExpression;
|
|
413
|
-
class GroupingExpression extends Expression {
|
|
464
|
+
class GroupingExpression extends AstNode_1.Expression {
|
|
414
465
|
constructor(tokens, expression) {
|
|
415
466
|
super();
|
|
416
467
|
this.tokens = tokens;
|
|
417
468
|
this.expression = expression;
|
|
469
|
+
this.kind = AstNode_1.AstNodeKind.GroupingExpression;
|
|
418
470
|
this.range = util_1.default.createBoundingRange(this.tokens.left, this.expression, this.tokens.right);
|
|
419
471
|
}
|
|
420
472
|
transpile(state) {
|
|
473
|
+
if ((0, reflection_1.isTypeCastExpression)(this.expression)) {
|
|
474
|
+
return this.expression.transpile(state);
|
|
475
|
+
}
|
|
421
476
|
return [
|
|
422
477
|
state.transpileToken(this.tokens.left),
|
|
423
478
|
...this.expression.transpile(state),
|
|
@@ -425,18 +480,26 @@ class GroupingExpression extends Expression {
|
|
|
425
480
|
];
|
|
426
481
|
}
|
|
427
482
|
walk(visitor, options) {
|
|
428
|
-
if (options.walkMode &
|
|
429
|
-
(0,
|
|
483
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
484
|
+
(0, visitors_2.walk)(this, 'expression', visitor, options);
|
|
430
485
|
}
|
|
431
486
|
}
|
|
487
|
+
getType(options) {
|
|
488
|
+
return this.expression.getType(options);
|
|
489
|
+
}
|
|
432
490
|
}
|
|
433
491
|
exports.GroupingExpression = GroupingExpression;
|
|
434
|
-
class LiteralExpression extends Expression {
|
|
492
|
+
class LiteralExpression extends AstNode_1.Expression {
|
|
435
493
|
constructor(token) {
|
|
436
494
|
super();
|
|
437
495
|
this.token = token;
|
|
438
|
-
this.
|
|
439
|
-
|
|
496
|
+
this.kind = AstNode_1.AstNodeKind.LiteralExpression;
|
|
497
|
+
}
|
|
498
|
+
get range() {
|
|
499
|
+
return this.token.range;
|
|
500
|
+
}
|
|
501
|
+
getType(options) {
|
|
502
|
+
return util_1.default.tokenToBscType(this.token);
|
|
440
503
|
}
|
|
441
504
|
transpile(state) {
|
|
442
505
|
let text;
|
|
@@ -444,7 +507,7 @@ class LiteralExpression extends Expression {
|
|
|
444
507
|
//wrap quasis with quotes (and escape inner quotemarks)
|
|
445
508
|
text = `"${this.token.text.replace(/"/g, '""')}"`;
|
|
446
509
|
}
|
|
447
|
-
else if (
|
|
510
|
+
else if (this.token.kind === TokenKind_1.TokenKind.StringLiteral) {
|
|
448
511
|
text = this.token.text;
|
|
449
512
|
//add trailing quotemark if it's missing. We will have already generated a diagnostic for this.
|
|
450
513
|
if (text.endsWith('"') === false) {
|
|
@@ -467,10 +530,11 @@ exports.LiteralExpression = LiteralExpression;
|
|
|
467
530
|
* This is a special expression only used within template strings. It exists so we can prevent producing lots of empty strings
|
|
468
531
|
* during template string transpile by identifying these expressions explicitly and skipping the bslib_toString around them
|
|
469
532
|
*/
|
|
470
|
-
class EscapedCharCodeLiteralExpression extends Expression {
|
|
533
|
+
class EscapedCharCodeLiteralExpression extends AstNode_1.Expression {
|
|
471
534
|
constructor(token) {
|
|
472
535
|
super();
|
|
473
536
|
this.token = token;
|
|
537
|
+
this.kind = AstNode_1.AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
474
538
|
this.range = token.range;
|
|
475
539
|
}
|
|
476
540
|
transpile(state) {
|
|
@@ -483,15 +547,15 @@ class EscapedCharCodeLiteralExpression extends Expression {
|
|
|
483
547
|
}
|
|
484
548
|
}
|
|
485
549
|
exports.EscapedCharCodeLiteralExpression = EscapedCharCodeLiteralExpression;
|
|
486
|
-
class ArrayLiteralExpression extends Expression {
|
|
550
|
+
class ArrayLiteralExpression extends AstNode_1.Expression {
|
|
487
551
|
constructor(elements, open, close, hasSpread = false) {
|
|
488
|
-
var _a;
|
|
489
552
|
super();
|
|
490
553
|
this.elements = elements;
|
|
491
554
|
this.open = open;
|
|
492
555
|
this.close = close;
|
|
493
556
|
this.hasSpread = hasSpread;
|
|
494
|
-
this.
|
|
557
|
+
this.kind = AstNode_1.AstNodeKind.ArrayLiteralExpression;
|
|
558
|
+
this.range = util_1.default.createBoundingRange(this.open, ...this.elements, this.close);
|
|
495
559
|
}
|
|
496
560
|
transpile(state) {
|
|
497
561
|
let result = [];
|
|
@@ -524,25 +588,31 @@ class ArrayLiteralExpression extends Expression {
|
|
|
524
588
|
result.push('\n');
|
|
525
589
|
result.push(state.indent());
|
|
526
590
|
}
|
|
527
|
-
|
|
591
|
+
if (this.close) {
|
|
592
|
+
result.push(state.transpileToken(this.close));
|
|
593
|
+
}
|
|
528
594
|
return result;
|
|
529
595
|
}
|
|
530
596
|
walk(visitor, options) {
|
|
531
|
-
if (options.walkMode &
|
|
532
|
-
(0,
|
|
597
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
598
|
+
(0, visitors_2.walkArray)(this.elements, visitor, options, this);
|
|
533
599
|
}
|
|
534
600
|
}
|
|
601
|
+
getType(options) {
|
|
602
|
+
const innerTypes = this.elements.filter(x => !(0, reflection_1.isCommentStatement)(x)).map(expr => expr.getType(options));
|
|
603
|
+
return new types_1.ArrayType(...innerTypes);
|
|
604
|
+
}
|
|
535
605
|
}
|
|
536
606
|
exports.ArrayLiteralExpression = ArrayLiteralExpression;
|
|
537
|
-
class AAMemberExpression extends Expression {
|
|
607
|
+
class AAMemberExpression extends AstNode_1.Expression {
|
|
538
608
|
constructor(keyToken, colonToken,
|
|
539
609
|
/** The expression evaluated to determine the member's initial value. */
|
|
540
|
-
value
|
|
610
|
+
value) {
|
|
541
611
|
super();
|
|
542
612
|
this.keyToken = keyToken;
|
|
543
613
|
this.colonToken = colonToken;
|
|
544
614
|
this.value = value;
|
|
545
|
-
this.
|
|
615
|
+
this.kind = AstNode_1.AstNodeKind.AAMemberExpression;
|
|
546
616
|
this.range = util_1.default.createBoundingRange(this.keyToken, this.colonToken, this.value);
|
|
547
617
|
}
|
|
548
618
|
transpile(state) {
|
|
@@ -550,31 +620,21 @@ class AAMemberExpression extends Expression {
|
|
|
550
620
|
return [];
|
|
551
621
|
}
|
|
552
622
|
walk(visitor, options) {
|
|
553
|
-
(0,
|
|
623
|
+
(0, visitors_2.walk)(this, 'value', visitor, options);
|
|
624
|
+
}
|
|
625
|
+
getType(options) {
|
|
626
|
+
return this.value.getType(options);
|
|
554
627
|
}
|
|
555
628
|
}
|
|
556
629
|
exports.AAMemberExpression = AAMemberExpression;
|
|
557
|
-
class AALiteralExpression extends Expression {
|
|
558
|
-
constructor(elements, open, close
|
|
559
|
-
var _a;
|
|
630
|
+
class AALiteralExpression extends AstNode_1.Expression {
|
|
631
|
+
constructor(elements, open, close) {
|
|
560
632
|
super();
|
|
561
633
|
this.elements = elements;
|
|
562
634
|
this.open = open;
|
|
563
635
|
this.close = close;
|
|
564
|
-
this.
|
|
565
|
-
this.
|
|
566
|
-
this.memberTable = new SymbolTable_1.SymbolTable();
|
|
567
|
-
this.range = util_1.default.createBoundingRange(this.open, ...((_a = this.elements) !== null && _a !== void 0 ? _a : []), this.close);
|
|
568
|
-
this.buildSymbolTable();
|
|
569
|
-
}
|
|
570
|
-
buildSymbolTable() {
|
|
571
|
-
this.symbolTable.clear();
|
|
572
|
-
this.symbolTable.addSymbol('m', { start: this.open.range.start, end: this.close.range.end }, new ObjectType_1.ObjectType('object', this.memberTable));
|
|
573
|
-
for (const element of this.elements) {
|
|
574
|
-
if ((0, reflection_1.isAAMemberExpression)(element)) {
|
|
575
|
-
this.memberTable.addSymbol(element.keyToken.text, element.keyToken.range, (0, Parser_1.getBscTypeFromExpression)(element.value, this.functionExpression));
|
|
576
|
-
}
|
|
577
|
-
}
|
|
636
|
+
this.kind = AstNode_1.AstNodeKind.AALiteralExpression;
|
|
637
|
+
this.range = util_1.default.createBoundingRange(this.open, ...this.elements, this.close);
|
|
578
638
|
}
|
|
579
639
|
transpile(state) {
|
|
580
640
|
let result = [];
|
|
@@ -625,54 +685,80 @@ class AALiteralExpression extends Expression {
|
|
|
625
685
|
result.push(state.indent());
|
|
626
686
|
}
|
|
627
687
|
//close curly
|
|
628
|
-
|
|
688
|
+
if (this.close) {
|
|
689
|
+
result.push(state.transpileToken(this.close));
|
|
690
|
+
}
|
|
629
691
|
return result;
|
|
630
692
|
}
|
|
631
693
|
walk(visitor, options) {
|
|
632
|
-
if (options.walkMode &
|
|
633
|
-
(0,
|
|
694
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
695
|
+
(0, visitors_2.walkArray)(this.elements, visitor, options, this);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
getType(options) {
|
|
699
|
+
const resultType = new AssociativeArrayType_1.AssociativeArrayType();
|
|
700
|
+
for (const element of this.elements) {
|
|
701
|
+
if ((0, reflection_1.isAAMemberExpression)(element)) {
|
|
702
|
+
resultType.addMember(element.keyToken.text, { definingNode: element }, element.getType(options), SymbolTable_1.SymbolTypeFlag.runtime);
|
|
703
|
+
}
|
|
634
704
|
}
|
|
705
|
+
return resultType;
|
|
635
706
|
}
|
|
636
707
|
}
|
|
637
708
|
exports.AALiteralExpression = AALiteralExpression;
|
|
638
|
-
class UnaryExpression extends Expression {
|
|
709
|
+
class UnaryExpression extends AstNode_1.Expression {
|
|
639
710
|
constructor(operator, right) {
|
|
640
711
|
super();
|
|
641
712
|
this.operator = operator;
|
|
642
713
|
this.right = right;
|
|
714
|
+
this.kind = AstNode_1.AstNodeKind.UnaryExpression;
|
|
643
715
|
this.range = util_1.default.createBoundingRange(this.operator, this.right);
|
|
644
716
|
}
|
|
645
717
|
transpile(state) {
|
|
718
|
+
let separatingWhitespace;
|
|
719
|
+
if ((0, reflection_1.isVariableExpression)(this.right)) {
|
|
720
|
+
separatingWhitespace = this.right.name.leadingWhitespace;
|
|
721
|
+
}
|
|
722
|
+
else if ((0, reflection_1.isLiteralExpression)(this.right)) {
|
|
723
|
+
separatingWhitespace = this.right.token.leadingWhitespace;
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
separatingWhitespace = ' ';
|
|
727
|
+
}
|
|
646
728
|
return [
|
|
647
729
|
state.transpileToken(this.operator),
|
|
648
|
-
|
|
730
|
+
separatingWhitespace,
|
|
649
731
|
...this.right.transpile(state)
|
|
650
732
|
];
|
|
651
733
|
}
|
|
652
734
|
walk(visitor, options) {
|
|
653
|
-
if (options.walkMode &
|
|
654
|
-
(0,
|
|
735
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
736
|
+
(0, visitors_2.walk)(this, 'right', visitor, options);
|
|
655
737
|
}
|
|
656
738
|
}
|
|
739
|
+
getType(options) {
|
|
740
|
+
return util_1.default.unaryOperatorResultType(this.operator, this.right.getType(options));
|
|
741
|
+
}
|
|
657
742
|
}
|
|
658
743
|
exports.UnaryExpression = UnaryExpression;
|
|
659
|
-
class VariableExpression extends Expression {
|
|
660
|
-
constructor(name
|
|
744
|
+
class VariableExpression extends AstNode_1.Expression {
|
|
745
|
+
constructor(name) {
|
|
746
|
+
var _a;
|
|
661
747
|
super();
|
|
662
748
|
this.name = name;
|
|
663
|
-
this.
|
|
664
|
-
this.range = this.name.range;
|
|
749
|
+
this.kind = AstNode_1.AstNodeKind.VariableExpression;
|
|
750
|
+
this.range = (_a = this.name) === null || _a === void 0 ? void 0 : _a.range;
|
|
665
751
|
}
|
|
666
752
|
getName(parseMode) {
|
|
667
|
-
return
|
|
753
|
+
return this.name.text;
|
|
668
754
|
}
|
|
669
755
|
transpile(state) {
|
|
670
|
-
var _a;
|
|
671
756
|
let result = [];
|
|
757
|
+
const namespace = this.findAncestor(reflection_1.isNamespaceStatement);
|
|
672
758
|
//if the callee is the name of a known namespace function
|
|
673
|
-
if (state.file.calleeIsKnownNamespaceFunction(this,
|
|
759
|
+
if (state.file.calleeIsKnownNamespaceFunction(this, namespace === null || namespace === void 0 ? void 0 : namespace.getName(Parser_1.ParseMode.BrighterScript))) {
|
|
674
760
|
result.push(state.sourceNode(this, [
|
|
675
|
-
|
|
761
|
+
namespace.getName(Parser_1.ParseMode.BrightScript),
|
|
676
762
|
'_',
|
|
677
763
|
this.getName(Parser_1.ParseMode.BrightScript)
|
|
678
764
|
]));
|
|
@@ -686,24 +772,54 @@ class VariableExpression extends Expression {
|
|
|
686
772
|
walk(visitor, options) {
|
|
687
773
|
//nothing to walk
|
|
688
774
|
}
|
|
775
|
+
getType(options) {
|
|
776
|
+
var _a;
|
|
777
|
+
let resultType = util_1.default.tokenToBscType(this.name);
|
|
778
|
+
const nameKey = this.name.text;
|
|
779
|
+
if (!resultType) {
|
|
780
|
+
const symbolTable = this.getSymbolTable();
|
|
781
|
+
resultType = symbolTable === null || symbolTable === void 0 ? void 0 : symbolTable.getSymbolType(nameKey, Object.assign(Object.assign({}, options), { fullName: nameKey, tableProvider: () => this.getSymbolTable() }));
|
|
782
|
+
}
|
|
783
|
+
(_a = options.typeChain) === null || _a === void 0 ? void 0 : _a.push(new interfaces_1.TypeChainEntry(nameKey, resultType, options.data, this.range));
|
|
784
|
+
return resultType;
|
|
785
|
+
}
|
|
689
786
|
}
|
|
690
787
|
exports.VariableExpression = VariableExpression;
|
|
691
|
-
class SourceLiteralExpression extends Expression {
|
|
788
|
+
class SourceLiteralExpression extends AstNode_1.Expression {
|
|
692
789
|
constructor(token) {
|
|
693
790
|
super();
|
|
694
791
|
this.token = token;
|
|
695
|
-
this.
|
|
792
|
+
this.kind = AstNode_1.AstNodeKind.SourceLiteralExpression;
|
|
793
|
+
this.range = token === null || token === void 0 ? void 0 : token.range;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Find the index of the function in its parent
|
|
797
|
+
*/
|
|
798
|
+
findFunctionIndex(parentFunction, func) {
|
|
799
|
+
let index = -1;
|
|
800
|
+
parentFunction.findChild((node) => {
|
|
801
|
+
if ((0, reflection_1.isFunctionExpression)(node)) {
|
|
802
|
+
index++;
|
|
803
|
+
if (node === func) {
|
|
804
|
+
return true;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}, {
|
|
808
|
+
walkMode: visitors_1.WalkMode.visitAllRecursive
|
|
809
|
+
});
|
|
810
|
+
return index;
|
|
696
811
|
}
|
|
697
812
|
getFunctionName(state, parseMode) {
|
|
698
|
-
let
|
|
813
|
+
let func = state.file.getFunctionScopeAtPosition(this.token.range.start).func;
|
|
699
814
|
let nameParts = [];
|
|
700
|
-
|
|
701
|
-
|
|
815
|
+
let parentFunction;
|
|
816
|
+
while ((parentFunction = func.findAncestor(reflection_1.isFunctionExpression))) {
|
|
817
|
+
let index = this.findFunctionIndex(parentFunction, func);
|
|
702
818
|
nameParts.unshift(`anon${index}`);
|
|
703
|
-
|
|
819
|
+
func = parentFunction;
|
|
704
820
|
}
|
|
705
821
|
//get the index of this function in its parent
|
|
706
|
-
nameParts.unshift(
|
|
822
|
+
nameParts.unshift(func.functionStatement.getName(parseMode));
|
|
707
823
|
return nameParts.join('$');
|
|
708
824
|
}
|
|
709
825
|
transpile(state) {
|
|
@@ -727,10 +843,10 @@ class SourceLiteralExpression extends Expression {
|
|
|
727
843
|
text = `"${locationUrl.substring(0, 4)}" + "${locationUrl.substring(4)}:${this.token.range.start.line + 1}"`;
|
|
728
844
|
break;
|
|
729
845
|
case TokenKind_1.TokenKind.PkgPathLiteral:
|
|
730
|
-
text = `"${state.file.pkgPath
|
|
846
|
+
text = `"${util_1.default.sanitizePkgPath(state.file.pkgPath)}"`;
|
|
731
847
|
break;
|
|
732
848
|
case TokenKind_1.TokenKind.PkgLocationLiteral:
|
|
733
|
-
text = `"${state.file.pkgPath
|
|
849
|
+
text = `"${util_1.default.sanitizePkgPath(state.file.pkgPath)}:" + str(LINE_NUM)`;
|
|
734
850
|
break;
|
|
735
851
|
case TokenKind_1.TokenKind.LineNumLiteral:
|
|
736
852
|
default:
|
|
@@ -752,11 +868,12 @@ exports.SourceLiteralExpression = SourceLiteralExpression;
|
|
|
752
868
|
* except we need to uniquely identify these statements so we can
|
|
753
869
|
* do more type checking.
|
|
754
870
|
*/
|
|
755
|
-
class NewExpression extends Expression {
|
|
871
|
+
class NewExpression extends AstNode_1.Expression {
|
|
756
872
|
constructor(newKeyword, call) {
|
|
757
873
|
super();
|
|
758
874
|
this.newKeyword = newKeyword;
|
|
759
875
|
this.call = call;
|
|
876
|
+
this.kind = AstNode_1.AstNodeKind.NewExpression;
|
|
760
877
|
this.range = util_1.default.createBoundingRange(this.newKeyword, this.call);
|
|
761
878
|
}
|
|
762
879
|
/**
|
|
@@ -764,29 +881,29 @@ class NewExpression extends Expression {
|
|
|
764
881
|
*/
|
|
765
882
|
get className() {
|
|
766
883
|
//the parser guarantees the callee of a new statement's call object will be
|
|
767
|
-
//a
|
|
884
|
+
//either a VariableExpression or a DottedGet
|
|
768
885
|
return this.call.callee;
|
|
769
886
|
}
|
|
770
|
-
get namespaceName() {
|
|
771
|
-
return this.call.namespaceName;
|
|
772
|
-
}
|
|
773
887
|
transpile(state) {
|
|
774
|
-
var _a
|
|
775
|
-
const
|
|
888
|
+
var _a;
|
|
889
|
+
const namespace = this.findAncestor(reflection_1.isNamespaceStatement);
|
|
890
|
+
const cls = (_a = state.file.getClassFileLink(this.className.getName(Parser_1.ParseMode.BrighterScript), namespace === null || namespace === void 0 ? void 0 : namespace.getName(Parser_1.ParseMode.BrighterScript))) === null || _a === void 0 ? void 0 : _a.item;
|
|
776
891
|
//new statements within a namespace block can omit the leading namespace if the class resides in that same namespace.
|
|
777
892
|
//So we need to figure out if this is a namespace-omitted class, or if this class exists without a namespace.
|
|
778
893
|
return this.call.transpile(state, cls === null || cls === void 0 ? void 0 : cls.getName(Parser_1.ParseMode.BrightScript));
|
|
779
894
|
}
|
|
780
895
|
walk(visitor, options) {
|
|
781
|
-
if (options.walkMode &
|
|
782
|
-
(0,
|
|
896
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
897
|
+
(0, visitors_2.walk)(this, 'call', visitor, options);
|
|
783
898
|
}
|
|
784
899
|
}
|
|
900
|
+
getType(options) {
|
|
901
|
+
return this.call.getType(options);
|
|
902
|
+
}
|
|
785
903
|
}
|
|
786
904
|
exports.NewExpression = NewExpression;
|
|
787
|
-
class CallfuncExpression extends Expression {
|
|
905
|
+
class CallfuncExpression extends AstNode_1.Expression {
|
|
788
906
|
constructor(callee, operator, methodName, openingParen, args, closingParen) {
|
|
789
|
-
var _a;
|
|
790
907
|
super();
|
|
791
908
|
this.callee = callee;
|
|
792
909
|
this.operator = operator;
|
|
@@ -794,7 +911,8 @@ class CallfuncExpression extends Expression {
|
|
|
794
911
|
this.openingParen = openingParen;
|
|
795
912
|
this.args = args;
|
|
796
913
|
this.closingParen = closingParen;
|
|
797
|
-
this.
|
|
914
|
+
this.kind = AstNode_1.AstNodeKind.CallfuncExpression;
|
|
915
|
+
this.range = util_1.default.createBoundingRange(callee, operator, methodName, openingParen, ...args, closingParen);
|
|
798
916
|
}
|
|
799
917
|
transpile(state) {
|
|
800
918
|
let result = [];
|
|
@@ -820,10 +938,37 @@ class CallfuncExpression extends Expression {
|
|
|
820
938
|
return result;
|
|
821
939
|
}
|
|
822
940
|
walk(visitor, options) {
|
|
823
|
-
if (options.walkMode &
|
|
824
|
-
(0,
|
|
825
|
-
(0,
|
|
941
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
942
|
+
(0, visitors_2.walk)(this, 'callee', visitor, options);
|
|
943
|
+
(0, visitors_2.walkArray)(this.args, visitor, options, this);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
getType(options) {
|
|
947
|
+
var _a, _b, _c;
|
|
948
|
+
let result = DynamicType_1.DynamicType.instance;
|
|
949
|
+
// a little hacky here with checking options.ignoreCall because callFuncExpression has the method name
|
|
950
|
+
// It's nicer for CallExpression, because it's a call on any expression.
|
|
951
|
+
const calleeType = this.callee.getType(Object.assign(Object.assign({}, options), { flags: SymbolTable_1.SymbolTypeFlag.runtime }));
|
|
952
|
+
if ((0, reflection_1.isComponentType)(calleeType) || (0, reflection_1.isReferenceType)(calleeType)) {
|
|
953
|
+
const funcType = (_b = (_a = calleeType).getCallFuncType) === null || _b === void 0 ? void 0 : _b.call(_a, this.methodName.text, options);
|
|
954
|
+
if (funcType) {
|
|
955
|
+
(_c = options.typeChain) === null || _c === void 0 ? void 0 : _c.push(new interfaces_1.TypeChainEntry(this.methodName.text, funcType, options.data, this.methodName.range, (0, creators_1.createToken)(TokenKind_1.TokenKind.Callfunc)));
|
|
956
|
+
if (options.ignoreCall) {
|
|
957
|
+
result = funcType;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
/* TODO:
|
|
961
|
+
make callfunc return types work
|
|
962
|
+
else if (isCallableType(funcType) && (!isReferenceType(funcType.returnType) || funcType.returnType.isResolvable())) {
|
|
963
|
+
result = funcType.returnType;
|
|
964
|
+
} else if (!isReferenceType(funcType) && (funcType as any)?.returnType?.isResolvable()) {
|
|
965
|
+
result = (funcType as any).returnType;
|
|
966
|
+
} else {
|
|
967
|
+
return new TypePropertyReferenceType(funcType, 'returnType');
|
|
968
|
+
}
|
|
969
|
+
*/
|
|
826
970
|
}
|
|
971
|
+
return result;
|
|
827
972
|
}
|
|
828
973
|
}
|
|
829
974
|
exports.CallfuncExpression = CallfuncExpression;
|
|
@@ -831,12 +976,12 @@ exports.CallfuncExpression = CallfuncExpression;
|
|
|
831
976
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
832
977
|
* This is a single expression that represents the string contatenation of all parts of a single quasi.
|
|
833
978
|
*/
|
|
834
|
-
class TemplateStringQuasiExpression extends Expression {
|
|
979
|
+
class TemplateStringQuasiExpression extends AstNode_1.Expression {
|
|
835
980
|
constructor(expressions) {
|
|
836
|
-
var _a;
|
|
837
981
|
super();
|
|
838
982
|
this.expressions = expressions;
|
|
839
|
-
this.
|
|
983
|
+
this.kind = AstNode_1.AstNodeKind.TemplateStringQuasiExpression;
|
|
984
|
+
this.range = util_1.default.createBoundingRange(...expressions);
|
|
840
985
|
}
|
|
841
986
|
transpile(state, skipEmptyStrings = true) {
|
|
842
987
|
let result = [];
|
|
@@ -853,28 +998,30 @@ class TemplateStringQuasiExpression extends Expression {
|
|
|
853
998
|
return result;
|
|
854
999
|
}
|
|
855
1000
|
walk(visitor, options) {
|
|
856
|
-
if (options.walkMode &
|
|
857
|
-
(0,
|
|
1001
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1002
|
+
(0, visitors_2.walkArray)(this.expressions, visitor, options, this);
|
|
858
1003
|
}
|
|
859
1004
|
}
|
|
860
1005
|
}
|
|
861
1006
|
exports.TemplateStringQuasiExpression = TemplateStringQuasiExpression;
|
|
862
|
-
class TemplateStringExpression extends Expression {
|
|
1007
|
+
class TemplateStringExpression extends AstNode_1.Expression {
|
|
863
1008
|
constructor(openingBacktick, quasis, expressions, closingBacktick) {
|
|
864
|
-
var _a;
|
|
865
1009
|
super();
|
|
866
1010
|
this.openingBacktick = openingBacktick;
|
|
867
1011
|
this.quasis = quasis;
|
|
868
1012
|
this.expressions = expressions;
|
|
869
1013
|
this.closingBacktick = closingBacktick;
|
|
870
|
-
|
|
871
|
-
this.range = util_1.default.createBoundingRange(
|
|
1014
|
+
this.kind = AstNode_1.AstNodeKind.TemplateStringExpression;
|
|
1015
|
+
this.range = util_1.default.createBoundingRange(openingBacktick, quasis[0], quasis[quasis.length - 1], closingBacktick);
|
|
1016
|
+
}
|
|
1017
|
+
getType(options) {
|
|
1018
|
+
return StringType_1.StringType.instance;
|
|
872
1019
|
}
|
|
873
1020
|
transpile(state) {
|
|
874
1021
|
if (this.quasis.length === 1 && this.expressions.length === 0) {
|
|
875
1022
|
return this.quasis[0].transpile(state);
|
|
876
1023
|
}
|
|
877
|
-
let result = [];
|
|
1024
|
+
let result = ['('];
|
|
878
1025
|
let plus = '';
|
|
879
1026
|
//helper function to figure out when to include the plus
|
|
880
1027
|
function add(...items) {
|
|
@@ -893,7 +1040,7 @@ class TemplateStringExpression extends Expression {
|
|
|
893
1040
|
if (expression) {
|
|
894
1041
|
//skip the toString wrapper around certain expressions
|
|
895
1042
|
if ((0, reflection_1.isEscapedCharCodeLiteralExpression)(expression) ||
|
|
896
|
-
((0, reflection_1.isLiteralExpression)(expression) && (0, reflection_1.isStringType)(expression.
|
|
1043
|
+
((0, reflection_1.isLiteralExpression)(expression) && (0, reflection_1.isStringType)(expression.getType()))) {
|
|
897
1044
|
add(...expression.transpile(state));
|
|
898
1045
|
//wrap all other expressions with a bslib_toString call to prevent runtime type mismatch errors
|
|
899
1046
|
}
|
|
@@ -902,33 +1049,34 @@ class TemplateStringExpression extends Expression {
|
|
|
902
1049
|
}
|
|
903
1050
|
}
|
|
904
1051
|
}
|
|
1052
|
+
//the expression should be wrapped in parens so it can be used line a single expression at runtime
|
|
1053
|
+
result.push(')');
|
|
905
1054
|
return result;
|
|
906
1055
|
}
|
|
907
1056
|
walk(visitor, options) {
|
|
908
|
-
if (options.walkMode &
|
|
1057
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
909
1058
|
//walk the quasis and expressions in left-to-right order
|
|
910
1059
|
for (let i = 0; i < this.quasis.length; i++) {
|
|
911
|
-
(0,
|
|
1060
|
+
(0, visitors_2.walk)(this.quasis, i, visitor, options, this);
|
|
912
1061
|
//this skips the final loop iteration since we'll always have one more quasi than expression
|
|
913
1062
|
if (this.expressions[i]) {
|
|
914
|
-
(0,
|
|
1063
|
+
(0, visitors_2.walk)(this.expressions, i, visitor, options, this);
|
|
915
1064
|
}
|
|
916
1065
|
}
|
|
917
1066
|
}
|
|
918
1067
|
}
|
|
919
1068
|
}
|
|
920
1069
|
exports.TemplateStringExpression = TemplateStringExpression;
|
|
921
|
-
class TaggedTemplateStringExpression extends Expression {
|
|
1070
|
+
class TaggedTemplateStringExpression extends AstNode_1.Expression {
|
|
922
1071
|
constructor(tagName, openingBacktick, quasis, expressions, closingBacktick) {
|
|
923
|
-
var _a;
|
|
924
1072
|
super();
|
|
925
1073
|
this.tagName = tagName;
|
|
926
1074
|
this.openingBacktick = openingBacktick;
|
|
927
1075
|
this.quasis = quasis;
|
|
928
1076
|
this.expressions = expressions;
|
|
929
1077
|
this.closingBacktick = closingBacktick;
|
|
930
|
-
|
|
931
|
-
this.range = util_1.default.createBoundingRange(
|
|
1078
|
+
this.kind = AstNode_1.AstNodeKind.TaggedTemplateStringExpression;
|
|
1079
|
+
this.range = util_1.default.createBoundingRange(tagName, openingBacktick, quasis[0], quasis[quasis.length - 1], closingBacktick);
|
|
932
1080
|
}
|
|
933
1081
|
transpile(state) {
|
|
934
1082
|
let result = [];
|
|
@@ -955,34 +1103,29 @@ class TaggedTemplateStringExpression extends Expression {
|
|
|
955
1103
|
return result;
|
|
956
1104
|
}
|
|
957
1105
|
walk(visitor, options) {
|
|
958
|
-
if (options.walkMode &
|
|
1106
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
959
1107
|
//walk the quasis and expressions in left-to-right order
|
|
960
1108
|
for (let i = 0; i < this.quasis.length; i++) {
|
|
961
|
-
(0,
|
|
1109
|
+
(0, visitors_2.walk)(this.quasis, i, visitor, options, this);
|
|
962
1110
|
//this skips the final loop iteration since we'll always have one more quasi than expression
|
|
963
1111
|
if (this.expressions[i]) {
|
|
964
|
-
(0,
|
|
1112
|
+
(0, visitors_2.walk)(this.expressions, i, visitor, options, this);
|
|
965
1113
|
}
|
|
966
1114
|
}
|
|
967
1115
|
}
|
|
968
1116
|
}
|
|
969
1117
|
}
|
|
970
1118
|
exports.TaggedTemplateStringExpression = TaggedTemplateStringExpression;
|
|
971
|
-
class AnnotationExpression extends Expression {
|
|
1119
|
+
class AnnotationExpression extends AstNode_1.Expression {
|
|
972
1120
|
constructor(atToken, nameToken) {
|
|
973
1121
|
super();
|
|
974
1122
|
this.atToken = atToken;
|
|
975
1123
|
this.nameToken = nameToken;
|
|
1124
|
+
this.kind = AstNode_1.AstNodeKind.AnnotationExpression;
|
|
976
1125
|
this.name = nameToken.text;
|
|
977
1126
|
}
|
|
978
1127
|
get range() {
|
|
979
|
-
return this.
|
|
980
|
-
}
|
|
981
|
-
cacheRange() {
|
|
982
|
-
if (!this._range) {
|
|
983
|
-
this._range = util_1.default.createBoundingRange(this.atToken, this.nameToken, this.call);
|
|
984
|
-
}
|
|
985
|
-
return this._range;
|
|
1128
|
+
return util_1.default.createBoundingRange(this.atToken, this.nameToken, this.call);
|
|
986
1129
|
}
|
|
987
1130
|
/**
|
|
988
1131
|
* Convert annotation arguments to JavaScript types
|
|
@@ -994,6 +1137,9 @@ class AnnotationExpression extends Expression {
|
|
|
994
1137
|
}
|
|
995
1138
|
return this.call.args.map(e => expressionToValue(e, strict));
|
|
996
1139
|
}
|
|
1140
|
+
getLeadingTrivia() {
|
|
1141
|
+
return this.atToken.leadingTrivia;
|
|
1142
|
+
}
|
|
997
1143
|
transpile(state) {
|
|
998
1144
|
return [];
|
|
999
1145
|
}
|
|
@@ -1010,7 +1156,7 @@ class AnnotationExpression extends Expression {
|
|
|
1010
1156
|
}
|
|
1011
1157
|
}
|
|
1012
1158
|
exports.AnnotationExpression = AnnotationExpression;
|
|
1013
|
-
class TernaryExpression extends Expression {
|
|
1159
|
+
class TernaryExpression extends AstNode_1.Expression {
|
|
1014
1160
|
constructor(test, questionMarkToken, consequent, colonToken, alternate) {
|
|
1015
1161
|
super();
|
|
1016
1162
|
this.test = test;
|
|
@@ -1018,7 +1164,8 @@ class TernaryExpression extends Expression {
|
|
|
1018
1164
|
this.consequent = consequent;
|
|
1019
1165
|
this.colonToken = colonToken;
|
|
1020
1166
|
this.alternate = alternate;
|
|
1021
|
-
this.
|
|
1167
|
+
this.kind = AstNode_1.AstNodeKind.TernaryExpression;
|
|
1168
|
+
this.range = util_1.default.createBoundingRange(test, questionMarkToken, consequent, colonToken, alternate);
|
|
1022
1169
|
}
|
|
1023
1170
|
transpile(state) {
|
|
1024
1171
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -1046,21 +1193,22 @@ class TernaryExpression extends Expression {
|
|
|
1046
1193
|
return result;
|
|
1047
1194
|
}
|
|
1048
1195
|
walk(visitor, options) {
|
|
1049
|
-
if (options.walkMode &
|
|
1050
|
-
(0,
|
|
1051
|
-
(0,
|
|
1052
|
-
(0,
|
|
1196
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1197
|
+
(0, visitors_2.walk)(this, 'test', visitor, options);
|
|
1198
|
+
(0, visitors_2.walk)(this, 'consequent', visitor, options);
|
|
1199
|
+
(0, visitors_2.walk)(this, 'alternate', visitor, options);
|
|
1053
1200
|
}
|
|
1054
1201
|
}
|
|
1055
1202
|
}
|
|
1056
1203
|
exports.TernaryExpression = TernaryExpression;
|
|
1057
|
-
class NullCoalescingExpression extends Expression {
|
|
1204
|
+
class NullCoalescingExpression extends AstNode_1.Expression {
|
|
1058
1205
|
constructor(consequent, questionQuestionToken, alternate) {
|
|
1059
1206
|
super();
|
|
1060
1207
|
this.consequent = consequent;
|
|
1061
1208
|
this.questionQuestionToken = questionQuestionToken;
|
|
1062
1209
|
this.alternate = alternate;
|
|
1063
|
-
this.
|
|
1210
|
+
this.kind = AstNode_1.AstNodeKind.NullCoalescingExpression;
|
|
1211
|
+
this.range = util_1.default.createBoundingRange(consequent, questionQuestionToken, alternate);
|
|
1064
1212
|
}
|
|
1065
1213
|
transpile(state) {
|
|
1066
1214
|
let result = [];
|
|
@@ -1089,18 +1237,22 @@ class NullCoalescingExpression extends Expression {
|
|
|
1089
1237
|
return result;
|
|
1090
1238
|
}
|
|
1091
1239
|
walk(visitor, options) {
|
|
1092
|
-
if (options.walkMode &
|
|
1093
|
-
(0,
|
|
1094
|
-
(0,
|
|
1240
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1241
|
+
(0, visitors_2.walk)(this, 'consequent', visitor, options);
|
|
1242
|
+
(0, visitors_2.walk)(this, 'alternate', visitor, options);
|
|
1095
1243
|
}
|
|
1096
1244
|
}
|
|
1097
1245
|
}
|
|
1098
1246
|
exports.NullCoalescingExpression = NullCoalescingExpression;
|
|
1099
|
-
class RegexLiteralExpression extends Expression {
|
|
1247
|
+
class RegexLiteralExpression extends AstNode_1.Expression {
|
|
1100
1248
|
constructor(tokens) {
|
|
1101
1249
|
super();
|
|
1102
1250
|
this.tokens = tokens;
|
|
1103
|
-
this.
|
|
1251
|
+
this.kind = AstNode_1.AstNodeKind.RegexLiteralExpression;
|
|
1252
|
+
}
|
|
1253
|
+
get range() {
|
|
1254
|
+
var _a, _b;
|
|
1255
|
+
return (_b = (_a = this.tokens) === null || _a === void 0 ? void 0 : _a.regexLiteral) === null || _b === void 0 ? void 0 : _b.range;
|
|
1104
1256
|
}
|
|
1105
1257
|
transpile(state) {
|
|
1106
1258
|
var _a, _b;
|
|
@@ -1131,109 +1283,6 @@ class RegexLiteralExpression extends Expression {
|
|
|
1131
1283
|
}
|
|
1132
1284
|
}
|
|
1133
1285
|
exports.RegexLiteralExpression = RegexLiteralExpression;
|
|
1134
|
-
class TypeExpression extends Expression {
|
|
1135
|
-
constructor(tokens, namespaceName) {
|
|
1136
|
-
super();
|
|
1137
|
-
this.tokens = tokens;
|
|
1138
|
-
this.namespaceName = namespaceName;
|
|
1139
|
-
this.range = util_1.default.createBoundingRange(this.tokens.type);
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* The this TypeExpression refers to
|
|
1143
|
-
*/
|
|
1144
|
-
get type() {
|
|
1145
|
-
if (this._type) {
|
|
1146
|
-
return this._type;
|
|
1147
|
-
}
|
|
1148
|
-
this._type = this.getType(Parser_1.ParseMode.BrighterScript);
|
|
1149
|
-
return this._type;
|
|
1150
|
-
}
|
|
1151
|
-
/**
|
|
1152
|
-
* Derive a BscType from the type token
|
|
1153
|
-
* Can deal with multiple brackets to make multidimensional arrays, eg. float[][]
|
|
1154
|
-
* Defaults to `DynamicType`
|
|
1155
|
-
*/
|
|
1156
|
-
getType(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
1157
|
-
let exprType = this.tokens.type
|
|
1158
|
-
? util_1.default.tokenToBscType(this.tokens.type, parseMode === Parser_1.ParseMode.BrighterScript, this.namespaceName)
|
|
1159
|
-
: new DynamicType_1.DynamicType();
|
|
1160
|
-
return exprType;
|
|
1161
|
-
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Is this a valid, (eg. known) type?
|
|
1164
|
-
*/
|
|
1165
|
-
isValidType(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
1166
|
-
return !!util_1.default.tokenToBscType(this.tokens.type, parseMode === Parser_1.ParseMode.BrighterScript, this.namespaceName);
|
|
1167
|
-
}
|
|
1168
|
-
/**
|
|
1169
|
-
* Gives a human readable string that says the type
|
|
1170
|
-
* @returns text to display to show the type
|
|
1171
|
-
*/
|
|
1172
|
-
getText() {
|
|
1173
|
-
let result = this.tokens.type.text;
|
|
1174
|
-
return result;
|
|
1175
|
-
}
|
|
1176
|
-
transpile(state) {
|
|
1177
|
-
let result = [];
|
|
1178
|
-
//type declaration
|
|
1179
|
-
result.push(state.sourceNode({ range: this.range }, this.type.toTypeString(state.typeContext)));
|
|
1180
|
-
return result;
|
|
1181
|
-
}
|
|
1182
|
-
walk(visitor, options) {
|
|
1183
|
-
//nothing to walk
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
exports.TypeExpression = TypeExpression;
|
|
1187
|
-
class ArrayTypeExpression extends TypeExpression {
|
|
1188
|
-
constructor(innerTypes, // this is an array so that in the future when we support union types
|
|
1189
|
-
bracketTokens, namespaceName) {
|
|
1190
|
-
super({}, namespaceName);
|
|
1191
|
-
this.innerTypes = innerTypes;
|
|
1192
|
-
this.bracketTokens = bracketTokens;
|
|
1193
|
-
this.namespaceName = namespaceName;
|
|
1194
|
-
this.range = util_1.default.createBoundingRange(this.bracketTokens.leftBracket, this.bracketTokens.rightBracket, ...this.innerTypes);
|
|
1195
|
-
}
|
|
1196
|
-
/*
|
|
1197
|
-
* TODO - Support union types
|
|
1198
|
-
*/
|
|
1199
|
-
get defaultTypeExpression() {
|
|
1200
|
-
return this.innerTypes[0];
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Derive a BscType from the type token
|
|
1204
|
-
* Returns an array type with the inner types based on the inner type expressions
|
|
1205
|
-
*/
|
|
1206
|
-
getType(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
1207
|
-
const innerBscTypes = this.innerTypes.map(inner => inner.getType(parseMode));
|
|
1208
|
-
return new ArrayType_1.ArrayType(...innerBscTypes);
|
|
1209
|
-
}
|
|
1210
|
-
/**
|
|
1211
|
-
* Is this a valid, (eg. known) type?
|
|
1212
|
-
*/
|
|
1213
|
-
isValidType(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
1214
|
-
if (parseMode === Parser_1.ParseMode.BrighterScript) {
|
|
1215
|
-
return this.innerTypes.reduce((validSoFar, innerType) => {
|
|
1216
|
-
return validSoFar && innerType.isValidType(parseMode);
|
|
1217
|
-
}, true);
|
|
1218
|
-
}
|
|
1219
|
-
return false;
|
|
1220
|
-
}
|
|
1221
|
-
/**
|
|
1222
|
-
* Gives a human readable string that says the type
|
|
1223
|
-
* @returns text to display to show the type
|
|
1224
|
-
*/
|
|
1225
|
-
getText() {
|
|
1226
|
-
return this.defaultTypeExpression.getText() + '[]';
|
|
1227
|
-
}
|
|
1228
|
-
walk(visitor, options) {
|
|
1229
|
-
if (options.walkMode & visitors_1.InternalWalkMode.walkExpressions) {
|
|
1230
|
-
for (let i = 0; i < this.innerTypes.length; i++) {
|
|
1231
|
-
(0, visitors_1.walk)(this.innerTypes, i, visitor, options, this);
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
exports.ArrayTypeExpression = ArrayTypeExpression;
|
|
1237
1286
|
function expressionToValue(expr, strict) {
|
|
1238
1287
|
if (!expr) {
|
|
1239
1288
|
return null;
|
|
@@ -1267,11 +1316,92 @@ function expressionToValue(expr, strict) {
|
|
|
1267
1316
|
return strict ? null : expr;
|
|
1268
1317
|
}
|
|
1269
1318
|
function numberExpressionToValue(expr, operator = '') {
|
|
1270
|
-
if ((0, reflection_1.isIntegerType)(expr.
|
|
1319
|
+
if ((0, reflection_1.isIntegerType)(expr.getType()) || (0, reflection_1.isLongIntegerType)(expr.getType())) {
|
|
1271
1320
|
return parseInt(operator + expr.token.text);
|
|
1272
1321
|
}
|
|
1273
1322
|
else {
|
|
1274
1323
|
return parseFloat(operator + expr.token.text);
|
|
1275
1324
|
}
|
|
1276
1325
|
}
|
|
1326
|
+
class TypeExpression extends AstNode_1.Expression {
|
|
1327
|
+
constructor(
|
|
1328
|
+
/**
|
|
1329
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
1330
|
+
*/
|
|
1331
|
+
expression) {
|
|
1332
|
+
super();
|
|
1333
|
+
this.expression = expression;
|
|
1334
|
+
this.kind = AstNode_1.AstNodeKind.TypeExpression;
|
|
1335
|
+
this.range = expression === null || expression === void 0 ? void 0 : expression.range;
|
|
1336
|
+
}
|
|
1337
|
+
transpile(state) {
|
|
1338
|
+
return [this.getType({ flags: SymbolTable_1.SymbolTypeFlag.typetime }).toTypeString()];
|
|
1339
|
+
}
|
|
1340
|
+
walk(visitor, options) {
|
|
1341
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1342
|
+
(0, visitors_2.walk)(this, 'expression', visitor, options);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
getType(options) {
|
|
1346
|
+
return this.expression.getType(Object.assign(Object.assign({}, options), { flags: SymbolTable_1.SymbolTypeFlag.typetime }));
|
|
1347
|
+
}
|
|
1348
|
+
getTypedef(state) {
|
|
1349
|
+
// TypeDefs should pass through any valid type names
|
|
1350
|
+
return this.expression.transpile(state);
|
|
1351
|
+
}
|
|
1352
|
+
getName(parseMode = Parser_1.ParseMode.BrighterScript) {
|
|
1353
|
+
//TODO: this may not support Complex Types, eg. generics or Unions
|
|
1354
|
+
return util_1.default.getAllDottedGetPartsAsString(this.expression, parseMode);
|
|
1355
|
+
}
|
|
1356
|
+
getNameParts() {
|
|
1357
|
+
//TODO: really, this code is only used to get Namespaces. It could be more clear.
|
|
1358
|
+
return util_1.default.getAllDottedGetParts(this.expression).map(x => x.text);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
exports.TypeExpression = TypeExpression;
|
|
1362
|
+
class TypeCastExpression extends AstNode_1.Expression {
|
|
1363
|
+
constructor(obj, asToken, typeExpression) {
|
|
1364
|
+
super();
|
|
1365
|
+
this.obj = obj;
|
|
1366
|
+
this.asToken = asToken;
|
|
1367
|
+
this.typeExpression = typeExpression;
|
|
1368
|
+
this.kind = AstNode_1.AstNodeKind.TypeCastExpression;
|
|
1369
|
+
this.range = util_1.default.createBoundingRange(this.obj, this.asToken, this.typeExpression);
|
|
1370
|
+
}
|
|
1371
|
+
transpile(state) {
|
|
1372
|
+
return this.obj.transpile(state);
|
|
1373
|
+
}
|
|
1374
|
+
walk(visitor, options) {
|
|
1375
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1376
|
+
(0, visitors_2.walk)(this, 'obj', visitor, options);
|
|
1377
|
+
(0, visitors_2.walk)(this, 'typeExpression', visitor, options);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
getType(options) {
|
|
1381
|
+
return this.typeExpression.getType(options);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
exports.TypeCastExpression = TypeCastExpression;
|
|
1385
|
+
class TypedArrayExpression extends AstNode_1.Expression {
|
|
1386
|
+
constructor(innerType, leftBracket, rightBracket) {
|
|
1387
|
+
super();
|
|
1388
|
+
this.innerType = innerType;
|
|
1389
|
+
this.leftBracket = leftBracket;
|
|
1390
|
+
this.rightBracket = rightBracket;
|
|
1391
|
+
this.kind = AstNode_1.AstNodeKind.TypedArrayExpression;
|
|
1392
|
+
this.range = util_1.default.createBoundingRange(this.innerType, this.leftBracket, this.rightBracket);
|
|
1393
|
+
}
|
|
1394
|
+
transpile(state) {
|
|
1395
|
+
return [this.getType({ flags: SymbolTable_1.SymbolTypeFlag.typetime }).toTypeString()];
|
|
1396
|
+
}
|
|
1397
|
+
walk(visitor, options) {
|
|
1398
|
+
if (options.walkMode & visitors_2.InternalWalkMode.walkExpressions) {
|
|
1399
|
+
(0, visitors_2.walk)(this, 'innerType', visitor, options);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
getType(options) {
|
|
1403
|
+
return new types_1.ArrayType(this.innerType.getType(options));
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
exports.TypedArrayExpression = TypedArrayExpression;
|
|
1277
1407
|
//# sourceMappingURL=Expression.js.map
|