brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (715) hide show
  1. package/README.md +76 -138
  2. package/bsconfig.schema.json +121 -5
  3. package/dist/ActionPipeline.d.ts +10 -0
  4. package/dist/ActionPipeline.js +40 -0
  5. package/dist/ActionPipeline.js.map +1 -0
  6. package/dist/AstValidationSegmenter.d.ts +45 -0
  7. package/dist/AstValidationSegmenter.js +322 -0
  8. package/dist/AstValidationSegmenter.js.map +1 -0
  9. package/dist/BsConfig.d.ts +72 -39
  10. package/dist/BusyStatusTracker.d.ts +61 -0
  11. package/dist/BusyStatusTracker.js +148 -0
  12. package/dist/BusyStatusTracker.js.map +1 -0
  13. package/dist/Cache.d.ts +3 -8
  14. package/dist/Cache.js +9 -14
  15. package/dist/Cache.js.map +1 -1
  16. package/dist/CacheVerifier.d.ts +7 -0
  17. package/dist/CacheVerifier.js +20 -0
  18. package/dist/CacheVerifier.js.map +1 -0
  19. package/dist/CodeActionUtil.d.ts +12 -4
  20. package/dist/CodeActionUtil.js +22 -5
  21. package/dist/CodeActionUtil.js.map +1 -1
  22. package/dist/CommentFlagProcessor.d.ts +7 -6
  23. package/dist/CommentFlagProcessor.js +11 -8
  24. package/dist/CommentFlagProcessor.js.map +1 -1
  25. package/dist/CrossScopeValidator.d.ts +68 -0
  26. package/dist/CrossScopeValidator.js +642 -0
  27. package/dist/CrossScopeValidator.js.map +1 -0
  28. package/dist/DependencyGraph.d.ts +8 -3
  29. package/dist/DependencyGraph.js +49 -16
  30. package/dist/DependencyGraph.js.map +1 -1
  31. package/dist/DiagnosticCollection.d.ts +21 -5
  32. package/dist/DiagnosticCollection.js +77 -24
  33. package/dist/DiagnosticCollection.js.map +1 -1
  34. package/dist/DiagnosticFilterer.d.ts +27 -6
  35. package/dist/DiagnosticFilterer.js +273 -60
  36. package/dist/DiagnosticFilterer.js.map +1 -1
  37. package/dist/DiagnosticManager.d.ts +82 -0
  38. package/dist/DiagnosticManager.js +406 -0
  39. package/dist/DiagnosticManager.js.map +1 -0
  40. package/dist/DiagnosticMessages.d.ts +558 -196
  41. package/dist/DiagnosticMessages.js +870 -340
  42. package/dist/DiagnosticMessages.js.map +1 -1
  43. package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
  44. package/dist/DiagnosticSeverityAdjuster.js +45 -0
  45. package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
  46. package/dist/FunctionScope.d.ts +28 -0
  47. package/dist/FunctionScope.js +52 -0
  48. package/dist/FunctionScope.js.map +1 -0
  49. package/dist/KeyedThrottler.d.ts +3 -3
  50. package/dist/KeyedThrottler.js +3 -3
  51. package/dist/KeyedThrottler.js.map +1 -1
  52. package/dist/LanguageServer.d.ts +100 -105
  53. package/dist/LanguageServer.js +444 -745
  54. package/dist/LanguageServer.js.map +1 -1
  55. package/dist/Logger.d.ts +17 -13
  56. package/dist/Logger.js +64 -34
  57. package/dist/Logger.js.map +1 -1
  58. package/dist/PluginInterface.d.ts +32 -10
  59. package/dist/PluginInterface.js +117 -7
  60. package/dist/PluginInterface.js.map +1 -1
  61. package/dist/Program.d.ts +241 -98
  62. package/dist/Program.js +1432 -717
  63. package/dist/Program.js.map +1 -1
  64. package/dist/ProgramBuilder.d.ts +47 -23
  65. package/dist/ProgramBuilder.js +224 -178
  66. package/dist/ProgramBuilder.js.map +1 -1
  67. package/dist/Scope.d.ts +149 -109
  68. package/dist/Scope.js +557 -550
  69. package/dist/Scope.js.map +1 -1
  70. package/dist/SemanticTokenUtils.js +5 -1
  71. package/dist/SemanticTokenUtils.js.map +1 -1
  72. package/dist/Stopwatch.d.ts +4 -0
  73. package/dist/Stopwatch.js +8 -1
  74. package/dist/Stopwatch.js.map +1 -1
  75. package/dist/SymbolTable.d.ts +136 -24
  76. package/dist/SymbolTable.js +565 -64
  77. package/dist/SymbolTable.js.map +1 -1
  78. package/dist/SymbolTypeFlag.d.ts +9 -0
  79. package/dist/SymbolTypeFlag.js +14 -0
  80. package/dist/SymbolTypeFlag.js.map +1 -0
  81. package/dist/Throttler.d.ts +12 -0
  82. package/dist/Throttler.js +39 -0
  83. package/dist/Throttler.js.map +1 -1
  84. package/dist/Watcher.d.ts +0 -3
  85. package/dist/Watcher.js +0 -3
  86. package/dist/Watcher.js.map +1 -1
  87. package/dist/XmlScope.d.ts +5 -15
  88. package/dist/XmlScope.js +34 -90
  89. package/dist/XmlScope.js.map +1 -1
  90. package/dist/astUtils/CachedLookups.d.ts +50 -0
  91. package/dist/astUtils/CachedLookups.js +334 -0
  92. package/dist/astUtils/CachedLookups.js.map +1 -0
  93. package/dist/astUtils/CachedLookups.spec.js +39 -0
  94. package/dist/astUtils/CachedLookups.spec.js.map +1 -0
  95. package/dist/astUtils/Editor.d.ts +69 -0
  96. package/dist/astUtils/Editor.js +245 -0
  97. package/dist/astUtils/Editor.js.map +1 -0
  98. package/dist/astUtils/Editor.spec.js +258 -0
  99. package/dist/astUtils/Editor.spec.js.map +1 -0
  100. package/dist/astUtils/creators.d.ts +54 -19
  101. package/dist/astUtils/creators.js +242 -42
  102. package/dist/astUtils/creators.js.map +1 -1
  103. package/dist/astUtils/creators.spec.js +5 -5
  104. package/dist/astUtils/creators.spec.js.map +1 -1
  105. package/dist/astUtils/reflection.d.ts +196 -85
  106. package/dist/astUtils/reflection.js +497 -144
  107. package/dist/astUtils/reflection.js.map +1 -1
  108. package/dist/astUtils/reflection.spec.js +267 -167
  109. package/dist/astUtils/reflection.spec.js.map +1 -1
  110. package/dist/astUtils/stackedVisitor.js.map +1 -1
  111. package/dist/astUtils/stackedVisitor.spec.js +14 -14
  112. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  113. package/dist/astUtils/visitors.d.ts +116 -53
  114. package/dist/astUtils/visitors.js +95 -15
  115. package/dist/astUtils/visitors.js.map +1 -1
  116. package/dist/astUtils/visitors.spec.js +629 -51
  117. package/dist/astUtils/visitors.spec.js.map +1 -1
  118. package/dist/astUtils/xml.d.ts +9 -8
  119. package/dist/astUtils/xml.js +12 -7
  120. package/dist/astUtils/xml.js.map +1 -1
  121. package/dist/bscPlugin/BscPlugin.d.ts +24 -4
  122. package/dist/bscPlugin/BscPlugin.js +88 -4
  123. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  124. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  125. package/dist/bscPlugin/CallExpressionInfo.js +143 -0
  126. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  127. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  128. package/dist/bscPlugin/FileWriter.js +24 -0
  129. package/dist/bscPlugin/FileWriter.js.map +1 -0
  130. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  131. package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
  132. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  133. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +6 -5
  134. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
  135. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  136. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
  137. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  138. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
  139. package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
  140. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
  141. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -0
  142. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  143. package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
  144. package/dist/bscPlugin/definition/DefinitionProvider.js +212 -0
  145. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  146. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
  147. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  148. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  149. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  150. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  151. package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
  152. package/dist/bscPlugin/hover/HoverProcessor.js +230 -0
  153. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
  154. package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -0
  155. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
  156. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  157. package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
  158. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  159. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  160. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  161. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  162. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
  163. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +164 -0
  164. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
  165. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
  166. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +564 -0
  167. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
  168. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  169. package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
  170. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  171. package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
  172. package/dist/bscPlugin/serialize/BslibManager.js +46 -0
  173. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  174. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  175. package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
  176. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  177. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
  178. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
  179. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
  180. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
  181. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
  182. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
  183. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
  184. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
  185. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
  186. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
  187. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
  188. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
  189. package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
  190. package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
  191. package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
  192. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
  193. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -0
  194. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  195. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  196. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -0
  197. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  198. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  199. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  200. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  201. package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
  202. package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
  203. package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
  204. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +37 -0
  205. package/dist/bscPlugin/validation/BrsFileValidator.js +638 -0
  206. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
  207. package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
  208. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1517 -0
  209. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
  210. package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
  211. package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
  212. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  213. package/dist/bscPlugin/validation/ScopeValidator.d.ts +141 -0
  214. package/dist/bscPlugin/validation/ScopeValidator.js +1323 -0
  215. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
  216. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  217. package/dist/bscPlugin/validation/ScopeValidator.spec.js +6135 -0
  218. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  219. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  220. package/dist/bscPlugin/validation/XmlFileValidator.js +36 -0
  221. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  222. package/dist/cli.js +126 -27
  223. package/dist/cli.js.map +1 -1
  224. package/dist/common/Sequencer.d.ts +53 -0
  225. package/dist/common/Sequencer.js +233 -0
  226. package/dist/common/Sequencer.js.map +1 -0
  227. package/dist/common/Sequencer.spec.d.ts +1 -0
  228. package/dist/common/Sequencer.spec.js +75 -0
  229. package/dist/common/Sequencer.spec.js.map +1 -0
  230. package/dist/deferred.d.ts +5 -3
  231. package/dist/deferred.js +10 -0
  232. package/dist/deferred.js.map +1 -1
  233. package/dist/diagnosticUtils.d.ts +10 -3
  234. package/dist/diagnosticUtils.js +64 -25
  235. package/dist/diagnosticUtils.js.map +1 -1
  236. package/dist/examples/plugins/removePrint.d.ts +2 -2
  237. package/dist/examples/plugins/removePrint.js +8 -12
  238. package/dist/examples/plugins/removePrint.js.map +1 -1
  239. package/dist/files/AssetFile.d.ts +24 -0
  240. package/dist/files/AssetFile.js +25 -0
  241. package/dist/files/AssetFile.js.map +1 -0
  242. package/dist/files/BrsFile.Class.spec.js +1213 -259
  243. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  244. package/dist/files/BrsFile.d.ts +145 -87
  245. package/dist/files/BrsFile.js +836 -934
  246. package/dist/files/BrsFile.js.map +1 -1
  247. package/dist/files/BrsFile.spec.js +4226 -902
  248. package/dist/files/BrsFile.spec.js.map +1 -1
  249. package/dist/files/BscFile.d.ts +102 -0
  250. package/dist/files/BscFile.js +15 -0
  251. package/dist/files/BscFile.js.map +1 -0
  252. package/dist/files/Factory.d.ts +25 -0
  253. package/dist/files/Factory.js +22 -0
  254. package/dist/files/Factory.js.map +1 -0
  255. package/dist/files/LazyFileData.d.ts +21 -0
  256. package/dist/files/LazyFileData.js +54 -0
  257. package/dist/files/LazyFileData.js.map +1 -0
  258. package/dist/files/LazyFileData.spec.d.ts +1 -0
  259. package/dist/files/LazyFileData.spec.js +27 -0
  260. package/dist/files/LazyFileData.spec.js.map +1 -0
  261. package/dist/files/XmlFile.d.ts +80 -41
  262. package/dist/files/XmlFile.js +161 -137
  263. package/dist/files/XmlFile.js.map +1 -1
  264. package/dist/files/XmlFile.spec.js +444 -336
  265. package/dist/files/XmlFile.spec.js.map +1 -1
  266. package/dist/files/tests/imports.spec.js +62 -52
  267. package/dist/files/tests/imports.spec.js.map +1 -1
  268. package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
  269. package/dist/files/tests/optionalChaning.spec.js +152 -0
  270. package/dist/files/tests/optionalChaning.spec.js.map +1 -0
  271. package/dist/globalCallables.d.ts +3 -1
  272. package/dist/globalCallables.js +424 -184
  273. package/dist/globalCallables.js.map +1 -1
  274. package/dist/index.d.ts +32 -4
  275. package/dist/index.js +54 -7
  276. package/dist/index.js.map +1 -1
  277. package/dist/interfaces.d.ts +942 -125
  278. package/dist/interfaces.js +21 -0
  279. package/dist/interfaces.js.map +1 -1
  280. package/dist/lexer/Character.spec.js +5 -5
  281. package/dist/lexer/Character.spec.js.map +1 -1
  282. package/dist/lexer/Lexer.d.ts +51 -12
  283. package/dist/lexer/Lexer.js +215 -65
  284. package/dist/lexer/Lexer.js.map +1 -1
  285. package/dist/lexer/Lexer.spec.js +812 -568
  286. package/dist/lexer/Lexer.spec.js.map +1 -1
  287. package/dist/lexer/Token.d.ts +27 -11
  288. package/dist/lexer/Token.js +10 -2
  289. package/dist/lexer/Token.js.map +1 -1
  290. package/dist/lexer/TokenKind.d.ts +40 -2
  291. package/dist/lexer/TokenKind.js +147 -10
  292. package/dist/lexer/TokenKind.js.map +1 -1
  293. package/dist/logging.d.ts +14 -0
  294. package/dist/logging.js +29 -0
  295. package/dist/logging.js.map +1 -0
  296. package/dist/lsp/ActionQueue.d.ts +35 -0
  297. package/dist/lsp/ActionQueue.js +115 -0
  298. package/dist/lsp/ActionQueue.js.map +1 -0
  299. package/dist/lsp/ActionQueue.spec.d.ts +1 -0
  300. package/dist/lsp/ActionQueue.spec.js +80 -0
  301. package/dist/lsp/ActionQueue.spec.js.map +1 -0
  302. package/dist/lsp/DocumentManager.d.ts +63 -0
  303. package/dist/lsp/DocumentManager.js +122 -0
  304. package/dist/lsp/DocumentManager.js.map +1 -0
  305. package/dist/lsp/DocumentManager.spec.d.ts +1 -0
  306. package/dist/lsp/DocumentManager.spec.js +103 -0
  307. package/dist/lsp/DocumentManager.spec.js.map +1 -0
  308. package/dist/lsp/LspProject.d.ts +239 -0
  309. package/dist/lsp/LspProject.js +3 -0
  310. package/dist/lsp/LspProject.js.map +1 -0
  311. package/dist/lsp/PathFilterer.d.ts +75 -0
  312. package/dist/lsp/PathFilterer.js +196 -0
  313. package/dist/lsp/PathFilterer.js.map +1 -0
  314. package/dist/lsp/PathFilterer.spec.d.ts +1 -0
  315. package/dist/lsp/PathFilterer.spec.js +182 -0
  316. package/dist/lsp/PathFilterer.spec.js.map +1 -0
  317. package/dist/lsp/Project.d.ts +168 -0
  318. package/dist/lsp/Project.js +437 -0
  319. package/dist/lsp/Project.js.map +1 -0
  320. package/dist/lsp/Project.spec.d.ts +1 -0
  321. package/dist/lsp/Project.spec.js +267 -0
  322. package/dist/lsp/Project.spec.js.map +1 -0
  323. package/dist/lsp/ProjectManager.d.ts +242 -0
  324. package/dist/lsp/ProjectManager.js +824 -0
  325. package/dist/lsp/ProjectManager.js.map +1 -0
  326. package/dist/lsp/ProjectManager.spec.d.ts +1 -0
  327. package/dist/lsp/ProjectManager.spec.js +913 -0
  328. package/dist/lsp/ProjectManager.spec.js.map +1 -0
  329. package/dist/lsp/ReaderWriterManager.d.ts +21 -0
  330. package/dist/lsp/ReaderWriterManager.js +60 -0
  331. package/dist/lsp/ReaderWriterManager.js.map +1 -0
  332. package/dist/lsp/worker/MessageHandler.d.ts +99 -0
  333. package/dist/lsp/worker/MessageHandler.js +138 -0
  334. package/dist/lsp/worker/MessageHandler.js.map +1 -0
  335. package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
  336. package/dist/lsp/worker/MessageHandler.spec.js +64 -0
  337. package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
  338. package/dist/lsp/worker/WorkerPool.d.ts +38 -0
  339. package/dist/lsp/worker/WorkerPool.js +78 -0
  340. package/dist/lsp/worker/WorkerPool.js.map +1 -0
  341. package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
  342. package/dist/lsp/worker/WorkerPool.spec.js +59 -0
  343. package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
  344. package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
  345. package/dist/lsp/worker/WorkerThreadProject.js +189 -0
  346. package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
  347. package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
  348. package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
  349. package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
  350. package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
  351. package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
  352. package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
  353. package/dist/lsp/worker/run.d.ts +1 -0
  354. package/dist/lsp/worker/run.js +14 -0
  355. package/dist/lsp/worker/run.js.map +1 -0
  356. package/dist/parser/AstNode.d.ts +203 -0
  357. package/dist/parser/AstNode.js +303 -0
  358. package/dist/parser/AstNode.js.map +1 -0
  359. package/dist/parser/AstNode.spec.d.ts +1 -0
  360. package/dist/parser/AstNode.spec.js +1455 -0
  361. package/dist/parser/AstNode.spec.js.map +1 -0
  362. package/dist/parser/BrightScriptDocParser.d.ts +56 -0
  363. package/dist/parser/BrightScriptDocParser.js +294 -0
  364. package/dist/parser/BrightScriptDocParser.js.map +1 -0
  365. package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
  366. package/dist/parser/BrightScriptDocParser.spec.js +310 -0
  367. package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
  368. package/dist/parser/BrsTranspileState.d.ts +22 -3
  369. package/dist/parser/BrsTranspileState.js +19 -0
  370. package/dist/parser/BrsTranspileState.js.map +1 -1
  371. package/dist/parser/Expression.d.ts +553 -221
  372. package/dist/parser/Expression.js +1414 -505
  373. package/dist/parser/Expression.js.map +1 -1
  374. package/dist/parser/Expression.spec.d.ts +1 -0
  375. package/dist/parser/Expression.spec.js +40 -0
  376. package/dist/parser/Expression.spec.js.map +1 -0
  377. package/dist/parser/Parser.Class.spec.js +255 -125
  378. package/dist/parser/Parser.Class.spec.js.map +1 -1
  379. package/dist/parser/Parser.d.ts +117 -124
  380. package/dist/parser/Parser.js +1669 -982
  381. package/dist/parser/Parser.js.map +1 -1
  382. package/dist/parser/Parser.spec.d.ts +3 -1
  383. package/dist/parser/Parser.spec.js +2111 -525
  384. package/dist/parser/Parser.spec.js.map +1 -1
  385. package/dist/parser/SGParser.d.ts +29 -13
  386. package/dist/parser/SGParser.js +85 -56
  387. package/dist/parser/SGParser.js.map +1 -1
  388. package/dist/parser/SGParser.spec.js +30 -45
  389. package/dist/parser/SGParser.spec.js.map +1 -1
  390. package/dist/parser/SGTypes.d.ts +134 -46
  391. package/dist/parser/SGTypes.js +206 -115
  392. package/dist/parser/SGTypes.js.map +1 -1
  393. package/dist/parser/Statement.d.ts +849 -267
  394. package/dist/parser/Statement.js +2412 -625
  395. package/dist/parser/Statement.js.map +1 -1
  396. package/dist/parser/Statement.spec.js +133 -36
  397. package/dist/parser/Statement.spec.js.map +1 -1
  398. package/dist/parser/TranspileState.d.ts +26 -12
  399. package/dist/parser/TranspileState.js +115 -24
  400. package/dist/parser/TranspileState.js.map +1 -1
  401. package/dist/parser/tests/Parser.spec.d.ts +3 -9
  402. package/dist/parser/tests/Parser.spec.js +7 -13
  403. package/dist/parser/tests/Parser.spec.js.map +1 -1
  404. package/dist/parser/tests/controlFlow/For.spec.js +83 -75
  405. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  406. package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
  407. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  408. package/dist/parser/tests/controlFlow/If.spec.js +382 -239
  409. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  410. package/dist/parser/tests/controlFlow/While.spec.js +52 -45
  411. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  412. package/dist/parser/tests/expression/Additive.spec.js +51 -43
  413. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  414. package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
  415. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  416. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
  417. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  418. package/dist/parser/tests/expression/Boolean.spec.js +41 -34
  419. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  420. package/dist/parser/tests/expression/Call.spec.js +173 -55
  421. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  422. package/dist/parser/tests/expression/Exponential.spec.js +20 -20
  423. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  424. package/dist/parser/tests/expression/Function.spec.js +291 -282
  425. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  426. package/dist/parser/tests/expression/Indexing.spec.js +193 -110
  427. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  428. package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
  429. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  430. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
  431. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  432. package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
  433. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  434. package/dist/parser/tests/expression/Primary.spec.js +76 -60
  435. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  436. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  437. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
  438. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  439. package/dist/parser/tests/expression/Relational.spec.js +50 -50
  440. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  441. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
  442. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  443. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +281 -94
  444. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  445. package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
  446. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  447. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  448. package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
  449. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  450. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  451. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  452. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  453. package/dist/parser/tests/statement/AssignmentOperators.spec.js +44 -44
  454. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  455. package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
  456. package/dist/parser/tests/statement/ConstStatement.spec.js +500 -0
  457. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
  458. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  459. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  460. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  461. package/dist/parser/tests/statement/Declaration.spec.js +61 -55
  462. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  463. package/dist/parser/tests/statement/Dim.spec.js +29 -22
  464. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  465. package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
  466. package/dist/parser/tests/statement/Enum.spec.js +744 -0
  467. package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
  468. package/dist/parser/tests/statement/For.spec.d.ts +1 -0
  469. package/dist/parser/tests/statement/For.spec.js +45 -0
  470. package/dist/parser/tests/statement/For.spec.js.map +1 -0
  471. package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
  472. package/dist/parser/tests/statement/ForEach.spec.js +36 -0
  473. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
  474. package/dist/parser/tests/statement/Function.spec.js +226 -215
  475. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  476. package/dist/parser/tests/statement/Goto.spec.js +16 -15
  477. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  478. package/dist/parser/tests/statement/Increment.spec.js +64 -61
  479. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  480. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  481. package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
  482. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  483. package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
  484. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  485. package/dist/parser/tests/statement/Misc.spec.js +127 -168
  486. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  487. package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
  488. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  489. package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
  490. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  491. package/dist/parser/tests/statement/Set.spec.js +131 -117
  492. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  493. package/dist/parser/tests/statement/Stop.spec.js +14 -13
  494. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  495. package/dist/parser/tests/statement/Throw.spec.js +11 -8
  496. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  497. package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
  498. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  499. package/dist/preprocessor/Manifest.d.ts +6 -6
  500. package/dist/preprocessor/Manifest.js +17 -38
  501. package/dist/preprocessor/Manifest.js.map +1 -1
  502. package/dist/preprocessor/Manifest.spec.d.ts +1 -0
  503. package/dist/preprocessor/Manifest.spec.js +78 -103
  504. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  505. package/dist/roku-types/data.json +20347 -0
  506. package/dist/roku-types/index.d.ts +5726 -0
  507. package/dist/roku-types/index.js +11 -0
  508. package/dist/roku-types/index.js.map +1 -0
  509. package/dist/types/ArrayType.d.ts +12 -5
  510. package/dist/types/ArrayType.js +89 -24
  511. package/dist/types/ArrayType.js.map +1 -1
  512. package/dist/types/ArrayType.spec.js +39 -11
  513. package/dist/types/ArrayType.spec.js.map +1 -1
  514. package/dist/types/AssociativeArrayType.d.ts +15 -0
  515. package/dist/types/AssociativeArrayType.js +64 -0
  516. package/dist/types/AssociativeArrayType.js.map +1 -0
  517. package/dist/types/BaseFunctionType.d.ts +10 -0
  518. package/dist/types/BaseFunctionType.js +26 -0
  519. package/dist/types/BaseFunctionType.js.map +1 -0
  520. package/dist/types/BooleanType.d.ts +9 -5
  521. package/dist/types/BooleanType.js +19 -8
  522. package/dist/types/BooleanType.js.map +1 -1
  523. package/dist/types/BooleanType.spec.js +10 -4
  524. package/dist/types/BooleanType.spec.js.map +1 -1
  525. package/dist/types/BscType.d.ts +41 -3
  526. package/dist/types/BscType.js +152 -0
  527. package/dist/types/BscType.js.map +1 -1
  528. package/dist/types/BscTypeKind.d.ts +28 -0
  529. package/dist/types/BscTypeKind.js +33 -0
  530. package/dist/types/BscTypeKind.js.map +1 -0
  531. package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
  532. package/dist/types/BuiltInInterfaceAdder.js +212 -0
  533. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  534. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  535. package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
  536. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  537. package/dist/types/CallFuncableType.d.ts +24 -0
  538. package/dist/types/CallFuncableType.js +91 -0
  539. package/dist/types/CallFuncableType.js.map +1 -0
  540. package/dist/types/ClassType.d.ts +17 -0
  541. package/dist/types/ClassType.js +60 -0
  542. package/dist/types/ClassType.js.map +1 -0
  543. package/dist/types/ClassType.spec.d.ts +1 -0
  544. package/dist/types/ClassType.spec.js +76 -0
  545. package/dist/types/ClassType.spec.js.map +1 -0
  546. package/dist/types/ComponentType.d.ts +22 -0
  547. package/dist/types/ComponentType.js +107 -0
  548. package/dist/types/ComponentType.js.map +1 -0
  549. package/dist/types/DoubleType.d.ts +10 -5
  550. package/dist/types/DoubleType.js +21 -17
  551. package/dist/types/DoubleType.js.map +1 -1
  552. package/dist/types/DoubleType.spec.js +12 -4
  553. package/dist/types/DoubleType.spec.js.map +1 -1
  554. package/dist/types/DynamicType.d.ts +13 -5
  555. package/dist/types/DynamicType.js +26 -5
  556. package/dist/types/DynamicType.js.map +1 -1
  557. package/dist/types/DynamicType.spec.js +16 -5
  558. package/dist/types/DynamicType.spec.js.map +1 -1
  559. package/dist/types/EnumType.d.ts +42 -0
  560. package/dist/types/EnumType.js +98 -0
  561. package/dist/types/EnumType.js.map +1 -0
  562. package/dist/types/EnumType.spec.d.ts +1 -0
  563. package/dist/types/EnumType.spec.js +33 -0
  564. package/dist/types/EnumType.spec.js.map +1 -0
  565. package/dist/types/FloatType.d.ts +10 -5
  566. package/dist/types/FloatType.js +21 -17
  567. package/dist/types/FloatType.js.map +1 -1
  568. package/dist/types/FloatType.spec.js +4 -4
  569. package/dist/types/FloatType.spec.js.map +1 -1
  570. package/dist/types/FunctionType.d.ts +8 -22
  571. package/dist/types/FunctionType.js +25 -63
  572. package/dist/types/FunctionType.js.map +1 -1
  573. package/dist/types/InheritableType.d.ts +29 -0
  574. package/dist/types/InheritableType.js +173 -0
  575. package/dist/types/InheritableType.js.map +1 -0
  576. package/dist/types/InlineInterfaceType.d.ts +5 -0
  577. package/dist/types/InlineInterfaceType.js +17 -0
  578. package/dist/types/InlineInterfaceType.js.map +1 -0
  579. package/dist/types/IntegerType.d.ts +10 -5
  580. package/dist/types/IntegerType.js +21 -17
  581. package/dist/types/IntegerType.js.map +1 -1
  582. package/dist/types/IntegerType.spec.js +8 -4
  583. package/dist/types/IntegerType.spec.js.map +1 -1
  584. package/dist/types/InterfaceType.d.ts +14 -6
  585. package/dist/types/InterfaceType.js +30 -15
  586. package/dist/types/InterfaceType.js.map +1 -1
  587. package/dist/types/InterfaceType.spec.d.ts +1 -0
  588. package/dist/types/InterfaceType.spec.js +227 -0
  589. package/dist/types/InterfaceType.spec.js.map +1 -0
  590. package/dist/types/IntersectionType.d.ts +29 -0
  591. package/dist/types/IntersectionType.js +253 -0
  592. package/dist/types/IntersectionType.js.map +1 -0
  593. package/dist/types/IntersectionType.spec.d.ts +1 -0
  594. package/dist/types/IntersectionType.spec.js +150 -0
  595. package/dist/types/IntersectionType.spec.js.map +1 -0
  596. package/dist/types/InvalidType.d.ts +10 -5
  597. package/dist/types/InvalidType.js +21 -9
  598. package/dist/types/InvalidType.js.map +1 -1
  599. package/dist/types/InvalidType.spec.js +8 -4
  600. package/dist/types/InvalidType.spec.js.map +1 -1
  601. package/dist/types/LongIntegerType.d.ts +10 -5
  602. package/dist/types/LongIntegerType.js +21 -17
  603. package/dist/types/LongIntegerType.js.map +1 -1
  604. package/dist/types/LongIntegerType.spec.js +10 -4
  605. package/dist/types/LongIntegerType.spec.js.map +1 -1
  606. package/dist/types/NamespaceType.d.ts +12 -0
  607. package/dist/types/NamespaceType.js +28 -0
  608. package/dist/types/NamespaceType.js.map +1 -0
  609. package/dist/types/ObjectType.d.ts +12 -5
  610. package/dist/types/ObjectType.js +25 -8
  611. package/dist/types/ObjectType.js.map +1 -1
  612. package/dist/types/ObjectType.spec.js +3 -3
  613. package/dist/types/ObjectType.spec.js.map +1 -1
  614. package/dist/types/ReferenceType.d.ts +123 -0
  615. package/dist/types/ReferenceType.js +720 -0
  616. package/dist/types/ReferenceType.js.map +1 -0
  617. package/dist/types/ReferenceType.spec.d.ts +1 -0
  618. package/dist/types/ReferenceType.spec.js +151 -0
  619. package/dist/types/ReferenceType.spec.js.map +1 -0
  620. package/dist/types/StringType.d.ts +12 -5
  621. package/dist/types/StringType.js +23 -8
  622. package/dist/types/StringType.js.map +1 -1
  623. package/dist/types/StringType.spec.js +3 -3
  624. package/dist/types/StringType.spec.js.map +1 -1
  625. package/dist/types/TypeStatementType.d.ts +18 -0
  626. package/dist/types/TypeStatementType.js +45 -0
  627. package/dist/types/TypeStatementType.js.map +1 -0
  628. package/dist/types/TypedFunctionType.d.ts +34 -0
  629. package/dist/types/TypedFunctionType.js +147 -0
  630. package/dist/types/TypedFunctionType.js.map +1 -0
  631. package/dist/types/TypedFunctionType.spec.d.ts +1 -0
  632. package/dist/types/TypedFunctionType.spec.js +122 -0
  633. package/dist/types/TypedFunctionType.spec.js.map +1 -0
  634. package/dist/types/UninitializedType.d.ts +11 -6
  635. package/dist/types/UninitializedType.js +20 -11
  636. package/dist/types/UninitializedType.js.map +1 -1
  637. package/dist/types/UnionType.d.ts +27 -0
  638. package/dist/types/UnionType.js +193 -0
  639. package/dist/types/UnionType.js.map +1 -0
  640. package/dist/types/UnionType.spec.d.ts +1 -0
  641. package/dist/types/UnionType.spec.js +205 -0
  642. package/dist/types/UnionType.spec.js.map +1 -0
  643. package/dist/types/VoidType.d.ts +11 -5
  644. package/dist/types/VoidType.js +22 -8
  645. package/dist/types/VoidType.js.map +1 -1
  646. package/dist/types/VoidType.spec.js +3 -3
  647. package/dist/types/VoidType.spec.js.map +1 -1
  648. package/dist/types/helper.spec.d.ts +1 -0
  649. package/dist/types/helper.spec.js +174 -0
  650. package/dist/types/helper.spec.js.map +1 -0
  651. package/dist/types/helpers.d.ts +51 -0
  652. package/dist/types/helpers.js +323 -0
  653. package/dist/types/helpers.js.map +1 -0
  654. package/dist/types/index.d.ts +22 -0
  655. package/dist/types/index.js +39 -0
  656. package/dist/types/index.js.map +1 -0
  657. package/dist/types/roFunctionType.d.ts +11 -0
  658. package/dist/types/roFunctionType.js +37 -0
  659. package/dist/types/roFunctionType.js.map +1 -0
  660. package/dist/types/roFunctionType.spec.d.ts +1 -0
  661. package/dist/types/roFunctionType.spec.js +20 -0
  662. package/dist/types/roFunctionType.spec.js.map +1 -0
  663. package/dist/util.d.ts +288 -187
  664. package/dist/util.js +2018 -575
  665. package/dist/util.js.map +1 -1
  666. package/dist/validators/ClassValidator.d.ts +9 -15
  667. package/dist/validators/ClassValidator.js +93 -138
  668. package/dist/validators/ClassValidator.js.map +1 -1
  669. package/package.json +185 -138
  670. package/CHANGELOG.md +0 -1188
  671. package/dist/astUtils/index.d.ts +0 -7
  672. package/dist/astUtils/index.js +0 -26
  673. package/dist/astUtils/index.js.map +0 -1
  674. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
  675. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
  676. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
  677. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
  678. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
  679. package/dist/lexer/index.d.ts +0 -3
  680. package/dist/lexer/index.js +0 -17
  681. package/dist/lexer/index.js.map +0 -1
  682. package/dist/parser/SGTypes.spec.js +0 -351
  683. package/dist/parser/SGTypes.spec.js.map +0 -1
  684. package/dist/parser/index.d.ts +0 -3
  685. package/dist/parser/index.js +0 -16
  686. package/dist/parser/index.js.map +0 -1
  687. package/dist/preprocessor/Chunk.d.ts +0 -82
  688. package/dist/preprocessor/Chunk.js +0 -77
  689. package/dist/preprocessor/Chunk.js.map +0 -1
  690. package/dist/preprocessor/Preprocessor.d.ts +0 -60
  691. package/dist/preprocessor/Preprocessor.js +0 -156
  692. package/dist/preprocessor/Preprocessor.js.map +0 -1
  693. package/dist/preprocessor/Preprocessor.spec.js +0 -152
  694. package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
  695. package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
  696. package/dist/preprocessor/PreprocessorParser.js +0 -194
  697. package/dist/preprocessor/PreprocessorParser.js.map +0 -1
  698. package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
  699. package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
  700. package/dist/preprocessor/index.d.ts +0 -3
  701. package/dist/preprocessor/index.js +0 -16
  702. package/dist/preprocessor/index.js.map +0 -1
  703. package/dist/types/CustomType.d.ts +0 -10
  704. package/dist/types/CustomType.js +0 -35
  705. package/dist/types/CustomType.js.map +0 -1
  706. package/dist/types/FunctionType.spec.js +0 -29
  707. package/dist/types/FunctionType.spec.js.map +0 -1
  708. package/dist/types/LazyType.d.ts +0 -15
  709. package/dist/types/LazyType.js +0 -32
  710. package/dist/types/LazyType.js.map +0 -1
  711. /package/dist/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
  712. /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
  713. /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
  714. /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
  715. /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
@@ -6,264 +6,284 @@ const ArrayType_1 = require("./types/ArrayType");
6
6
  const BooleanType_1 = require("./types/BooleanType");
7
7
  const DynamicType_1 = require("./types/DynamicType");
8
8
  const FloatType_1 = require("./types/FloatType");
9
- const FunctionType_1 = require("./types/FunctionType");
9
+ const TypedFunctionType_1 = require("./types/TypedFunctionType");
10
10
  const IntegerType_1 = require("./types/IntegerType");
11
11
  const ObjectType_1 = require("./types/ObjectType");
12
12
  const StringType_1 = require("./types/StringType");
13
13
  const VoidType_1 = require("./types/VoidType");
14
14
  const util_1 = require("./util");
15
- exports.globalFile = new BrsFile_1.BrsFile('global', 'global', null);
15
+ const UnionType_1 = require("./types/UnionType");
16
+ exports.globalFile = new BrsFile_1.BrsFile({ srcPath: 'global', destPath: 'global', program: null });
16
17
  exports.globalFile.parse('');
17
18
  let mathFunctions = [{
18
19
  name: 'Abs',
19
20
  shortDescription: 'Returns the absolute value of the argument.',
20
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
21
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
21
22
  file: exports.globalFile,
22
23
  params: [{
23
24
  name: 'x',
24
- type: new FloatType_1.FloatType()
25
+ type: FloatType_1.FloatType.instance,
26
+ isOptional: false
25
27
  }]
26
28
  }, {
27
29
  name: 'Atn',
28
30
  shortDescription: 'Returns the arctangent (in radians) of the argument.',
29
31
  documentation: '`ATN(X)` returns "the angle whose tangent is X". To get arctangent in degrees, multiply `ATN(X)` by `57.29578`.',
30
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
32
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
31
33
  file: exports.globalFile,
32
34
  params: [{
33
35
  name: 'x',
34
- type: new FloatType_1.FloatType()
36
+ type: FloatType_1.FloatType.instance,
37
+ isOptional: false
35
38
  }]
36
39
  }, {
37
40
  name: 'Cdbl',
38
41
  shortDescription: 'Returns a single precision float representation of the argument. Someday may return double.',
39
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
42
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
40
43
  file: exports.globalFile,
41
44
  params: [{
42
45
  name: 'x',
43
- type: new IntegerType_1.IntegerType()
46
+ type: IntegerType_1.IntegerType.instance,
47
+ isOptional: false
44
48
  }]
45
49
  }, {
46
50
  name: 'Cint',
47
51
  shortDescription: 'Returns an integer representation of the argument, rounding up from midpoints. CINT(2.1) returns 2; CINT(2.5) returns 3; CINT(-2.2) returns -2; CINT(-2.5) returns -2; CINT(-2.6) returns -3.',
48
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
52
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
49
53
  file: exports.globalFile,
50
54
  params: [{
51
55
  name: 'x',
52
- type: new FloatType_1.FloatType()
56
+ type: FloatType_1.FloatType.instance,
57
+ isOptional: false
53
58
  }]
54
59
  }, {
55
60
  name: 'Cos',
56
61
  shortDescription: 'Returns the cosine of the argument (argument must be in radians). To obtain the cosine of X when X is in degrees, use CGS(X*.01745329).',
57
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
62
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
58
63
  file: exports.globalFile,
59
64
  params: [{
60
65
  name: 'x',
61
- type: new FloatType_1.FloatType()
66
+ type: FloatType_1.FloatType.instance,
67
+ isOptional: false
62
68
  }]
63
69
  }, {
64
70
  name: 'Csng',
65
71
  shortDescription: 'Returns a single-precision float representation of the argument.',
66
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
72
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
67
73
  file: exports.globalFile,
68
74
  params: [{
69
75
  name: 'x',
70
- type: new IntegerType_1.IntegerType()
76
+ type: IntegerType_1.IntegerType.instance,
77
+ isOptional: false
71
78
  }]
72
79
  }, {
73
80
  name: 'Exp',
74
81
  shortDescription: 'Returns the "natural exponential" of X, that is, ex. This is the inverse of the LOG function, so X=EXP(LOG(X)).',
75
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
82
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
76
83
  file: exports.globalFile,
77
84
  params: [{
78
85
  name: 'x',
79
- type: new FloatType_1.FloatType()
86
+ type: FloatType_1.FloatType.instance,
87
+ isOptional: false
80
88
  }]
81
89
  }, {
82
90
  name: 'Fix',
83
91
  shortDescription: 'Returns a truncated representation of the argument. All digits to the right of the decimal point are simply chopped off, so the resultant value is an integer. For non-negative X, FIX(X)=lNT(X). For negative values of X, FIX(X)=INT(X)+1. For example, FIX(2.2) returns 2, and FIX(-2.2) returns -2.',
84
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
92
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
85
93
  file: exports.globalFile,
86
94
  params: [{
87
95
  name: 'x',
88
- type: new FloatType_1.FloatType()
96
+ type: FloatType_1.FloatType.instance,
97
+ isOptional: false
89
98
  }]
90
99
  }, {
91
100
  name: 'Int',
92
101
  shortDescription: 'Returns an integer representation of the argument, using the largest whole number that is not greater than the argument.. INT(2.5) returns 2; INT(-2.5) returns -3; and INT(1000101.23) returns 10000101.',
93
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
102
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
94
103
  file: exports.globalFile,
95
104
  params: [{
96
105
  name: 'x',
97
- type: new FloatType_1.FloatType()
106
+ type: FloatType_1.FloatType.instance,
107
+ isOptional: false
98
108
  }]
99
109
  }, {
100
110
  name: 'Log',
101
111
  shortDescription: 'Returns the natural logarithm of the argument, that is, loge(x) or ln(x). This is the inverse of the EXP function, so LOG(EXP(X)) = X. To find the logarithm of a number to another base b, use the formula logb(X) = loge(X) / loge(b). For example, LOG(32767) / LOG(2) returns the logarithm to base 2 of 32767.',
102
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
112
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
103
113
  file: exports.globalFile,
104
114
  params: [{
105
115
  name: 'x',
106
- type: new FloatType_1.FloatType()
116
+ type: FloatType_1.FloatType.instance,
117
+ isOptional: false
107
118
  }]
108
119
  }, {
109
120
  name: 'Rnd',
110
121
  shortDescription: 'Generates a pseudo-random number using the current pseudo-random "seed number" (generated internally and not accessible to user).returns an integer between 1 and integer inclusive . For example, RND(55) returns a pseudo-random integer greater than zero and less than 56.',
111
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
122
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
112
123
  file: exports.globalFile,
113
124
  params: [{
114
125
  name: 'range',
115
- type: new IntegerType_1.IntegerType()
126
+ type: IntegerType_1.IntegerType.instance,
127
+ isOptional: false
116
128
  }]
117
129
  }, {
118
130
  name: 'Rnd',
119
131
  shortDescription: 'Generates a pseudo-random number using the current pseudo-random "seed number" (generated internally and not accessible to user). Returns a float value between 0 and 1.',
120
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
132
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
121
133
  file: exports.globalFile,
122
134
  params: [{
123
135
  name: '0',
124
- type: new IntegerType_1.IntegerType()
136
+ type: IntegerType_1.IntegerType.instance,
137
+ isOptional: false
125
138
  }]
126
139
  }, {
127
140
  name: 'Sgn',
128
141
  shortDescription: 'The "sign" function: returns -1 for X negative, 0 for X zero, and +1 for X positive.',
129
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
142
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
130
143
  file: exports.globalFile,
131
144
  params: [{
132
145
  name: 'x',
133
- type: new FloatType_1.FloatType()
146
+ type: FloatType_1.FloatType.instance,
147
+ isOptional: false
134
148
  }]
135
149
  }, {
136
150
  name: 'Sgn',
137
151
  shortDescription: 'The "sign" function: returns -1 for X negative, 0 for X zero, and +1 for X positive.',
138
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
152
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
139
153
  file: exports.globalFile,
140
154
  params: [{
141
155
  name: 'x',
142
- type: new IntegerType_1.IntegerType()
156
+ type: IntegerType_1.IntegerType.instance,
157
+ isOptional: false
143
158
  }]
144
159
  }, {
145
160
  name: 'Sin',
146
161
  shortDescription: 'Returns the sine of the argument (argument must be in radians). To obtain the sine of X when X is in degrees, use SIN(X*.01745329).',
147
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
162
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
148
163
  file: exports.globalFile,
149
164
  params: [{
150
165
  name: 'x',
151
- type: new FloatType_1.FloatType()
166
+ type: FloatType_1.FloatType.instance,
167
+ isOptional: false
152
168
  }]
153
169
  }, {
154
170
  name: 'Sqr',
155
171
  shortDescription: 'Returns the square root of the argument. SQR(X) is the same as X ^ (1/2), only faster.',
156
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
172
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
157
173
  file: exports.globalFile,
158
174
  params: [{
159
175
  name: 'x',
160
- type: new FloatType_1.FloatType()
176
+ type: FloatType_1.FloatType.instance,
177
+ isOptional: false
161
178
  }]
162
179
  }, {
163
180
  name: 'Tan',
164
181
  shortDescription: 'Returns the tangent of the argument (argument must be in radians). To obtain the tangent of X when X is in degrees, use TAN(X*.01745329).',
165
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
182
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
166
183
  file: exports.globalFile,
167
184
  params: [{
168
185
  name: 'x',
169
- type: new FloatType_1.FloatType()
186
+ type: FloatType_1.FloatType.instance,
187
+ isOptional: false
170
188
  }]
171
189
  }];
172
190
  let runtimeFunctions = [{
173
191
  name: 'CreateObject',
174
192
  shortDescription: 'Creates a BrightScript Component of class classname specified. Return invalid if the object creation fails. Some Objects have optional parameters in their constructor that are passed after name.',
175
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
193
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
176
194
  file: exports.globalFile,
177
195
  params: [{
178
196
  name: 'name',
179
- type: new StringType_1.StringType()
197
+ type: StringType_1.StringType.instance,
198
+ isOptional: false
180
199
  }, {
181
200
  name: 'param2',
182
- type: new DynamicType_1.DynamicType(),
201
+ type: DynamicType_1.DynamicType.instance,
183
202
  isOptional: true
184
203
  }, {
185
204
  name: 'param3',
186
- type: new DynamicType_1.DynamicType(),
205
+ type: DynamicType_1.DynamicType.instance,
187
206
  isOptional: true
188
207
  }, {
189
208
  name: 'param4',
190
- type: new DynamicType_1.DynamicType(),
209
+ type: DynamicType_1.DynamicType.instance,
210
+ isOptional: true
211
+ }, {
212
+ name: 'param5',
213
+ type: DynamicType_1.DynamicType.instance,
214
+ isOptional: true
215
+ }, {
216
+ name: 'param6',
217
+ type: DynamicType_1.DynamicType.instance,
191
218
  isOptional: true
192
219
  }]
193
220
  }, {
194
221
  name: 'Type',
195
222
  shortDescription: 'Returns the type of a variable and/or object. See the BrightScript Component specification for a list of types.',
196
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
223
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
197
224
  file: exports.globalFile,
198
225
  params: [{
199
226
  name: 'variable',
200
- type: new ObjectType_1.ObjectType()
227
+ type: ObjectType_1.ObjectType.instance,
228
+ isOptional: false
201
229
  }, {
202
230
  name: 'version',
203
- type: new StringType_1.StringType(),
231
+ type: IntegerType_1.IntegerType.instance,
204
232
  isOptional: true
205
233
  }]
206
234
  }, {
207
235
  name: 'GetGlobalAA',
208
236
  shortDescription: 'Each script has a global Associative Array. It can be fetched with this function. ',
209
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
237
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
210
238
  file: exports.globalFile,
211
239
  params: []
212
240
  }, {
213
241
  name: 'Box',
214
242
  shortDescription: 'Box() will return an object version of an intrinsic type, or pass through an object if given one.',
215
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
243
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
216
244
  file: exports.globalFile,
217
245
  params: [{
218
246
  name: 'x',
219
- type: new DynamicType_1.DynamicType()
220
- }]
221
- }, {
222
- name: 'Run',
223
- shortDescription: `The Run function can be used to compile and run a script dynamically.\nThe file specified by that path is compiled and run.\nArguments may be passed to the script's Main function, and that script may return a result value.'`,
224
- type: new FunctionType_1.FunctionType(new DynamicType_1.DynamicType()),
225
- file: exports.globalFile,
226
- params: [{
227
- name: 'filename',
228
- type: new StringType_1.StringType()
229
- }, {
230
- name: 'arg',
231
- type: new DynamicType_1.DynamicType(),
232
- isRestArgument: true
247
+ type: DynamicType_1.DynamicType.instance,
248
+ isOptional: false
233
249
  }]
234
250
  }, {
235
251
  name: 'Run',
236
252
  shortDescription: `The Run function can be used to compile and run a script dynamically.\nAll files specified are compiled together, then run.\nArguments may be passed to the script's Main function, and that script may return a result value.'`,
237
- type: new FunctionType_1.FunctionType(new DynamicType_1.DynamicType()),
253
+ type: new TypedFunctionType_1.TypedFunctionType(DynamicType_1.DynamicType.instance),
238
254
  file: exports.globalFile,
255
+ isDeprecated: true,
239
256
  params: [{
240
257
  name: 'filename',
241
- type: new ArrayType_1.ArrayType(new StringType_1.StringType())
258
+ type: new UnionType_1.UnionType([new ArrayType_1.ArrayType(StringType_1.StringType.instance), StringType_1.StringType.instance]),
259
+ isOptional: false
242
260
  }, {
243
261
  name: 'arg',
244
- type: new DynamicType_1.DynamicType(),
245
- isRestArgument: true
262
+ type: DynamicType_1.DynamicType.instance,
263
+ isRestArgument: true,
264
+ isOptional: true
246
265
  }]
247
266
  }, {
248
267
  name: 'Eval',
249
268
  shortDescription: `Eval can be used to run a code snippet in the context of the current function. It performs a compile, and then the bytecode execution.\nIf a compilation error occurs, no bytecode execution is performed, and Eval returns an roList with one or more compile errors. Each list entry is an roAssociativeArray with ERRNO and ERRSTR keys describing the error.\nIf compilation succeeds, bytecode execution is performed and the integer runtime error code is returned. These are the same error codes as returned by GetLastRunRuntimeError().\nEval() can be usefully in two cases. The first is when you need to dynamically generate code at runtime.\nThe other is if you need to execute a statement that could result in a runtime error, but you don't want code execution to stop. '`,
250
- type: new FunctionType_1.FunctionType(new DynamicType_1.DynamicType()),
269
+ type: new TypedFunctionType_1.TypedFunctionType(DynamicType_1.DynamicType.instance),
251
270
  file: exports.globalFile,
252
271
  isDeprecated: true,
253
272
  params: [{
254
273
  name: 'code',
255
- type: new StringType_1.StringType()
274
+ type: StringType_1.StringType.instance,
275
+ isOptional: false
256
276
  }]
257
277
  }, {
258
278
  name: 'GetLastRunCompileError',
259
279
  shortDescription: 'Returns an roList of compile errors, or invalid if no errors. Each list entry is an roAssociativeArray with the keys: ERRNO, ERRSTR, FILESPEC, and LINENO.',
260
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
280
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
261
281
  file: exports.globalFile,
262
282
  params: []
263
283
  }, {
264
284
  name: 'GetLastRunRuntimeError',
265
285
  shortDescription: 'Returns an error code result after the last script Run().These are normal:\\,&hFF==ERR_OKAY\\n&hFC==ERR_NORMAL_END\\n&hE2==ERR_VALUE_RETURN',
266
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
286
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
267
287
  file: exports.globalFile,
268
288
  params: []
269
289
  }];
@@ -271,116 +291,132 @@ let globalUtilityFunctions = [
271
291
  {
272
292
  name: 'Sleep',
273
293
  shortDescription: 'This function causes the script to pause for the specified time, without wasting CPU cycles. There are 1000 milliseconds in one second.',
274
- type: new FunctionType_1.FunctionType(new VoidType_1.VoidType()),
294
+ type: new TypedFunctionType_1.TypedFunctionType(VoidType_1.VoidType.instance),
275
295
  file: exports.globalFile,
276
296
  params: [{
277
297
  name: 'milliseconds',
278
- type: new IntegerType_1.IntegerType()
298
+ type: IntegerType_1.IntegerType.instance,
299
+ isOptional: false
279
300
  }]
280
301
  }, {
281
302
  name: 'Wait',
282
303
  shortDescription: 'This function waits on objects that are "waitable" (those that have a MessagePort interface). Wait() returns the event object that was posted to the message port. If timeout is zero, "wait" will wait for ever. Otherwise, Wait will return after timeout milliseconds if no messages are received. In this case, Wait returns a type "invalid".',
283
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
304
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
284
305
  file: exports.globalFile,
285
306
  params: [{
286
307
  name: 'timeout',
287
- type: new IntegerType_1.IntegerType()
308
+ type: IntegerType_1.IntegerType.instance,
309
+ isOptional: false
288
310
  }, {
289
311
  name: 'port',
290
- type: new ObjectType_1.ObjectType()
312
+ type: ObjectType_1.ObjectType.instance,
313
+ isOptional: false
291
314
  }]
292
315
  }, {
293
316
  name: 'GetInterface',
294
317
  shortDescription: 'Each BrightScript Component has one or more interfaces. This function returns a value of type "Interface". \nNote that generally BrightScript Components allow you to skip the interface specification. In which case, the appropriate interface within the object is used. This works as long as the function names within the interfaces are unique.',
295
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
318
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
296
319
  file: exports.globalFile,
297
320
  params: [{
298
321
  name: 'object',
299
- type: new ObjectType_1.ObjectType()
322
+ type: ObjectType_1.ObjectType.instance,
323
+ isOptional: false
300
324
  }, {
301
325
  name: 'ifname',
302
- type: new StringType_1.StringType()
326
+ type: StringType_1.StringType.instance,
327
+ isOptional: false
303
328
  }]
304
329
  }, {
305
330
  name: 'FindMemberFunction',
306
331
  shortDescription: 'Returns the interface from the object that provides the specified function, or invalid if not found.',
307
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
332
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
308
333
  file: exports.globalFile,
309
334
  params: [{
310
335
  name: 'object',
311
- type: new ObjectType_1.ObjectType()
336
+ type: ObjectType_1.ObjectType.instance,
337
+ isOptional: false
312
338
  }, {
313
339
  name: 'functionName',
314
- type: new StringType_1.StringType()
340
+ type: StringType_1.StringType.instance,
341
+ isOptional: false
315
342
  }]
316
343
  }, {
317
344
  name: 'UpTime',
318
345
  shortDescription: 'Returns the uptime of the system since the last reboot in seconds.',
319
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
346
+ type: new TypedFunctionType_1.TypedFunctionType(FloatType_1.FloatType.instance),
320
347
  file: exports.globalFile,
321
348
  params: [{
322
349
  name: 'dummy',
323
- type: new IntegerType_1.IntegerType()
350
+ type: IntegerType_1.IntegerType.instance,
351
+ isOptional: false
324
352
  }]
325
353
  }, {
326
354
  name: 'RebootSystem',
327
355
  shortDescription: 'Requests the system to perform a soft reboot. The Roku platform has disabled this feature.',
328
- type: new FunctionType_1.FunctionType(new VoidType_1.VoidType()),
356
+ type: new TypedFunctionType_1.TypedFunctionType(VoidType_1.VoidType.instance),
329
357
  file: exports.globalFile,
330
358
  params: []
331
359
  }, {
332
360
  name: 'ListDir',
333
361
  shortDescription: 'Returns a List object containing the contents of the directory path specified.',
334
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
362
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
335
363
  file: exports.globalFile,
336
364
  params: [{
337
365
  name: 'path',
338
- type: new StringType_1.StringType()
366
+ type: StringType_1.StringType.instance,
367
+ isOptional: false
339
368
  }]
340
369
  }, {
341
370
  name: 'ReadAsciiFile',
342
371
  shortDescription: 'This function reads the specified file and returns the data as a string.\nThe file can be encoded as either UTF-8 (which includes the 7-bit ASCII subset) or UTF-16.\nAn empty string is returned if the file can not be read.',
343
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
372
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
344
373
  file: exports.globalFile,
345
374
  params: [{
346
375
  name: 'filePath',
347
- type: new StringType_1.StringType()
376
+ type: StringType_1.StringType.instance,
377
+ isOptional: false
348
378
  }]
349
379
  }, {
350
380
  name: 'WriteAsciiFile',
351
381
  shortDescription: 'This function writes the specified string data to a file at the specified location.\nThe string data is written as UTF-8 encoded (which includes the 7-bit ASCII subset).\nThe function returns true if the file was successfully written.',
352
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
382
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
353
383
  file: exports.globalFile,
354
384
  params: [{
355
385
  name: 'filePath',
356
- type: new StringType_1.StringType()
386
+ type: StringType_1.StringType.instance,
387
+ isOptional: false
357
388
  }, {
358
389
  name: 'text',
359
- type: new StringType_1.StringType()
390
+ type: StringType_1.StringType.instance,
391
+ isOptional: false
360
392
  }]
361
393
  }, {
362
394
  name: 'CopyFile',
363
395
  shortDescription: 'Make a copy of a file.',
364
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
396
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
365
397
  file: exports.globalFile,
366
398
  params: [{
367
399
  name: 'source',
368
- type: new StringType_1.StringType()
400
+ type: StringType_1.StringType.instance,
401
+ isOptional: false
369
402
  }, {
370
403
  name: 'destination',
371
- type: new StringType_1.StringType()
404
+ type: StringType_1.StringType.instance,
405
+ isOptional: false
372
406
  }]
373
407
  }, {
374
408
  name: 'MoveFile',
375
409
  shortDescription: 'Rename a file.',
376
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
410
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
377
411
  file: exports.globalFile,
378
412
  params: [{
379
413
  name: 'source',
380
- type: new StringType_1.StringType()
414
+ type: StringType_1.StringType.instance,
415
+ isOptional: false
381
416
  }, {
382
417
  name: 'destination',
383
- type: new StringType_1.StringType()
418
+ type: StringType_1.StringType.instance,
419
+ isOptional: false
384
420
  }]
385
421
  }, {
386
422
  name: 'MatchFiles',
@@ -395,67 +431,75 @@ A '*' matches zero or more arbitrary characters.
395
431
  The character class '[...]' matches any single character specified within the brackets. The closing bracket is treated as a member of the character class if it immediately follows the opening bracket. i.e. '[]]' matches a single close bracket. Within the class '-' can be used to specify a range unless it is the first or last character. e.g. '[A-Cf-h]' is equivalent to '[ABCfgh]'.
396
432
  A character class can be negated by specifying '^' as the first character. To match a literal '^' place it elsewhere within the class.
397
433
  The characters '?', '*' and '[' lose their special meaning if preceded by a single '\\'. A single '\\' can be matched as '\\\\'.`,
398
- type: new FunctionType_1.FunctionType(new ArrayType_1.ArrayType(new StringType_1.StringType())),
434
+ type: new TypedFunctionType_1.TypedFunctionType(new ArrayType_1.ArrayType(StringType_1.StringType.instance)),
399
435
  file: exports.globalFile,
400
436
  params: [{
401
437
  name: 'path',
402
- type: new StringType_1.StringType()
438
+ type: StringType_1.StringType.instance,
439
+ isOptional: false
403
440
  }, {
404
441
  name: 'pattern_in',
405
- type: new StringType_1.StringType()
442
+ type: StringType_1.StringType.instance,
443
+ isOptional: false
406
444
  }]
407
445
  }, {
408
446
  name: 'DeleteFile',
409
447
  shortDescription: 'Delete the specified file.',
410
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
448
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
411
449
  file: exports.globalFile,
412
450
  params: [{
413
451
  name: 'file',
414
- type: new StringType_1.StringType()
452
+ type: StringType_1.StringType.instance,
453
+ isOptional: false
415
454
  }]
416
455
  }, {
417
456
  name: 'DeleteDirectory',
418
457
  shortDescription: 'Deletes the specified directory. It is only possible to delete an empty directory.',
419
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
458
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
420
459
  file: exports.globalFile,
421
460
  params: [{
422
461
  name: 'dir',
423
- type: new StringType_1.StringType()
462
+ type: StringType_1.StringType.instance,
463
+ isOptional: false
424
464
  }]
425
465
  }, {
426
466
  name: 'CreateDirectory',
427
467
  shortDescription: 'Creates the specified Directory. Only one directory can be created at a time',
428
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
468
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
429
469
  file: exports.globalFile,
430
470
  params: [{
431
471
  name: 'dir',
432
- type: new StringType_1.StringType()
472
+ type: StringType_1.StringType.instance,
473
+ isOptional: false
433
474
  }]
434
475
  }, {
435
476
  name: 'FormatDrive',
436
477
  shortDescription: 'Formats a specified drive using the specified filesystem.',
437
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
478
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
438
479
  file: exports.globalFile,
439
480
  params: [{
440
481
  name: 'drive',
441
- type: new StringType_1.StringType()
482
+ type: StringType_1.StringType.instance,
483
+ isOptional: false
442
484
  }, {
443
485
  name: 'fs_type',
444
- type: new StringType_1.StringType()
486
+ type: StringType_1.StringType.instance,
487
+ isOptional: false
445
488
  }]
446
489
  }, {
447
490
  name: 'StrToI',
448
491
  shortDescription: 'Return the integer value of the string, or 0 if nothing is parsed.',
449
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
492
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
450
493
  file: exports.globalFile,
451
494
  params: [{
452
495
  name: 'str',
453
- type: new StringType_1.StringType()
496
+ type: StringType_1.StringType.instance,
497
+ isOptional: false
454
498
  }]
455
499
  }, {
456
500
  name: 'RunGarbageCollector',
457
501
  shortDescription: `This function runs the garbage collector. It returns and Associative Array with some statistics regarding the garbage collection. \nSee the Garbage Collection section of the manual for more detail. You don't normally need to call this function.`,
458
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
502
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
459
503
  file: exports.globalFile,
460
504
  params: []
461
505
  }, {
@@ -465,15 +509,16 @@ The characters '?', '*' and '[' lose their special meaning if preceded by a sing
465
509
  Any roAssociativeArray objects in the returned objects will be case sensitive. As of Roku OS 9.4, to return a case-insensitive structure, set the flags parameter to "i".
466
510
  If the "i" option is used, and the jsonString includes multiple keys that match case-insensitively, duplicates are overwritten and only the last matching values are preserved.
467
511
  An error will be returned if arrays/associative arrays are nested more than 256 levels deep.`,
468
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
512
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
469
513
  file: exports.globalFile,
470
514
  params: [{
471
515
  name: 'jsonString',
472
- type: new StringType_1.StringType()
516
+ type: StringType_1.StringType.instance,
517
+ isOptional: false
473
518
  },
474
519
  {
475
520
  name: 'flags',
476
- type: new StringType_1.StringType(),
521
+ type: StringType_1.StringType.instance,
477
522
  isOptional: true
478
523
  }]
479
524
  }, {
@@ -487,14 +532,15 @@ An error will be returned if arrays/associative arrays are nested more than 256
487
532
  If an error occurs an empty string will be returned.
488
533
 
489
534
  Normally non-ASCII characters are escaped in the output string as "\\uXXXX" where XXXX is the hexadecimal representation of the Unicode character value. If flags=1, non-ASCII characters are not escaped.`,
490
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
535
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
491
536
  file: exports.globalFile,
492
537
  params: [{
493
538
  name: 'object',
494
- type: new ObjectType_1.ObjectType()
539
+ type: ObjectType_1.ObjectType.instance,
540
+ isOptional: false
495
541
  }, {
496
542
  name: 'flags',
497
- type: new StringType_1.StringType(),
543
+ type: new UnionType_1.UnionType([IntegerType_1.IntegerType.instance, StringType_1.StringType.instance]),
498
544
  isOptional: true
499
545
  }]
500
546
  }, {
@@ -503,11 +549,12 @@ Normally non-ASCII characters are escaped in the output string as "\\uXXXX" wher
503
549
 
504
550
  In some cases you may want to include a placeholder marker in a localizable string that gets dynamically substituted with a value at runtime.
505
551
  One way to accomplish that is to use the Replace method on the string value returned from the Tr() lookup.`,
506
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
552
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
507
553
  file: exports.globalFile,
508
554
  params: [{
509
555
  name: 'source',
510
- type: new StringType_1.StringType()
556
+ type: StringType_1.StringType.instance,
557
+ isOptional: false
511
558
  }]
512
559
  }
513
560
  ];
@@ -515,29 +562,32 @@ let globalStringFunctions = [
515
562
  {
516
563
  name: 'UCase',
517
564
  shortDescription: 'Converts the string to all upper case.',
518
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
565
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
519
566
  file: exports.globalFile,
520
567
  params: [{
521
568
  name: 's',
522
- type: new StringType_1.StringType()
569
+ type: StringType_1.StringType.instance,
570
+ isOptional: false
523
571
  }]
524
572
  }, {
525
573
  name: 'LCase',
526
574
  shortDescription: 'Converts the string to all lower case.',
527
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
575
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
528
576
  file: exports.globalFile,
529
577
  params: [{
530
578
  name: 's',
531
- type: new StringType_1.StringType()
579
+ type: StringType_1.StringType.instance,
580
+ isOptional: false
532
581
  }]
533
582
  }, {
534
583
  name: 'Asc',
535
584
  shortDescription: 'Returns the Unicode ("ASCII") value for the first character of the specified string\n An empty string argument will return 0.',
536
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
585
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
537
586
  file: exports.globalFile,
538
587
  params: [{
539
588
  name: 'letter',
540
- type: new StringType_1.StringType()
589
+ type: StringType_1.StringType.instance,
590
+ isOptional: false
541
591
  }]
542
592
  }, {
543
593
  name: 'Chr',
@@ -548,164 +598,179 @@ let globalStringFunctions = [
548
598
  By using Chr, you can create strings containing characters which cannot be contained in quotes, such as newline or the quote character itself.
549
599
 
550
600
  print (Chr(34) + "hello" + Chr(34)) ' prints: "hello"`,
551
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
601
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
552
602
  file: exports.globalFile,
553
603
  params: [{
554
604
  name: 'ch',
555
- type: new IntegerType_1.IntegerType()
605
+ type: IntegerType_1.IntegerType.instance,
606
+ isOptional: false
556
607
  }]
557
608
  }, {
558
609
  name: 'Instr',
559
610
  shortDescription: 'Returns the position of the first instances of substring within text, starting at the specified start position.\nReturns 0 if the substring is not found. Unlike the ifString.Instr() method, the first position is 1.',
560
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
611
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
561
612
  file: exports.globalFile,
562
613
  params: [{
563
- name: 'start',
564
- type: new IntegerType_1.IntegerType()
614
+ name: 'startOrText',
615
+ type: (0, UnionType_1.unionTypeFactory)([IntegerType_1.IntegerType.instance, StringType_1.StringType.instance]),
616
+ isOptional: false
565
617
  }, {
566
- name: 'text',
567
- type: new StringType_1.StringType()
618
+ name: 'textOrSubstring',
619
+ type: StringType_1.StringType.instance,
620
+ isOptional: false
568
621
  }, {
569
622
  name: 'substring',
570
- type: new StringType_1.StringType()
623
+ type: StringType_1.StringType.instance,
624
+ isOptional: true
571
625
  }]
572
626
  }, {
573
627
  name: 'Left',
574
628
  shortDescription: 'Returns the first n characters of s. ',
575
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
629
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
576
630
  file: exports.globalFile,
577
631
  params: [{
578
632
  name: 's',
579
- type: new StringType_1.StringType()
633
+ type: StringType_1.StringType.instance,
634
+ isOptional: false
580
635
  }, {
581
636
  name: 'n',
582
- type: new IntegerType_1.IntegerType()
637
+ type: IntegerType_1.IntegerType.instance,
638
+ isOptional: false
583
639
  }]
584
640
  }, {
585
641
  name: 'Len',
586
642
  shortDescription: 'Returns the number of characters in the specified string.',
587
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
643
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
588
644
  file: exports.globalFile,
589
645
  params: [{
590
646
  name: 's',
591
- type: new StringType_1.StringType()
647
+ type: StringType_1.StringType.instance,
648
+ isOptional: false
592
649
  }]
593
650
  }, {
594
651
  name: 'Mid',
595
652
  shortDescription: 'Returns a substring of s with length n and starting at position p.\nn may be omitted, in which case the string starting at p and ending at the end of the string is returned.\nUnlike the ifString.Mid() method, the first character in the string is position 1.',
596
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
653
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
597
654
  file: exports.globalFile,
598
655
  params: [{
599
656
  name: 's',
600
- type: new StringType_1.StringType()
657
+ type: StringType_1.StringType.instance,
658
+ isOptional: false
601
659
  }, {
602
660
  name: 'p',
603
- description: '1-based position',
604
- type: new IntegerType_1.IntegerType()
661
+ //description: '1-based position',
662
+ isOptional: false,
663
+ type: IntegerType_1.IntegerType.instance
605
664
  }, {
606
665
  name: 'n',
607
- type: new IntegerType_1.IntegerType(),
666
+ type: IntegerType_1.IntegerType.instance,
608
667
  isOptional: true
609
668
  }]
610
669
  }, {
611
670
  name: 'Right',
612
671
  shortDescription: 'Returns the last n characters of s.',
613
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
672
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
614
673
  file: exports.globalFile,
615
674
  params: [{
616
675
  name: 's',
617
- type: new StringType_1.StringType()
676
+ type: StringType_1.StringType.instance,
677
+ isOptional: false
618
678
  }, {
619
679
  name: 'n',
620
- type: new IntegerType_1.IntegerType()
680
+ type: IntegerType_1.IntegerType.instance,
681
+ isOptional: false
621
682
  }]
622
683
  }, {
623
684
  name: 'Str',
624
685
  shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder.',
625
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
686
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
626
687
  file: exports.globalFile,
627
688
  params: [{
628
689
  name: 'value',
629
- type: new FloatType_1.FloatType()
690
+ type: FloatType_1.FloatType.instance,
691
+ isOptional: false
630
692
  }]
631
693
  }, {
632
694
  name: 'StrI',
633
- shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder. If the radix parameter is provided, then converts the integer value into a string representation using the given radix.\nIf radix is not 2 .. 36 then an empty string is returned.\nNote that the returned string does not include a base prefix and uses lowercase letters to represent those digits in bases greater than 10.',
634
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
695
+ shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder.. If the radix parameter is provided, then converts the integer value into a string representation using the given radix.\nIf radix is not 2 .. 36 then an empty string is returned.\nNote that the returned string does not include a base prefix and uses lowercase letters to represent those digits in bases greater than 10.',
696
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
635
697
  file: exports.globalFile,
636
698
  params: [{
637
699
  name: 'value',
638
- type: new IntegerType_1.IntegerType()
700
+ type: IntegerType_1.IntegerType.instance,
701
+ isOptional: false
639
702
  }, {
640
703
  name: 'radix',
641
- type: new IntegerType_1.IntegerType(),
704
+ type: IntegerType_1.IntegerType.instance,
642
705
  isOptional: true
643
706
  }]
644
707
  }, {
645
708
  name: 'string',
646
709
  shortDescription: 'Returns a string composed of n copies of the second argument concatenated together.',
647
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
710
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
648
711
  file: exports.globalFile,
649
712
  params: [{
650
713
  name: 'n',
651
- type: new IntegerType_1.IntegerType()
714
+ type: IntegerType_1.IntegerType.instance,
715
+ isOptional: false
652
716
  }, {
653
717
  name: 'str',
654
- type: new StringType_1.StringType()
718
+ type: StringType_1.StringType.instance,
719
+ isOptional: false
655
720
  }]
656
721
  }, {
657
722
  name: 'StringI',
658
723
  shortDescription: 'Returns a string composed of n copies of the character whose Unicode value is the second argument.',
659
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
724
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
660
725
  file: exports.globalFile,
661
726
  params: [{
662
727
  name: 'n',
663
- type: new IntegerType_1.IntegerType()
728
+ type: IntegerType_1.IntegerType.instance,
729
+ isOptional: false
664
730
  }, {
665
731
  name: 'ch',
666
- type: new IntegerType_1.IntegerType()
667
- }]
668
- }, {
669
- name: 'Val',
670
- shortDescription: 'Performs the inverse of the STR function: returns the number represented by the characters in a string argument.\nFor example, if A$="12" and B$="34" then VAL(A$+ "."+B$) returns the number 12.34.',
671
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
672
- file: exports.globalFile,
673
- params: [{
674
- name: 'str',
675
- type: new StringType_1.StringType()
732
+ type: IntegerType_1.IntegerType.instance,
733
+ isOptional: false
676
734
  }]
677
735
  }, {
678
736
  name: 'Val',
679
- shortDescription: 'Returns the integer value from parsing the string with the specified radix.\nRadix should be 2 .. 36 or the special value 0 (which automatically identified hexadecimal or octal numbers based on 0x or 0 prefixes respectively).\nLeading whitespace is ignored then as much of the rest of the string will be parsed as valid.',
680
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
737
+ shortDescription: 'Performs the inverse of the STR function: returns the number represented by the characters in a string argument.\nFor example, if A$="12" and B$="34" then VAL(A$+ "."+B$) returns the number 12.34. If radix is provided as the second parameter, it returns the integer value from parsing the string with the specified radix.\nRadix should be 2 .. 36 or the special value 0 (which automatically identified hexadecimal or octal numbers based on 0x or 0 prefixes respectively).\nLeading whitespace is ignored then as much of the rest of the string will be parsed as valid.',
738
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
681
739
  file: exports.globalFile,
682
740
  params: [{
683
741
  name: 'str',
684
- type: new StringType_1.StringType()
742
+ type: StringType_1.StringType.instance,
743
+ isOptional: false
685
744
  }, {
686
745
  name: 'radix',
687
- type: new IntegerType_1.IntegerType()
746
+ type: IntegerType_1.IntegerType.instance,
747
+ isOptional: true
688
748
  }]
689
749
  }, {
690
750
  name: 'Substitute',
691
751
  shortDescription: 'Replaces all instances of {0} or ^0 in str with arg0. Similarly, replaces all instances of {1} or ^1 with arg1, {2} or ^2 with arg2, and {3} or ^3 with arg3.',
692
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
752
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
693
753
  file: exports.globalFile,
694
754
  params: [{
695
755
  name: 'str',
696
- type: new StringType_1.StringType()
756
+ type: StringType_1.StringType.instance,
757
+ isOptional: false
697
758
  }, {
698
759
  name: 'arg0',
699
- type: new StringType_1.StringType()
760
+ type: StringType_1.StringType.instance,
761
+ isOptional: false
700
762
  }, {
701
763
  name: 'arg1',
702
- type: new StringType_1.StringType()
764
+ type: StringType_1.StringType.instance,
765
+ isOptional: true
703
766
  }, {
704
767
  name: 'arg2',
705
- type: new StringType_1.StringType()
768
+ type: StringType_1.StringType.instance,
769
+ isOptional: true
706
770
  }, {
707
771
  name: 'arg3',
708
- type: new StringType_1.StringType()
772
+ type: StringType_1.StringType.instance,
773
+ isOptional: true
709
774
  }]
710
775
  }
711
776
  ];
@@ -713,37 +778,212 @@ let programStatementFunctions = [
713
778
  {
714
779
  name: 'Tab',
715
780
  shortDescription: 'Moves the cursor to the specified position on the current line (modulo the width of your console if you specify TAB positions greater than the console width). TAB may be used several times in a PRINT list. No punctuation is required after a TAB modifier. Numerical expressions may be used to specify a TAB position. TAB cannot be used to move the cursor to the left. If the cursor is beyond the specified position, the TAB is ignored.',
716
- type: new FunctionType_1.FunctionType(new VoidType_1.VoidType()),
781
+ type: new TypedFunctionType_1.TypedFunctionType(VoidType_1.VoidType.instance),
717
782
  file: exports.globalFile,
718
783
  params: [{
719
784
  name: 'expression',
720
- type: new IntegerType_1.IntegerType()
785
+ type: IntegerType_1.IntegerType.instance,
786
+ isOptional: false
721
787
  }]
722
788
  }, {
723
789
  name: 'Pos',
724
790
  shortDescription: 'Returns a number from 0 to window width, indicating the current cursor position on the cursor. Requires a "dummy argument" (any numeric expression).',
725
- type: new FunctionType_1.FunctionType(new VoidType_1.VoidType()),
791
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
726
792
  file: exports.globalFile,
727
793
  params: [{
728
794
  name: 'x',
729
- type: new IntegerType_1.IntegerType()
795
+ type: IntegerType_1.IntegerType.instance,
796
+ isOptional: false
730
797
  }]
731
798
  //TODO this is a temporary fix for library imported files. Eventually this should be moved into `Roku_Ads.brs` and handled by the `Library` statement
732
799
  }, {
733
800
  name: 'Roku_Ads',
734
801
  shortDescription: 'The main entry point for instantiating the ad interface. This object manages ad server requests, parses ad structure, schedules and renders ads, and triggers tracking beacons.\n\nThe Roku ad parser/renderer object returned has global scope because it is meant to represent interaction with external resources (the ad server and any tracking services) that have persistence and state independent of the ad rendering within a client application.',
735
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
802
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
736
803
  file: exports.globalFile,
737
804
  params: []
805
+ //TODO this is a temporary fix for library imported files. Eventually this should be moved into `Roku_Event_Dispatcher.brs` and handled by the `Library` statement
806
+ }, {
807
+ name: 'Roku_Event_Dispatcher',
808
+ shortDescription: 'Use the Roku Event Dispatcher in your channel\'s authentication workflow to send authentication events. See: https://developer.roku.com/docs/developer-program/discovery/search/prioritizing-authenticated-channels-in-roku-search.md',
809
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
810
+ file: exports.globalFile,
811
+ params: []
812
+ }, {
813
+ name: 'bslBrightScriptErrorCodes',
814
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of the error name and corresponding integer value, for example ERR_OKAY = &hFF.',
815
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
816
+ file: exports.globalFile,
817
+ params: []
818
+ }, {
819
+ name: 'bslGeneralConstants',
820
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of system constants, for example MAX_INT = 2147483647.',
821
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
822
+ file: exports.globalFile,
823
+ params: []
824
+ }, {
825
+ name: 'bslUniversalControlEventCodes',
826
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of the remote key code (buttons) constants, for example BUTTON_SELECT_PRESSED = 6.',
827
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
828
+ file: exports.globalFile,
829
+ params: []
830
+ },
831
+ {
832
+ name: 'AsciiToHex',
833
+ shortDescription: 'Returns the hex encoded string, for example AsciiToHex("Hi!") = "486921".',
834
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
835
+ file: exports.globalFile,
836
+ params: [{
837
+ name: 'ascii',
838
+ type: StringType_1.StringType.instance,
839
+ isOptional: false
840
+ }]
841
+ }, {
842
+ name: 'HexToAscii',
843
+ shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
844
+ type: new TypedFunctionType_1.TypedFunctionType(StringType_1.StringType.instance),
845
+ file: exports.globalFile,
846
+ params: [{
847
+ name: 'hex',
848
+ type: StringType_1.StringType.instance,
849
+ isOptional: false
850
+ }]
851
+ },
852
+ {
853
+ name: 'HexToInteger',
854
+ shortDescription: 'Returns the integer value of the passed in hex string.',
855
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
856
+ file: exports.globalFile,
857
+ params: [{
858
+ name: 'hex',
859
+ type: StringType_1.StringType.instance,
860
+ isOptional: false
861
+ }]
862
+ }, {
863
+ name: 'HexToInteger',
864
+ shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
865
+ type: new TypedFunctionType_1.TypedFunctionType(IntegerType_1.IntegerType.instance),
866
+ file: exports.globalFile,
867
+ params: [{
868
+ name: 'hex',
869
+ type: StringType_1.StringType.instance,
870
+ isOptional: false
871
+ }]
872
+ }, {
873
+ name: 'dfNewBitmapSet',
874
+ shortDescription: `The goal is to enable simple xml descriptions of graphics resources like bitmaps, regions, sprites, animations, and layouts to be used in your games. The library handles parsing, loading, rendering, and animation of sprites sheets (multiple images in a single png file).
875
+ Filename is the path to an XML file that contains info about bitmap regions, animation frames, and ExtraInfo metadata (any fields you would like) about resources used in 2d games.
876
+ Returns an roAssociativeArray with the following name value pairs:
877
+ ExtraInfo: roAssociativeArray
878
+ Regions: roAssociativeArray of name, roRegions pairs
879
+ Animations: roAssociativeArray of name, roArray of roRegion pairs.
880
+ Backgrounds: roAssociativeArray of name, path pairs.`,
881
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
882
+ file: exports.globalFile,
883
+ params: [{
884
+ name: 'filename',
885
+ type: StringType_1.StringType.instance,
886
+ isOptional: false
887
+ }]
888
+ }, {
889
+ name: 'dfDrawMessage',
890
+ shortDescription: 'dest is an roScreen/roBitmap/roRegion and region is an roRegion.\nGreys the entire dest region and draws it the region centered on the drawable dest.',
891
+ type: new TypedFunctionType_1.TypedFunctionType(VoidType_1.VoidType.instance),
892
+ file: exports.globalFile,
893
+ params: [{
894
+ name: 'dest',
895
+ type: ObjectType_1.ObjectType.instance,
896
+ isOptional: false
897
+ }, {
898
+ name: 'region',
899
+ type: ObjectType_1.ObjectType.instance,
900
+ isOptional: false
901
+ }]
902
+ }, {
903
+ name: 'dfDrawImage',
904
+ shortDescription: 'Returns True if successful.\nCreates a bitmap out of the image stored in the filename "path" and draws it at position (x,y) of the drawable dest.',
905
+ type: new TypedFunctionType_1.TypedFunctionType(BooleanType_1.BooleanType.instance),
906
+ file: exports.globalFile,
907
+ params: [{
908
+ name: 'dest',
909
+ type: ObjectType_1.ObjectType.instance,
910
+ isOptional: false
911
+ }, {
912
+ name: 'path',
913
+ type: StringType_1.StringType.instance,
914
+ isOptional: false
915
+ }, {
916
+ name: 'x',
917
+ type: IntegerType_1.IntegerType.instance,
918
+ isOptional: false
919
+ }, {
920
+ name: 'y',
921
+ type: IntegerType_1.IntegerType.instance,
922
+ isOptional: false
923
+ }]
924
+ }, {
925
+ name: 'dfSetupDisplayRegions',
926
+ shortDescription: `Helper function to setup screen scaling with supplied pillar box or letterbox images to fill the entire screen.
927
+ screen is an roScreen
928
+ topx and topy are the coordinates of the upper left hand corner of the main drawing region
929
+ Width and height is the size of the main drawing region
930
+
931
+ Returns an associative array containing the following roRegions
932
+ Main: main drawable region
933
+ Left: left region if there is pillar box area on the left
934
+ Right: right region if there is a pillar box area on the right
935
+ Upper: upper region if there is a letterbox area at thetop
936
+ Lower: lower region if there is a letterbox area at the bottom
937
+ When using these regions as drawables, your graphics will be translated and clipped to these regions.`,
938
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
939
+ file: exports.globalFile,
940
+ params: [{
941
+ name: 'screen',
942
+ type: ObjectType_1.ObjectType.instance,
943
+ isOptional: false
944
+ }, {
945
+ name: 'topx',
946
+ type: IntegerType_1.IntegerType.instance,
947
+ isOptional: false
948
+ }, {
949
+ name: 'topy',
950
+ type: IntegerType_1.IntegerType.instance,
951
+ isOptional: false
952
+ }, {
953
+ name: 'width',
954
+ type: IntegerType_1.IntegerType.instance,
955
+ isOptional: false
956
+ }, {
957
+ name: 'height',
958
+ type: IntegerType_1.IntegerType.instance,
959
+ isOptional: false
960
+ }]
961
+ }, {
962
+ name: 'dfSetBackground',
963
+ shortDescription: `dfSetBackground helps manage the limited video memory. The video memory does not currently run a defragmenter, and is very limited. These constraints make it important that large bitmaps (like backgrounds that fill the entire screen) are only allocated when needed. It is also helpful if you set your first initial background very early in your program, and then immediately replace the background after it is no longer in use. This helper function supports this background management for your application.
964
+ backgroundName is a key for the Backgrounds roAssociative array of backgrounds.
965
+ Backgrounds is an roAssociative array of background name keys and file path string values
966
+ This function creates an roBitmap out of the background image file and returns a region the size of the entire roBitmap.`,
967
+ type: new TypedFunctionType_1.TypedFunctionType(ObjectType_1.ObjectType.instance),
968
+ file: exports.globalFile,
969
+ params: [{
970
+ name: 'backgroundName',
971
+ type: StringType_1.StringType.instance,
972
+ isOptional: false
973
+ }, {
974
+ name: 'backgrounds',
975
+ type: ObjectType_1.ObjectType.instance,
976
+ isOptional: false
977
+ }]
738
978
  }
739
979
  ];
740
980
  exports.globalCallables = [...mathFunctions, ...runtimeFunctions, ...globalUtilityFunctions, ...globalStringFunctions, ...programStatementFunctions];
741
981
  for (let callable of exports.globalCallables) {
742
982
  //give each callable a dummy location
743
- callable.nameRange = util_1.default.createRange(0, 0, 0, callable.name.length);
983
+ callable.nameRange = util_1.util.createRange(0, 0, 0, callable.name.length);
744
984
  //add each parameter to the type
745
985
  for (let param of callable.params) {
746
- callable.type.addParameter(param);
986
+ callable.type.addParameter(param.name, param.type, param.isOptional);
747
987
  }
748
988
  //set name in type
749
989
  callable.type.setName(callable.name);
@@ -751,7 +991,7 @@ for (let callable of exports.globalCallables) {
751
991
  return this.name;
752
992
  };
753
993
  }
754
- exports.globalFile.callables = exports.globalCallables;
994
+ exports.globalFile.staticCallables = exports.globalCallables;
755
995
  /**
756
996
  * A map of all built-in function names. We use this extensively in scope validation
757
997
  * so keep a single copy in memory to improve performance