brighterscript 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (620) hide show
  1. package/CHANGELOG.md +1387 -291
  2. package/README.md +72 -131
  3. package/bsconfig.schema.json +85 -1
  4. package/dist/ActionPipeline.d.ts +10 -0
  5. package/dist/ActionPipeline.js +40 -0
  6. package/dist/ActionPipeline.js.map +1 -0
  7. package/dist/AstValidationSegmenter.d.ts +42 -0
  8. package/dist/AstValidationSegmenter.js +237 -0
  9. package/dist/AstValidationSegmenter.js.map +1 -0
  10. package/dist/BsConfig.d.ts +56 -6
  11. package/dist/BusyStatusTracker.d.ts +31 -0
  12. package/dist/BusyStatusTracker.js +83 -0
  13. package/dist/BusyStatusTracker.js.map +1 -0
  14. package/dist/Cache.d.ts +5 -6
  15. package/dist/Cache.js +12 -11
  16. package/dist/Cache.js.map +1 -1
  17. package/dist/CacheVerifier.d.ts +7 -0
  18. package/dist/CacheVerifier.js +20 -0
  19. package/dist/CacheVerifier.js.map +1 -0
  20. package/dist/CodeActionUtil.d.ts +6 -3
  21. package/dist/CodeActionUtil.js +19 -5
  22. package/dist/CodeActionUtil.js.map +1 -1
  23. package/dist/CommentFlagProcessor.d.ts +7 -6
  24. package/dist/CommentFlagProcessor.js +11 -8
  25. package/dist/CommentFlagProcessor.js.map +1 -1
  26. package/dist/CrossScopeValidator.d.ts +67 -0
  27. package/dist/CrossScopeValidator.js +617 -0
  28. package/dist/CrossScopeValidator.js.map +1 -0
  29. package/dist/DependencyGraph.d.ts +8 -3
  30. package/dist/DependencyGraph.js +49 -16
  31. package/dist/DependencyGraph.js.map +1 -1
  32. package/dist/DiagnosticCollection.d.ts +5 -3
  33. package/dist/DiagnosticCollection.js +21 -16
  34. package/dist/DiagnosticCollection.js.map +1 -1
  35. package/dist/DiagnosticFilterer.d.ts +8 -4
  36. package/dist/DiagnosticFilterer.js +90 -54
  37. package/dist/DiagnosticFilterer.js.map +1 -1
  38. package/dist/DiagnosticManager.d.ts +61 -0
  39. package/dist/DiagnosticManager.js +238 -0
  40. package/dist/DiagnosticManager.js.map +1 -0
  41. package/dist/DiagnosticMessages.d.ts +204 -24
  42. package/dist/DiagnosticMessages.js +266 -33
  43. package/dist/DiagnosticMessages.js.map +1 -1
  44. package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
  45. package/dist/DiagnosticSeverityAdjuster.js +41 -0
  46. package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
  47. package/dist/FunctionScope.d.ts +28 -0
  48. package/dist/FunctionScope.js +52 -0
  49. package/dist/FunctionScope.js.map +1 -0
  50. package/dist/KeyedThrottler.d.ts +3 -3
  51. package/dist/KeyedThrottler.js +3 -3
  52. package/dist/KeyedThrottler.js.map +1 -1
  53. package/dist/LanguageServer.d.ts +72 -47
  54. package/dist/LanguageServer.js +545 -314
  55. package/dist/LanguageServer.js.map +1 -1
  56. package/dist/Logger.d.ts +9 -10
  57. package/dist/Logger.js +36 -30
  58. package/dist/Logger.js.map +1 -1
  59. package/dist/PluginInterface.d.ts +29 -7
  60. package/dist/PluginInterface.js +90 -7
  61. package/dist/PluginInterface.js.map +1 -1
  62. package/dist/Program.d.ts +201 -100
  63. package/dist/Program.js +1079 -700
  64. package/dist/Program.js.map +1 -1
  65. package/dist/ProgramBuilder.d.ts +29 -18
  66. package/dist/ProgramBuilder.js +178 -141
  67. package/dist/ProgramBuilder.js.map +1 -1
  68. package/dist/Scope.d.ts +144 -109
  69. package/dist/Scope.js +533 -552
  70. package/dist/Scope.js.map +1 -1
  71. package/dist/SemanticTokenUtils.d.ts +14 -0
  72. package/dist/SemanticTokenUtils.js +85 -0
  73. package/dist/SemanticTokenUtils.js.map +1 -0
  74. package/dist/Stopwatch.d.ts +4 -0
  75. package/dist/Stopwatch.js +8 -1
  76. package/dist/Stopwatch.js.map +1 -1
  77. package/dist/SymbolTable.d.ts +91 -24
  78. package/dist/SymbolTable.js +291 -64
  79. package/dist/SymbolTable.js.map +1 -1
  80. package/dist/SymbolTypeFlag.d.ts +9 -0
  81. package/dist/SymbolTypeFlag.js +14 -0
  82. package/dist/SymbolTypeFlag.js.map +1 -0
  83. package/dist/Throttler.d.ts +12 -0
  84. package/dist/Throttler.js +39 -0
  85. package/dist/Throttler.js.map +1 -1
  86. package/dist/Watcher.d.ts +0 -3
  87. package/dist/Watcher.js +0 -3
  88. package/dist/Watcher.js.map +1 -1
  89. package/dist/XmlScope.d.ts +5 -15
  90. package/dist/XmlScope.js +35 -87
  91. package/dist/XmlScope.js.map +1 -1
  92. package/dist/astUtils/CachedLookups.d.ts +50 -0
  93. package/dist/astUtils/CachedLookups.js +335 -0
  94. package/dist/astUtils/CachedLookups.js.map +1 -0
  95. package/dist/astUtils/CachedLookups.spec.js +39 -0
  96. package/dist/astUtils/CachedLookups.spec.js.map +1 -0
  97. package/dist/astUtils/Editor.d.ts +69 -0
  98. package/dist/astUtils/Editor.js +245 -0
  99. package/dist/astUtils/Editor.js.map +1 -0
  100. package/dist/astUtils/Editor.spec.js +258 -0
  101. package/dist/astUtils/Editor.spec.js.map +1 -0
  102. package/dist/astUtils/creators.d.ts +36 -19
  103. package/dist/astUtils/creators.js +222 -43
  104. package/dist/astUtils/creators.js.map +1 -1
  105. package/dist/astUtils/creators.spec.js +5 -5
  106. package/dist/astUtils/creators.spec.js.map +1 -1
  107. package/dist/astUtils/reflection.d.ts +148 -82
  108. package/dist/astUtils/reflection.js +324 -137
  109. package/dist/astUtils/reflection.js.map +1 -1
  110. package/dist/astUtils/reflection.spec.js +267 -167
  111. package/dist/astUtils/reflection.spec.js.map +1 -1
  112. package/dist/astUtils/stackedVisitor.js.map +1 -1
  113. package/dist/astUtils/stackedVisitor.spec.js +14 -14
  114. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  115. package/dist/astUtils/visitors.d.ts +114 -53
  116. package/dist/astUtils/visitors.js +70 -13
  117. package/dist/astUtils/visitors.js.map +1 -1
  118. package/dist/astUtils/visitors.spec.js +463 -51
  119. package/dist/astUtils/visitors.spec.js.map +1 -1
  120. package/dist/astUtils/xml.d.ts +9 -8
  121. package/dist/astUtils/xml.js +10 -5
  122. package/dist/astUtils/xml.js.map +1 -1
  123. package/dist/bscPlugin/BscPlugin.d.ts +22 -1
  124. package/dist/bscPlugin/BscPlugin.js +88 -0
  125. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  126. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  127. package/dist/bscPlugin/CallExpressionInfo.js +135 -0
  128. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  129. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  130. package/dist/bscPlugin/FileWriter.js +24 -0
  131. package/dist/bscPlugin/FileWriter.js.map +1 -0
  132. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  133. package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
  134. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  135. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
  136. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +30 -18
  137. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  138. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +94 -21
  139. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  140. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +64 -0
  141. package/dist/bscPlugin/completions/CompletionsProcessor.js +626 -0
  142. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
  143. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2188 -0
  144. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  145. package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
  146. package/dist/bscPlugin/definition/DefinitionProvider.js +212 -0
  147. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  148. package/dist/bscPlugin/definition/DefinitionProvider.spec.d.ts +1 -0
  149. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
  150. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  151. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  152. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  153. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  154. package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
  155. package/dist/bscPlugin/hover/HoverProcessor.js +218 -0
  156. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
  157. package/dist/bscPlugin/hover/HoverProcessor.spec.d.ts +1 -0
  158. package/dist/bscPlugin/hover/HoverProcessor.spec.js +786 -0
  159. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
  160. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  161. package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
  162. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  163. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  164. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  165. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  166. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
  167. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +154 -0
  168. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
  169. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
  170. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +530 -0
  171. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
  172. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  173. package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
  174. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  175. package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
  176. package/dist/bscPlugin/serialize/BslibManager.js +46 -0
  177. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  178. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  179. package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
  180. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  181. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
  182. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
  183. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
  184. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
  185. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
  186. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
  187. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
  188. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
  189. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
  190. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
  191. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
  192. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
  193. package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
  194. package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
  195. package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
  196. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +21 -0
  197. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +201 -0
  198. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  199. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  200. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -0
  201. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  202. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  203. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  204. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  205. package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
  206. package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
  207. package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
  208. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +36 -0
  209. package/dist/bscPlugin/validation/BrsFileValidator.js +534 -0
  210. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
  211. package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
  212. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1118 -0
  213. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
  214. package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
  215. package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
  216. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  217. package/dist/bscPlugin/validation/ScopeValidator.d.ts +126 -0
  218. package/dist/bscPlugin/validation/ScopeValidator.js +1039 -0
  219. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
  220. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  221. package/dist/bscPlugin/validation/ScopeValidator.spec.js +3346 -0
  222. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  223. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  224. package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
  225. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  226. package/dist/cli.js +117 -11
  227. package/dist/cli.js.map +1 -1
  228. package/dist/deferred.d.ts +3 -3
  229. package/dist/deferred.js.map +1 -1
  230. package/dist/diagnosticUtils.d.ts +10 -3
  231. package/dist/diagnosticUtils.js +62 -24
  232. package/dist/diagnosticUtils.js.map +1 -1
  233. package/dist/examples/plugins/removePrint.js +8 -12
  234. package/dist/examples/plugins/removePrint.js.map +1 -1
  235. package/dist/files/AssetFile.d.ts +24 -0
  236. package/dist/files/AssetFile.js +25 -0
  237. package/dist/files/AssetFile.js.map +1 -0
  238. package/dist/files/BrsFile.Class.spec.js +912 -153
  239. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  240. package/dist/files/BrsFile.d.ts +142 -85
  241. package/dist/files/BrsFile.js +845 -935
  242. package/dist/files/BrsFile.js.map +1 -1
  243. package/dist/files/BrsFile.spec.js +3778 -862
  244. package/dist/files/BrsFile.spec.js.map +1 -1
  245. package/dist/files/BscFile.d.ts +101 -0
  246. package/dist/files/BscFile.js +15 -0
  247. package/dist/files/BscFile.js.map +1 -0
  248. package/dist/files/Factory.d.ts +25 -0
  249. package/dist/files/Factory.js +22 -0
  250. package/dist/files/Factory.js.map +1 -0
  251. package/dist/files/LazyFileData.d.ts +20 -0
  252. package/dist/files/LazyFileData.js +54 -0
  253. package/dist/files/LazyFileData.js.map +1 -0
  254. package/dist/files/LazyFileData.spec.d.ts +1 -0
  255. package/dist/files/LazyFileData.spec.js +27 -0
  256. package/dist/files/LazyFileData.spec.js.map +1 -0
  257. package/dist/files/XmlFile.d.ts +73 -41
  258. package/dist/files/XmlFile.js +128 -138
  259. package/dist/files/XmlFile.js.map +1 -1
  260. package/dist/files/XmlFile.spec.js +451 -324
  261. package/dist/files/XmlFile.spec.js.map +1 -1
  262. package/dist/files/tests/imports.spec.js +62 -52
  263. package/dist/files/tests/imports.spec.js.map +1 -1
  264. package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
  265. package/dist/files/tests/optionalChaning.spec.js +152 -0
  266. package/dist/files/tests/optionalChaning.spec.js.map +1 -0
  267. package/dist/globalCallables.d.ts +3 -1
  268. package/dist/globalCallables.js +417 -163
  269. package/dist/globalCallables.js.map +1 -1
  270. package/dist/index.d.ts +26 -3
  271. package/dist/index.js +44 -5
  272. package/dist/index.js.map +1 -1
  273. package/dist/interfaces.d.ts +783 -122
  274. package/dist/interfaces.js +21 -0
  275. package/dist/interfaces.js.map +1 -1
  276. package/dist/lexer/Character.spec.js +5 -5
  277. package/dist/lexer/Character.spec.js.map +1 -1
  278. package/dist/lexer/Lexer.d.ts +51 -12
  279. package/dist/lexer/Lexer.js +201 -57
  280. package/dist/lexer/Lexer.js.map +1 -1
  281. package/dist/lexer/Lexer.spec.js +781 -565
  282. package/dist/lexer/Lexer.spec.js.map +1 -1
  283. package/dist/lexer/Token.d.ts +27 -11
  284. package/dist/lexer/Token.js +10 -2
  285. package/dist/lexer/Token.js.map +1 -1
  286. package/dist/lexer/TokenKind.d.ts +31 -2
  287. package/dist/lexer/TokenKind.js +134 -10
  288. package/dist/lexer/TokenKind.js.map +1 -1
  289. package/dist/logging.d.ts +9 -0
  290. package/dist/logging.js +16 -0
  291. package/dist/logging.js.map +1 -0
  292. package/dist/parser/AstNode.d.ts +191 -0
  293. package/dist/parser/AstNode.js +269 -0
  294. package/dist/parser/AstNode.js.map +1 -0
  295. package/dist/parser/AstNode.spec.d.ts +1 -0
  296. package/dist/parser/AstNode.spec.js +1455 -0
  297. package/dist/parser/AstNode.spec.js.map +1 -0
  298. package/dist/parser/BrightScriptDocParser.d.ts +56 -0
  299. package/dist/parser/BrightScriptDocParser.js +294 -0
  300. package/dist/parser/BrightScriptDocParser.js.map +1 -0
  301. package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
  302. package/dist/parser/BrightScriptDocParser.spec.js +310 -0
  303. package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
  304. package/dist/parser/BrsTranspileState.d.ts +22 -3
  305. package/dist/parser/BrsTranspileState.js +19 -0
  306. package/dist/parser/BrsTranspileState.js.map +1 -1
  307. package/dist/parser/Expression.d.ts +489 -221
  308. package/dist/parser/Expression.js +1206 -506
  309. package/dist/parser/Expression.js.map +1 -1
  310. package/dist/parser/Expression.spec.d.ts +1 -0
  311. package/dist/parser/Expression.spec.js +40 -0
  312. package/dist/parser/Expression.spec.js.map +1 -0
  313. package/dist/parser/Parser.Class.spec.js +230 -125
  314. package/dist/parser/Parser.Class.spec.js.map +1 -1
  315. package/dist/parser/Parser.d.ts +113 -124
  316. package/dist/parser/Parser.js +1510 -983
  317. package/dist/parser/Parser.js.map +1 -1
  318. package/dist/parser/Parser.spec.d.ts +3 -1
  319. package/dist/parser/Parser.spec.js +1533 -517
  320. package/dist/parser/Parser.spec.js.map +1 -1
  321. package/dist/parser/SGParser.d.ts +60 -7
  322. package/dist/parser/SGParser.js +225 -185
  323. package/dist/parser/SGParser.js.map +1 -1
  324. package/dist/parser/SGParser.spec.js +29 -32
  325. package/dist/parser/SGParser.spec.js.map +1 -1
  326. package/dist/parser/SGTypes.d.ts +295 -52
  327. package/dist/parser/SGTypes.js +540 -187
  328. package/dist/parser/SGTypes.js.map +1 -1
  329. package/dist/parser/Statement.d.ts +808 -261
  330. package/dist/parser/Statement.js +2232 -588
  331. package/dist/parser/Statement.js.map +1 -1
  332. package/dist/parser/Statement.spec.js +133 -36
  333. package/dist/parser/Statement.spec.js.map +1 -1
  334. package/dist/parser/TranspileState.d.ts +26 -12
  335. package/dist/parser/TranspileState.js +114 -15
  336. package/dist/parser/TranspileState.js.map +1 -1
  337. package/dist/parser/tests/Parser.spec.d.ts +3 -9
  338. package/dist/parser/tests/Parser.spec.js +7 -13
  339. package/dist/parser/tests/Parser.spec.js.map +1 -1
  340. package/dist/parser/tests/controlFlow/For.spec.js +83 -75
  341. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  342. package/dist/parser/tests/controlFlow/ForEach.spec.js +58 -51
  343. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  344. package/dist/parser/tests/controlFlow/If.spec.js +382 -239
  345. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  346. package/dist/parser/tests/controlFlow/While.spec.js +52 -45
  347. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  348. package/dist/parser/tests/expression/Additive.spec.js +51 -43
  349. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  350. package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
  351. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  352. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
  353. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  354. package/dist/parser/tests/expression/Boolean.spec.js +41 -34
  355. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  356. package/dist/parser/tests/expression/Call.spec.js +173 -55
  357. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  358. package/dist/parser/tests/expression/Exponential.spec.js +20 -20
  359. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  360. package/dist/parser/tests/expression/Function.spec.js +291 -282
  361. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  362. package/dist/parser/tests/expression/Indexing.spec.js +193 -110
  363. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  364. package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
  365. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  366. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +213 -115
  367. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  368. package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
  369. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  370. package/dist/parser/tests/expression/Primary.spec.js +76 -60
  371. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  372. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  373. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
  374. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  375. package/dist/parser/tests/expression/Relational.spec.js +50 -50
  376. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  377. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
  378. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  379. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +235 -94
  380. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  381. package/dist/parser/tests/expression/TernaryExpression.spec.js +403 -174
  382. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  383. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  384. package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
  385. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  386. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  387. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  388. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  389. package/dist/parser/tests/statement/AssignmentOperators.spec.js +44 -44
  390. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  391. package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
  392. package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
  393. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
  394. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  395. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  396. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  397. package/dist/parser/tests/statement/Declaration.spec.js +61 -55
  398. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  399. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  400. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  401. package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
  402. package/dist/parser/tests/statement/Enum.spec.js +744 -0
  403. package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
  404. package/dist/parser/tests/statement/For.spec.d.ts +1 -0
  405. package/dist/parser/tests/statement/For.spec.js +45 -0
  406. package/dist/parser/tests/statement/For.spec.js.map +1 -0
  407. package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
  408. package/dist/parser/tests/statement/ForEach.spec.js +36 -0
  409. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
  410. package/dist/parser/tests/statement/Function.spec.js +226 -215
  411. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  412. package/dist/parser/tests/statement/Goto.spec.js +16 -15
  413. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  414. package/dist/parser/tests/statement/Increment.spec.js +64 -59
  415. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  416. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  417. package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
  418. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  419. package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
  420. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  421. package/dist/parser/tests/statement/Misc.spec.js +127 -168
  422. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  423. package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
  424. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  425. package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
  426. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  427. package/dist/parser/tests/statement/Set.spec.js +131 -117
  428. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  429. package/dist/parser/tests/statement/Stop.spec.js +14 -13
  430. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  431. package/dist/parser/tests/statement/Throw.spec.js +11 -8
  432. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  433. package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
  434. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  435. package/dist/preprocessor/Manifest.d.ts +6 -6
  436. package/dist/preprocessor/Manifest.js +17 -38
  437. package/dist/preprocessor/Manifest.js.map +1 -1
  438. package/dist/preprocessor/Manifest.spec.d.ts +1 -0
  439. package/dist/preprocessor/Manifest.spec.js +78 -103
  440. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  441. package/dist/roku-types/data.json +19452 -0
  442. package/dist/roku-types/index.d.ts +5533 -0
  443. package/dist/roku-types/index.js +11 -0
  444. package/dist/roku-types/index.js.map +1 -0
  445. package/dist/types/ArrayType.d.ts +9 -5
  446. package/dist/types/ArrayType.js +73 -24
  447. package/dist/types/ArrayType.js.map +1 -1
  448. package/dist/types/ArrayType.spec.js +39 -11
  449. package/dist/types/ArrayType.spec.js.map +1 -1
  450. package/dist/types/AssociativeArrayType.d.ts +14 -0
  451. package/dist/types/AssociativeArrayType.js +60 -0
  452. package/dist/types/AssociativeArrayType.js.map +1 -0
  453. package/dist/types/BaseFunctionType.d.ts +9 -0
  454. package/dist/types/BaseFunctionType.js +25 -0
  455. package/dist/types/BaseFunctionType.js.map +1 -0
  456. package/dist/types/BooleanType.d.ts +10 -5
  457. package/dist/types/BooleanType.js +21 -9
  458. package/dist/types/BooleanType.js.map +1 -1
  459. package/dist/types/BooleanType.spec.js +10 -4
  460. package/dist/types/BooleanType.spec.js.map +1 -1
  461. package/dist/types/BscType.d.ts +29 -3
  462. package/dist/types/BscType.js +121 -0
  463. package/dist/types/BscType.js.map +1 -1
  464. package/dist/types/BscTypeKind.d.ts +25 -0
  465. package/dist/types/BscTypeKind.js +30 -0
  466. package/dist/types/BscTypeKind.js.map +1 -0
  467. package/dist/types/BuiltInInterfaceAdder.d.ts +25 -0
  468. package/dist/types/BuiltInInterfaceAdder.js +201 -0
  469. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  470. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  471. package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
  472. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  473. package/dist/types/ClassType.d.ts +16 -0
  474. package/dist/types/ClassType.js +57 -0
  475. package/dist/types/ClassType.js.map +1 -0
  476. package/dist/types/ClassType.spec.d.ts +1 -0
  477. package/dist/types/ClassType.spec.js +76 -0
  478. package/dist/types/ClassType.spec.js.map +1 -0
  479. package/dist/types/ComponentType.d.ts +27 -0
  480. package/dist/types/ComponentType.js +83 -0
  481. package/dist/types/ComponentType.js.map +1 -0
  482. package/dist/types/DoubleType.d.ts +10 -5
  483. package/dist/types/DoubleType.js +25 -18
  484. package/dist/types/DoubleType.js.map +1 -1
  485. package/dist/types/DoubleType.spec.js +12 -4
  486. package/dist/types/DoubleType.spec.js.map +1 -1
  487. package/dist/types/DynamicType.d.ts +12 -5
  488. package/dist/types/DynamicType.js +22 -6
  489. package/dist/types/DynamicType.js.map +1 -1
  490. package/dist/types/DynamicType.spec.js +16 -5
  491. package/dist/types/DynamicType.spec.js.map +1 -1
  492. package/dist/types/EnumType.d.ts +40 -0
  493. package/dist/types/EnumType.js +80 -0
  494. package/dist/types/EnumType.js.map +1 -0
  495. package/dist/types/EnumType.spec.d.ts +1 -0
  496. package/dist/types/EnumType.spec.js +33 -0
  497. package/dist/types/EnumType.spec.js.map +1 -0
  498. package/dist/types/FloatType.d.ts +10 -5
  499. package/dist/types/FloatType.js +25 -18
  500. package/dist/types/FloatType.js.map +1 -1
  501. package/dist/types/FloatType.spec.js +4 -4
  502. package/dist/types/FloatType.spec.js.map +1 -1
  503. package/dist/types/FunctionType.d.ts +10 -22
  504. package/dist/types/FunctionType.js +26 -63
  505. package/dist/types/FunctionType.js.map +1 -1
  506. package/dist/types/InheritableType.d.ts +28 -0
  507. package/dist/types/InheritableType.js +157 -0
  508. package/dist/types/InheritableType.js.map +1 -0
  509. package/dist/types/IntegerType.d.ts +10 -5
  510. package/dist/types/IntegerType.js +25 -18
  511. package/dist/types/IntegerType.js.map +1 -1
  512. package/dist/types/IntegerType.spec.js +8 -4
  513. package/dist/types/IntegerType.spec.js.map +1 -1
  514. package/dist/types/InterfaceType.d.ts +14 -6
  515. package/dist/types/InterfaceType.js +26 -15
  516. package/dist/types/InterfaceType.js.map +1 -1
  517. package/dist/types/InterfaceType.spec.d.ts +1 -0
  518. package/dist/types/InterfaceType.spec.js +227 -0
  519. package/dist/types/InterfaceType.spec.js.map +1 -0
  520. package/dist/types/InvalidType.d.ts +9 -5
  521. package/dist/types/InvalidType.js +20 -9
  522. package/dist/types/InvalidType.js.map +1 -1
  523. package/dist/types/InvalidType.spec.js +8 -4
  524. package/dist/types/InvalidType.spec.js.map +1 -1
  525. package/dist/types/LongIntegerType.d.ts +10 -5
  526. package/dist/types/LongIntegerType.js +25 -18
  527. package/dist/types/LongIntegerType.js.map +1 -1
  528. package/dist/types/LongIntegerType.spec.js +10 -4
  529. package/dist/types/LongIntegerType.spec.js.map +1 -1
  530. package/dist/types/NamespaceType.d.ts +12 -0
  531. package/dist/types/NamespaceType.js +28 -0
  532. package/dist/types/NamespaceType.js.map +1 -0
  533. package/dist/types/ObjectType.d.ts +10 -5
  534. package/dist/types/ObjectType.js +23 -9
  535. package/dist/types/ObjectType.js.map +1 -1
  536. package/dist/types/ObjectType.spec.js +3 -3
  537. package/dist/types/ObjectType.spec.js.map +1 -1
  538. package/dist/types/ReferenceType.d.ts +79 -0
  539. package/dist/types/ReferenceType.js +522 -0
  540. package/dist/types/ReferenceType.js.map +1 -0
  541. package/dist/types/ReferenceType.spec.d.ts +1 -0
  542. package/dist/types/ReferenceType.spec.js +151 -0
  543. package/dist/types/ReferenceType.spec.js.map +1 -0
  544. package/dist/types/StringType.d.ts +13 -5
  545. package/dist/types/StringType.js +25 -9
  546. package/dist/types/StringType.js.map +1 -1
  547. package/dist/types/StringType.spec.js +3 -3
  548. package/dist/types/StringType.spec.js.map +1 -1
  549. package/dist/types/TypedFunctionType.d.ts +33 -0
  550. package/dist/types/TypedFunctionType.js +106 -0
  551. package/dist/types/TypedFunctionType.js.map +1 -0
  552. package/dist/types/TypedFunctionType.spec.d.ts +1 -0
  553. package/dist/types/TypedFunctionType.spec.js +122 -0
  554. package/dist/types/TypedFunctionType.spec.js.map +1 -0
  555. package/dist/types/UninitializedType.d.ts +8 -6
  556. package/dist/types/UninitializedType.js +15 -9
  557. package/dist/types/UninitializedType.js.map +1 -1
  558. package/dist/types/UnionType.d.ts +20 -0
  559. package/dist/types/UnionType.js +127 -0
  560. package/dist/types/UnionType.js.map +1 -0
  561. package/dist/types/UnionType.spec.d.ts +1 -0
  562. package/dist/types/UnionType.spec.js +129 -0
  563. package/dist/types/UnionType.spec.js.map +1 -0
  564. package/dist/types/VoidType.d.ts +10 -5
  565. package/dist/types/VoidType.js +20 -9
  566. package/dist/types/VoidType.js.map +1 -1
  567. package/dist/types/VoidType.spec.js +3 -3
  568. package/dist/types/VoidType.spec.js.map +1 -1
  569. package/dist/types/helper.spec.d.ts +1 -0
  570. package/dist/types/helper.spec.js +144 -0
  571. package/dist/types/helper.spec.js.map +1 -0
  572. package/dist/types/helpers.d.ts +26 -0
  573. package/dist/types/helpers.js +191 -0
  574. package/dist/types/helpers.js.map +1 -0
  575. package/dist/types/index.d.ts +22 -0
  576. package/dist/types/index.js +39 -0
  577. package/dist/types/index.js.map +1 -0
  578. package/dist/util.d.ts +272 -117
  579. package/dist/util.js +1583 -343
  580. package/dist/util.js.map +1 -1
  581. package/dist/validators/ClassValidator.d.ts +9 -15
  582. package/dist/validators/ClassValidator.js +85 -138
  583. package/dist/validators/ClassValidator.js.map +1 -1
  584. package/package.json +174 -138
  585. package/dist/astUtils/index.d.ts +0 -7
  586. package/dist/astUtils/index.js +0 -26
  587. package/dist/astUtils/index.js.map +0 -1
  588. package/dist/lexer/index.d.ts +0 -3
  589. package/dist/lexer/index.js +0 -17
  590. package/dist/lexer/index.js.map +0 -1
  591. package/dist/parser/index.d.ts +0 -3
  592. package/dist/parser/index.js +0 -16
  593. package/dist/parser/index.js.map +0 -1
  594. package/dist/preprocessor/Chunk.d.ts +0 -82
  595. package/dist/preprocessor/Chunk.js +0 -77
  596. package/dist/preprocessor/Chunk.js.map +0 -1
  597. package/dist/preprocessor/Preprocessor.d.ts +0 -60
  598. package/dist/preprocessor/Preprocessor.js +0 -156
  599. package/dist/preprocessor/Preprocessor.js.map +0 -1
  600. package/dist/preprocessor/Preprocessor.spec.js +0 -152
  601. package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
  602. package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
  603. package/dist/preprocessor/PreprocessorParser.js +0 -194
  604. package/dist/preprocessor/PreprocessorParser.js.map +0 -1
  605. package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
  606. package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
  607. package/dist/preprocessor/index.d.ts +0 -3
  608. package/dist/preprocessor/index.js +0 -16
  609. package/dist/preprocessor/index.js.map +0 -1
  610. package/dist/types/CustomType.d.ts +0 -10
  611. package/dist/types/CustomType.js +0 -35
  612. package/dist/types/CustomType.js.map +0 -1
  613. package/dist/types/FunctionType.spec.js +0 -29
  614. package/dist/types/FunctionType.spec.js.map +0 -1
  615. package/dist/types/LazyType.d.ts +0 -15
  616. package/dist/types/LazyType.js +0 -32
  617. package/dist/types/LazyType.js.map +0 -1
  618. /package/dist/{preprocessor/Preprocessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
  619. /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
  620. /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
@@ -6,177 +6,196 @@ 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(new FloatType_1.FloatType()),
21
22
  file: exports.globalFile,
22
23
  params: [{
23
24
  name: 'x',
24
- type: new FloatType_1.FloatType()
25
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
31
33
  file: exports.globalFile,
32
34
  params: [{
33
35
  name: 'x',
34
- type: new FloatType_1.FloatType()
36
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
40
43
  file: exports.globalFile,
41
44
  params: [{
42
45
  name: 'x',
43
- type: new IntegerType_1.IntegerType()
46
+ type: new IntegerType_1.IntegerType(),
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(new IntegerType_1.IntegerType()),
49
53
  file: exports.globalFile,
50
54
  params: [{
51
55
  name: 'x',
52
- type: new FloatType_1.FloatType()
56
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
58
63
  file: exports.globalFile,
59
64
  params: [{
60
65
  name: 'x',
61
- type: new FloatType_1.FloatType()
66
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
67
73
  file: exports.globalFile,
68
74
  params: [{
69
75
  name: 'x',
70
- type: new IntegerType_1.IntegerType()
76
+ type: new IntegerType_1.IntegerType(),
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(new FloatType_1.FloatType()),
76
83
  file: exports.globalFile,
77
84
  params: [{
78
85
  name: 'x',
79
- type: new FloatType_1.FloatType()
86
+ type: new FloatType_1.FloatType(),
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(new IntegerType_1.IntegerType()),
85
93
  file: exports.globalFile,
86
94
  params: [{
87
95
  name: 'x',
88
- type: new FloatType_1.FloatType()
96
+ type: new FloatType_1.FloatType(),
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(new IntegerType_1.IntegerType()),
94
103
  file: exports.globalFile,
95
104
  params: [{
96
105
  name: 'x',
97
- type: new FloatType_1.FloatType()
106
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
103
113
  file: exports.globalFile,
104
114
  params: [{
105
115
  name: 'x',
106
- type: new FloatType_1.FloatType()
116
+ type: new FloatType_1.FloatType(),
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(new IntegerType_1.IntegerType()),
112
123
  file: exports.globalFile,
113
124
  params: [{
114
125
  name: 'range',
115
- type: new IntegerType_1.IntegerType()
126
+ type: new IntegerType_1.IntegerType(),
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(new FloatType_1.FloatType()),
121
133
  file: exports.globalFile,
122
134
  params: [{
123
135
  name: '0',
124
- type: new IntegerType_1.IntegerType()
136
+ type: new IntegerType_1.IntegerType(),
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(new IntegerType_1.IntegerType()),
130
143
  file: exports.globalFile,
131
144
  params: [{
132
145
  name: 'x',
133
- type: new FloatType_1.FloatType()
146
+ type: new FloatType_1.FloatType(),
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(new IntegerType_1.IntegerType()),
139
153
  file: exports.globalFile,
140
154
  params: [{
141
155
  name: 'x',
142
- type: new IntegerType_1.IntegerType()
156
+ type: new IntegerType_1.IntegerType(),
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(new FloatType_1.FloatType()),
148
163
  file: exports.globalFile,
149
164
  params: [{
150
165
  name: 'x',
151
- type: new FloatType_1.FloatType()
166
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
157
173
  file: exports.globalFile,
158
174
  params: [{
159
175
  name: 'x',
160
- type: new FloatType_1.FloatType()
176
+ type: new FloatType_1.FloatType(),
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(new FloatType_1.FloatType()),
166
183
  file: exports.globalFile,
167
184
  params: [{
168
185
  name: 'x',
169
- type: new FloatType_1.FloatType()
186
+ type: new FloatType_1.FloatType(),
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(new ObjectType_1.ObjectType()),
176
194
  file: exports.globalFile,
177
195
  params: [{
178
196
  name: 'name',
179
- type: new StringType_1.StringType()
197
+ type: new StringType_1.StringType(),
198
+ isOptional: false
180
199
  }, {
181
200
  name: 'param2',
182
201
  type: new DynamicType_1.DynamicType(),
@@ -189,15 +208,24 @@ let runtimeFunctions = [{
189
208
  name: 'param4',
190
209
  type: new DynamicType_1.DynamicType(),
191
210
  isOptional: true
211
+ }, {
212
+ name: 'param5',
213
+ type: new DynamicType_1.DynamicType(),
214
+ isOptional: true
215
+ }, {
216
+ name: 'param6',
217
+ type: new DynamicType_1.DynamicType(),
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(new ObjectType_1.ObjectType()),
197
224
  file: exports.globalFile,
198
225
  params: [{
199
226
  name: 'variable',
200
- type: new ObjectType_1.ObjectType()
227
+ type: new ObjectType_1.ObjectType(),
228
+ isOptional: false
201
229
  }, {
202
230
  name: 'version',
203
231
  type: new StringType_1.StringType(),
@@ -206,64 +234,70 @@ let runtimeFunctions = [{
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(new ObjectType_1.ObjectType()),
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(new ObjectType_1.ObjectType()),
216
244
  file: exports.globalFile,
217
245
  params: [{
218
246
  name: 'x',
219
- type: new DynamicType_1.DynamicType()
247
+ type: new DynamicType_1.DynamicType(),
248
+ isOptional: false
220
249
  }]
221
250
  }, {
222
251
  name: 'Run',
223
252
  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()),
253
+ type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
225
254
  file: exports.globalFile,
226
255
  params: [{
227
256
  name: 'filename',
228
- type: new StringType_1.StringType()
257
+ type: new StringType_1.StringType(),
258
+ isOptional: false
229
259
  }, {
230
260
  name: 'arg',
231
261
  type: new DynamicType_1.DynamicType(),
232
- isRestArgument: true
262
+ isRestArgument: true,
263
+ isOptional: false
233
264
  }]
234
265
  }, {
235
266
  name: 'Run',
236
267
  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()),
268
+ type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
238
269
  file: exports.globalFile,
239
270
  params: [{
240
271
  name: 'filename',
241
- type: new ArrayType_1.ArrayType(new StringType_1.StringType())
272
+ type: new ArrayType_1.ArrayType(new StringType_1.StringType()),
273
+ isOptional: false
242
274
  }, {
243
275
  name: 'arg',
244
276
  type: new DynamicType_1.DynamicType(),
245
- isRestArgument: true
277
+ isRestArgument: true,
278
+ isOptional: true
246
279
  }]
247
280
  }, {
248
281
  name: 'Eval',
249
282
  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()),
283
+ type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
251
284
  file: exports.globalFile,
252
285
  isDeprecated: true,
253
286
  params: [{
254
287
  name: 'code',
255
- type: new StringType_1.StringType()
288
+ type: new StringType_1.StringType(),
289
+ isOptional: false
256
290
  }]
257
291
  }, {
258
292
  name: 'GetLastRunCompileError',
259
293
  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()),
294
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
261
295
  file: exports.globalFile,
262
296
  params: []
263
297
  }, {
264
298
  name: 'GetLastRunRuntimeError',
265
299
  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()),
300
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
267
301
  file: exports.globalFile,
268
302
  params: []
269
303
  }];
@@ -271,116 +305,132 @@ let globalUtilityFunctions = [
271
305
  {
272
306
  name: 'Sleep',
273
307
  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()),
308
+ type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
275
309
  file: exports.globalFile,
276
310
  params: [{
277
311
  name: 'milliseconds',
278
- type: new IntegerType_1.IntegerType()
312
+ type: new IntegerType_1.IntegerType(),
313
+ isOptional: false
279
314
  }]
280
315
  }, {
281
316
  name: 'Wait',
282
317
  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()),
318
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
284
319
  file: exports.globalFile,
285
320
  params: [{
286
321
  name: 'timeout',
287
- type: new IntegerType_1.IntegerType()
322
+ type: new IntegerType_1.IntegerType(),
323
+ isOptional: false
288
324
  }, {
289
325
  name: 'port',
290
- type: new ObjectType_1.ObjectType()
326
+ type: new ObjectType_1.ObjectType(),
327
+ isOptional: false
291
328
  }]
292
329
  }, {
293
330
  name: 'GetInterface',
294
331
  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()),
332
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
296
333
  file: exports.globalFile,
297
334
  params: [{
298
335
  name: 'object',
299
- type: new ObjectType_1.ObjectType()
336
+ type: new ObjectType_1.ObjectType(),
337
+ isOptional: false
300
338
  }, {
301
339
  name: 'ifname',
302
- type: new StringType_1.StringType()
340
+ type: new StringType_1.StringType(),
341
+ isOptional: false
303
342
  }]
304
343
  }, {
305
344
  name: 'FindMemberFunction',
306
345
  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()),
346
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
308
347
  file: exports.globalFile,
309
348
  params: [{
310
349
  name: 'object',
311
- type: new ObjectType_1.ObjectType()
350
+ type: new ObjectType_1.ObjectType(),
351
+ isOptional: false
312
352
  }, {
313
353
  name: 'functionName',
314
- type: new StringType_1.StringType()
354
+ type: new StringType_1.StringType(),
355
+ isOptional: false
315
356
  }]
316
357
  }, {
317
358
  name: 'UpTime',
318
359
  shortDescription: 'Returns the uptime of the system since the last reboot in seconds.',
319
- type: new FunctionType_1.FunctionType(new FloatType_1.FloatType()),
360
+ type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
320
361
  file: exports.globalFile,
321
362
  params: [{
322
363
  name: 'dummy',
323
- type: new IntegerType_1.IntegerType()
364
+ type: new IntegerType_1.IntegerType(),
365
+ isOptional: false
324
366
  }]
325
367
  }, {
326
368
  name: 'RebootSystem',
327
369
  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()),
370
+ type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
329
371
  file: exports.globalFile,
330
372
  params: []
331
373
  }, {
332
374
  name: 'ListDir',
333
375
  shortDescription: 'Returns a List object containing the contents of the directory path specified.',
334
- type: new FunctionType_1.FunctionType(new ObjectType_1.ObjectType()),
376
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
335
377
  file: exports.globalFile,
336
378
  params: [{
337
379
  name: 'path',
338
- type: new StringType_1.StringType()
380
+ type: new StringType_1.StringType(),
381
+ isOptional: false
339
382
  }]
340
383
  }, {
341
384
  name: 'ReadAsciiFile',
342
385
  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()),
386
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
344
387
  file: exports.globalFile,
345
388
  params: [{
346
389
  name: 'filePath',
347
- type: new StringType_1.StringType()
390
+ type: new StringType_1.StringType(),
391
+ isOptional: false
348
392
  }]
349
393
  }, {
350
394
  name: 'WriteAsciiFile',
351
395
  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()),
396
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
353
397
  file: exports.globalFile,
354
398
  params: [{
355
399
  name: 'filePath',
356
- type: new StringType_1.StringType()
400
+ type: new StringType_1.StringType(),
401
+ isOptional: false
357
402
  }, {
358
403
  name: 'text',
359
- type: new StringType_1.StringType()
404
+ type: new StringType_1.StringType(),
405
+ isOptional: false
360
406
  }]
361
407
  }, {
362
408
  name: 'CopyFile',
363
409
  shortDescription: 'Make a copy of a file.',
364
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
410
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
365
411
  file: exports.globalFile,
366
412
  params: [{
367
413
  name: 'source',
368
- type: new StringType_1.StringType()
414
+ type: new StringType_1.StringType(),
415
+ isOptional: false
369
416
  }, {
370
417
  name: 'destination',
371
- type: new StringType_1.StringType()
418
+ type: new StringType_1.StringType(),
419
+ isOptional: false
372
420
  }]
373
421
  }, {
374
422
  name: 'MoveFile',
375
423
  shortDescription: 'Rename a file.',
376
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
424
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
377
425
  file: exports.globalFile,
378
426
  params: [{
379
427
  name: 'source',
380
- type: new StringType_1.StringType()
428
+ type: new StringType_1.StringType(),
429
+ isOptional: false
381
430
  }, {
382
431
  name: 'destination',
383
- type: new StringType_1.StringType()
432
+ type: new StringType_1.StringType(),
433
+ isOptional: false
384
434
  }]
385
435
  }, {
386
436
  name: 'MatchFiles',
@@ -395,67 +445,75 @@ A '*' matches zero or more arbitrary characters.
395
445
  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
446
  A character class can be negated by specifying '^' as the first character. To match a literal '^' place it elsewhere within the class.
397
447
  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())),
448
+ type: new TypedFunctionType_1.TypedFunctionType(new ArrayType_1.ArrayType(new StringType_1.StringType())),
399
449
  file: exports.globalFile,
400
450
  params: [{
401
451
  name: 'path',
402
- type: new StringType_1.StringType()
452
+ type: new StringType_1.StringType(),
453
+ isOptional: false
403
454
  }, {
404
455
  name: 'pattern_in',
405
- type: new StringType_1.StringType()
456
+ type: new StringType_1.StringType(),
457
+ isOptional: false
406
458
  }]
407
459
  }, {
408
460
  name: 'DeleteFile',
409
461
  shortDescription: 'Delete the specified file.',
410
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
462
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
411
463
  file: exports.globalFile,
412
464
  params: [{
413
465
  name: 'file',
414
- type: new StringType_1.StringType()
466
+ type: new StringType_1.StringType(),
467
+ isOptional: false
415
468
  }]
416
469
  }, {
417
470
  name: 'DeleteDirectory',
418
471
  shortDescription: 'Deletes the specified directory. It is only possible to delete an empty directory.',
419
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
472
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
420
473
  file: exports.globalFile,
421
474
  params: [{
422
475
  name: 'dir',
423
- type: new StringType_1.StringType()
476
+ type: new StringType_1.StringType(),
477
+ isOptional: false
424
478
  }]
425
479
  }, {
426
480
  name: 'CreateDirectory',
427
481
  shortDescription: 'Creates the specified Directory. Only one directory can be created at a time',
428
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
482
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
429
483
  file: exports.globalFile,
430
484
  params: [{
431
485
  name: 'dir',
432
- type: new StringType_1.StringType()
486
+ type: new StringType_1.StringType(),
487
+ isOptional: false
433
488
  }]
434
489
  }, {
435
490
  name: 'FormatDrive',
436
491
  shortDescription: 'Formats a specified drive using the specified filesystem.',
437
- type: new FunctionType_1.FunctionType(new BooleanType_1.BooleanType()),
492
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
438
493
  file: exports.globalFile,
439
494
  params: [{
440
495
  name: 'drive',
441
- type: new StringType_1.StringType()
496
+ type: new StringType_1.StringType(),
497
+ isOptional: false
442
498
  }, {
443
499
  name: 'fs_type',
444
- type: new StringType_1.StringType()
500
+ type: new StringType_1.StringType(),
501
+ isOptional: false
445
502
  }]
446
503
  }, {
447
504
  name: 'StrToI',
448
505
  shortDescription: 'Return the integer value of the string, or 0 if nothing is parsed.',
449
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
506
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
450
507
  file: exports.globalFile,
451
508
  params: [{
452
509
  name: 'str',
453
- type: new StringType_1.StringType()
510
+ type: new StringType_1.StringType(),
511
+ isOptional: false
454
512
  }]
455
513
  }, {
456
514
  name: 'RunGarbageCollector',
457
515
  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()),
516
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
459
517
  file: exports.globalFile,
460
518
  params: []
461
519
  }, {
@@ -465,11 +523,12 @@ The characters '?', '*' and '[' lose their special meaning if preceded by a sing
465
523
  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
524
  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
525
  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()),
526
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
469
527
  file: exports.globalFile,
470
528
  params: [{
471
529
  name: 'jsonString',
472
- type: new StringType_1.StringType()
530
+ type: new StringType_1.StringType(),
531
+ isOptional: false
473
532
  },
474
533
  {
475
534
  name: 'flags',
@@ -487,14 +546,15 @@ An error will be returned if arrays/associative arrays are nested more than 256
487
546
  If an error occurs an empty string will be returned.
488
547
 
489
548
  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()),
549
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
491
550
  file: exports.globalFile,
492
551
  params: [{
493
552
  name: 'object',
494
- type: new ObjectType_1.ObjectType()
553
+ type: new ObjectType_1.ObjectType(),
554
+ isOptional: false
495
555
  }, {
496
556
  name: 'flags',
497
- type: new StringType_1.StringType(),
557
+ type: new UnionType_1.UnionType([IntegerType_1.IntegerType.instance, StringType_1.StringType.instance]),
498
558
  isOptional: true
499
559
  }]
500
560
  }, {
@@ -503,11 +563,12 @@ Normally non-ASCII characters are escaped in the output string as "\\uXXXX" wher
503
563
 
504
564
  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
565
  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()),
566
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
507
567
  file: exports.globalFile,
508
568
  params: [{
509
569
  name: 'source',
510
- type: new StringType_1.StringType()
570
+ type: new StringType_1.StringType(),
571
+ isOptional: false
511
572
  }]
512
573
  }
513
574
  ];
@@ -515,29 +576,32 @@ let globalStringFunctions = [
515
576
  {
516
577
  name: 'UCase',
517
578
  shortDescription: 'Converts the string to all upper case.',
518
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
579
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
519
580
  file: exports.globalFile,
520
581
  params: [{
521
582
  name: 's',
522
- type: new StringType_1.StringType()
583
+ type: new StringType_1.StringType(),
584
+ isOptional: false
523
585
  }]
524
586
  }, {
525
587
  name: 'LCase',
526
588
  shortDescription: 'Converts the string to all lower case.',
527
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
589
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
528
590
  file: exports.globalFile,
529
591
  params: [{
530
592
  name: 's',
531
- type: new StringType_1.StringType()
593
+ type: new StringType_1.StringType(),
594
+ isOptional: false
532
595
  }]
533
596
  }, {
534
597
  name: 'Asc',
535
598
  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()),
599
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
537
600
  file: exports.globalFile,
538
601
  params: [{
539
602
  name: 'letter',
540
- type: new StringType_1.StringType()
603
+ type: new StringType_1.StringType(),
604
+ isOptional: false
541
605
  }]
542
606
  }, {
543
607
  name: 'Chr',
@@ -548,59 +612,68 @@ let globalStringFunctions = [
548
612
  By using Chr, you can create strings containing characters which cannot be contained in quotes, such as newline or the quote character itself.
549
613
 
550
614
  print (Chr(34) + "hello" + Chr(34)) ' prints: "hello"`,
551
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
615
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
552
616
  file: exports.globalFile,
553
617
  params: [{
554
618
  name: 'ch',
555
- type: new IntegerType_1.IntegerType()
619
+ type: new IntegerType_1.IntegerType(),
620
+ isOptional: false
556
621
  }]
557
622
  }, {
558
623
  name: 'Instr',
559
624
  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()),
625
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
561
626
  file: exports.globalFile,
562
627
  params: [{
563
628
  name: 'start',
564
- type: new IntegerType_1.IntegerType()
629
+ type: new IntegerType_1.IntegerType(),
630
+ isOptional: false
565
631
  }, {
566
632
  name: 'text',
567
- type: new StringType_1.StringType()
633
+ type: new StringType_1.StringType(),
634
+ isOptional: false
568
635
  }, {
569
636
  name: 'substring',
570
- type: new StringType_1.StringType()
637
+ type: new StringType_1.StringType(),
638
+ isOptional: false
571
639
  }]
572
640
  }, {
573
641
  name: 'Left',
574
642
  shortDescription: 'Returns the first n characters of s. ',
575
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
643
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
576
644
  file: exports.globalFile,
577
645
  params: [{
578
646
  name: 's',
579
- type: new StringType_1.StringType()
647
+ type: new StringType_1.StringType(),
648
+ isOptional: false
580
649
  }, {
581
650
  name: 'n',
582
- type: new IntegerType_1.IntegerType()
651
+ type: new IntegerType_1.IntegerType(),
652
+ isOptional: false
583
653
  }]
584
654
  }, {
585
655
  name: 'Len',
586
656
  shortDescription: 'Returns the number of characters in the specified string.',
587
- type: new FunctionType_1.FunctionType(new IntegerType_1.IntegerType()),
657
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
588
658
  file: exports.globalFile,
589
659
  params: [{
590
660
  name: 's',
591
- type: new StringType_1.StringType()
661
+ type: new StringType_1.StringType(),
662
+ isOptional: false
592
663
  }]
593
664
  }, {
594
665
  name: 'Mid',
595
666
  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()),
667
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
597
668
  file: exports.globalFile,
598
669
  params: [{
599
670
  name: 's',
600
- type: new StringType_1.StringType()
671
+ type: new StringType_1.StringType(),
672
+ isOptional: false
601
673
  }, {
602
674
  name: 'p',
603
- description: '1-based position',
675
+ //description: '1-based position',
676
+ isOptional: false,
604
677
  type: new IntegerType_1.IntegerType()
605
678
  }, {
606
679
  name: 'n',
@@ -610,32 +683,36 @@ By using Chr, you can create strings containing characters which cannot be conta
610
683
  }, {
611
684
  name: 'Right',
612
685
  shortDescription: 'Returns the last n characters of s.',
613
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
686
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
614
687
  file: exports.globalFile,
615
688
  params: [{
616
689
  name: 's',
617
- type: new StringType_1.StringType()
690
+ type: new StringType_1.StringType(),
691
+ isOptional: false
618
692
  }, {
619
693
  name: 'n',
620
- type: new IntegerType_1.IntegerType()
694
+ type: new IntegerType_1.IntegerType(),
695
+ isOptional: false
621
696
  }]
622
697
  }, {
623
698
  name: 'Str',
624
699
  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()),
700
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
626
701
  file: exports.globalFile,
627
702
  params: [{
628
703
  name: 'value',
629
- type: new FloatType_1.FloatType()
704
+ type: new FloatType_1.FloatType(),
705
+ isOptional: false
630
706
  }]
631
707
  }, {
632
708
  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()),
709
+ 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.',
710
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
635
711
  file: exports.globalFile,
636
712
  params: [{
637
713
  name: 'value',
638
- type: new IntegerType_1.IntegerType()
714
+ type: new IntegerType_1.IntegerType(),
715
+ isOptional: false
639
716
  }, {
640
717
  name: 'radix',
641
718
  type: new IntegerType_1.IntegerType(),
@@ -644,68 +721,70 @@ By using Chr, you can create strings containing characters which cannot be conta
644
721
  }, {
645
722
  name: 'string',
646
723
  shortDescription: 'Returns a string composed of n copies of the second argument concatenated together.',
647
- type: new FunctionType_1.FunctionType(new StringType_1.StringType()),
724
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
648
725
  file: exports.globalFile,
649
726
  params: [{
650
727
  name: 'n',
651
- type: new IntegerType_1.IntegerType()
728
+ type: new IntegerType_1.IntegerType(),
729
+ isOptional: false
652
730
  }, {
653
731
  name: 'str',
654
- type: new StringType_1.StringType()
732
+ type: new StringType_1.StringType(),
733
+ isOptional: false
655
734
  }]
656
735
  }, {
657
736
  name: 'StringI',
658
737
  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()),
738
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
660
739
  file: exports.globalFile,
661
740
  params: [{
662
741
  name: 'n',
663
- type: new IntegerType_1.IntegerType()
742
+ type: new IntegerType_1.IntegerType(),
743
+ isOptional: false
664
744
  }, {
665
745
  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()
746
+ type: new IntegerType_1.IntegerType(),
747
+ isOptional: false
676
748
  }]
677
749
  }, {
678
750
  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()),
751
+ 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.',
752
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
681
753
  file: exports.globalFile,
682
754
  params: [{
683
755
  name: 'str',
684
- type: new StringType_1.StringType()
756
+ type: new StringType_1.StringType(),
757
+ isOptional: false
685
758
  }, {
686
759
  name: 'radix',
687
- type: new IntegerType_1.IntegerType()
760
+ type: new IntegerType_1.IntegerType(),
761
+ isOptional: true
688
762
  }]
689
763
  }, {
690
764
  name: 'Substitute',
691
765
  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()),
766
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
693
767
  file: exports.globalFile,
694
768
  params: [{
695
769
  name: 'str',
696
- type: new StringType_1.StringType()
770
+ type: new StringType_1.StringType(),
771
+ isOptional: false
697
772
  }, {
698
773
  name: 'arg0',
699
- type: new StringType_1.StringType()
774
+ type: new StringType_1.StringType(),
775
+ isOptional: false
700
776
  }, {
701
777
  name: 'arg1',
702
- type: new StringType_1.StringType()
778
+ type: new StringType_1.StringType(),
779
+ isOptional: true
703
780
  }, {
704
781
  name: 'arg2',
705
- type: new StringType_1.StringType()
782
+ type: new StringType_1.StringType(),
783
+ isOptional: true
706
784
  }, {
707
785
  name: 'arg3',
708
- type: new StringType_1.StringType()
786
+ type: new StringType_1.StringType(),
787
+ isOptional: true
709
788
  }]
710
789
  }
711
790
  ];
@@ -713,37 +792,212 @@ let programStatementFunctions = [
713
792
  {
714
793
  name: 'Tab',
715
794
  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()),
795
+ type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
717
796
  file: exports.globalFile,
718
797
  params: [{
719
798
  name: 'expression',
720
- type: new IntegerType_1.IntegerType()
799
+ type: new IntegerType_1.IntegerType(),
800
+ isOptional: false
721
801
  }]
722
802
  }, {
723
803
  name: 'Pos',
724
804
  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()),
805
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
726
806
  file: exports.globalFile,
727
807
  params: [{
728
808
  name: 'x',
729
- type: new IntegerType_1.IntegerType()
809
+ type: new IntegerType_1.IntegerType(),
810
+ isOptional: false
730
811
  }]
731
812
  //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
813
  }, {
733
814
  name: 'Roku_Ads',
734
815
  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()),
816
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
817
+ file: exports.globalFile,
818
+ params: []
819
+ //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
820
+ }, {
821
+ name: 'Roku_Event_Dispatcher',
822
+ 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',
823
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
824
+ file: exports.globalFile,
825
+ params: []
826
+ }, {
827
+ name: 'bslBrightScriptErrorCodes',
828
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of the error name and corresponding integer value, for example ERR_OKAY = &hFF.',
829
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
830
+ file: exports.globalFile,
831
+ params: []
832
+ }, {
833
+ name: 'bslGeneralConstants',
834
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of system constants, for example MAX_INT = 2147483647.',
835
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
736
836
  file: exports.globalFile,
737
837
  params: []
838
+ }, {
839
+ name: 'bslUniversalControlEventCodes',
840
+ shortDescription: 'Returns an roAssociativeArray with name value pairs of the remote key code (buttons) constants, for example BUTTON_SELECT_PRESSED = 6.',
841
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
842
+ file: exports.globalFile,
843
+ params: []
844
+ },
845
+ {
846
+ name: 'AsciiToHex',
847
+ shortDescription: 'Returns the hex encoded string, for example AsciiToHex("Hi!") = "486921".',
848
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
849
+ file: exports.globalFile,
850
+ params: [{
851
+ name: 'ascii',
852
+ type: new StringType_1.StringType(),
853
+ isOptional: false
854
+ }]
855
+ }, {
856
+ name: 'HexToAscii',
857
+ shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
858
+ type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
859
+ file: exports.globalFile,
860
+ params: [{
861
+ name: 'hex',
862
+ type: new StringType_1.StringType(),
863
+ isOptional: false
864
+ }]
865
+ },
866
+ {
867
+ name: 'HexToInteger',
868
+ shortDescription: 'Returns the integer value of the passed in hex string.',
869
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
870
+ file: exports.globalFile,
871
+ params: [{
872
+ name: 'hex',
873
+ type: new StringType_1.StringType(),
874
+ isOptional: false
875
+ }]
876
+ }, {
877
+ name: 'HexToInteger',
878
+ shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
879
+ type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
880
+ file: exports.globalFile,
881
+ params: [{
882
+ name: 'hex',
883
+ type: new StringType_1.StringType(),
884
+ isOptional: false
885
+ }]
886
+ }, {
887
+ name: 'dfNewBitmapSet',
888
+ 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).
889
+ 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.
890
+ Returns an roAssociativeArray with the following name value pairs:
891
+ ExtraInfo: roAssociativeArray
892
+ Regions: roAssociativeArray of name, roRegions pairs
893
+ Animations: roAssociativeArray of name, roArray of roRegion pairs.
894
+ Backgrounds: roAssociativeArray of name, path pairs.`,
895
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
896
+ file: exports.globalFile,
897
+ params: [{
898
+ name: 'filename',
899
+ type: new StringType_1.StringType(),
900
+ isOptional: false
901
+ }]
902
+ }, {
903
+ name: 'dfDrawMessage',
904
+ 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.',
905
+ type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
906
+ file: exports.globalFile,
907
+ params: [{
908
+ name: 'dest',
909
+ type: new ObjectType_1.ObjectType(),
910
+ isOptional: false
911
+ }, {
912
+ name: 'region',
913
+ type: new ObjectType_1.ObjectType(),
914
+ isOptional: false
915
+ }]
916
+ }, {
917
+ name: 'dfDrawImage',
918
+ 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.',
919
+ type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
920
+ file: exports.globalFile,
921
+ params: [{
922
+ name: 'dest',
923
+ type: new ObjectType_1.ObjectType(),
924
+ isOptional: false
925
+ }, {
926
+ name: 'path',
927
+ type: new StringType_1.StringType(),
928
+ isOptional: false
929
+ }, {
930
+ name: 'x',
931
+ type: new IntegerType_1.IntegerType(),
932
+ isOptional: false
933
+ }, {
934
+ name: 'y',
935
+ type: new IntegerType_1.IntegerType(),
936
+ isOptional: false
937
+ }]
938
+ }, {
939
+ name: 'dfSetupDisplayRegions',
940
+ shortDescription: `Helper function to setup screen scaling with supplied pillar box or letterbox images to fill the entire screen.
941
+ screen is an roScreen
942
+ topx and topy are the coordinates of the upper left hand corner of the main drawing region
943
+ Width and height is the size of the main drawing region
944
+
945
+ Returns an associative array containing the following roRegions
946
+ Main: main drawable region
947
+ Left: left region if there is pillar box area on the left
948
+ Right: right region if there is a pillar box area on the right
949
+ Upper: upper region if there is a letterbox area at thetop
950
+ Lower: lower region if there is a letterbox area at the bottom
951
+ When using these regions as drawables, your graphics will be translated and clipped to these regions.`,
952
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
953
+ file: exports.globalFile,
954
+ params: [{
955
+ name: 'screen',
956
+ type: new ObjectType_1.ObjectType(),
957
+ isOptional: false
958
+ }, {
959
+ name: 'topx',
960
+ type: new IntegerType_1.IntegerType(),
961
+ isOptional: false
962
+ }, {
963
+ name: 'topy',
964
+ type: new IntegerType_1.IntegerType(),
965
+ isOptional: false
966
+ }, {
967
+ name: 'width',
968
+ type: new IntegerType_1.IntegerType(),
969
+ isOptional: false
970
+ }, {
971
+ name: 'height',
972
+ type: new IntegerType_1.IntegerType(),
973
+ isOptional: false
974
+ }]
975
+ }, {
976
+ name: 'dfSetBackground',
977
+ 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.
978
+ backgroundName is a key for the Backgrounds roAssociative array of backgrounds.
979
+ Backgrounds is an roAssociative array of background name keys and file path string values
980
+ This function creates an roBitmap out of the background image file and returns a region the size of the entire roBitmap.`,
981
+ type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
982
+ file: exports.globalFile,
983
+ params: [{
984
+ name: 'backgroundName',
985
+ type: new StringType_1.StringType(),
986
+ isOptional: false
987
+ }, {
988
+ name: 'backgrounds',
989
+ type: new ObjectType_1.ObjectType(),
990
+ isOptional: false
991
+ }]
738
992
  }
739
993
  ];
740
994
  exports.globalCallables = [...mathFunctions, ...runtimeFunctions, ...globalUtilityFunctions, ...globalStringFunctions, ...programStatementFunctions];
741
995
  for (let callable of exports.globalCallables) {
742
996
  //give each callable a dummy location
743
- callable.nameRange = util_1.default.createRange(0, 0, 0, callable.name.length);
997
+ callable.nameRange = util_1.util.createRange(0, 0, 0, callable.name.length);
744
998
  //add each parameter to the type
745
999
  for (let param of callable.params) {
746
- callable.type.addParameter(param);
1000
+ callable.type.addParameter(param.name, param.type, param.isOptional);
747
1001
  }
748
1002
  //set name in type
749
1003
  callable.type.setName(callable.name);
@@ -751,7 +1005,7 @@ for (let callable of exports.globalCallables) {
751
1005
  return this.name;
752
1006
  };
753
1007
  }
754
- exports.globalFile.callables = exports.globalCallables;
1008
+ exports.globalFile.staticCallables = exports.globalCallables;
755
1009
  /**
756
1010
  * A map of all built-in function names. We use this extensively in scope validation
757
1011
  * so keep a single copy in memory to improve performance