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
package/README.md CHANGED
@@ -1,18 +1,33 @@
1
- # BrighterScript [v1 branch]
1
+ # BrighterScript
2
2
 
3
3
  A superset of Roku's BrightScript language. Compiles to standard BrightScript.
4
4
 
5
- [![build](https://img.shields.io/github/workflow/status/rokucommunity/brighterscript/build.svg?logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=workflow%3Abuild)
6
- [![Coverage Status](https://coveralls.io/repos/github/rokucommunity/brighterscript/badge.svg?branch=master)](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
7
- [![NPM Version](https://badge.fury.io/js/brighterscript.svg?style=flat)](https://npmjs.org/package/brighterscript)
5
+ [![build status](https://img.shields.io/github/actions/workflow/status/rokucommunity/brighterscript/build.yml?branch=master&logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=branch%3Amaster+workflow%3Abuild)
6
+ [![coverage status](https://img.shields.io/coveralls/github/rokucommunity/brighterscript?logo=coveralls)](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
7
+ [![monthly downloads](https://img.shields.io/npm/dm/brighterscript.svg?sanitize=true&logo=npm&logoColor=)](https://npmcharts.com/compare/brighterscript?minimal=true)
8
+ [![npm version](https://img.shields.io/npm/v/brighterscript.svg?logo=npm)](https://www.npmjs.com/package/brighterscript)
9
+ [![license](https://img.shields.io/npm/l/brighterscript.svg)](LICENSE)
10
+ [![Slack](https://img.shields.io/badge/Slack-RokuCommunity-4A154B?logo=slack)](https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA)
8
11
 
9
- This is the v1 branch. Unless you're specifically looking for v1, you probably want to view [the master branch](https://github.com/rokucommunity/brighterscript).
10
12
  ## Overview
11
13
 
14
+ **WARNING: this is the v0.66.0 branch with experimental features**
15
+
12
16
  The BrighterScript language provides new features and syntax enhancements to Roku's BrightScript language. Because the language is a superset of BrightScript, the parser and associated tools (VSCode integration, cli, etc...) work with standard BrightScript (.brs) files. This means you will get benefits (as described in the following section) from using the BrighterScript compiler, whether your project contains BrighterScript (.bs) files or not. The BrighterScript language transpiles to standard BrightScript, so your code is fully compatible with all roku devices.
13
17
 
18
+ ## Help!
19
+
20
+ > [!IMPORTANT]
21
+ > We are currently seeking testers for two major rewrites:
22
+
23
+ - Language Server Protocol (LSP) Rewrite: We’ve been hard at work revamping our LSP to improve stability, performance, and add new features. We would love your feedback as you put it through its paces. ([Join the LSP discussion](https://github.com/rokucommunity/brighterscript/discussions/1322))
24
+
25
+ - Version 1 (v1) Rewrite: This is a complete overhaul of the core of our project. Your input is crucial in helping us identify bugs and further refine the release. ([Join the v1 discussion](https://github.com/rokucommunity/brighterscript/discussions/1321))
26
+
27
+ If you're interested in helping, please visit the GitHub discussion links above for more information and instructions on how to get involved.
28
+
14
29
  ## Features
15
- BrighterScript adds several new features to the BrightScript language such as Namespaces, classes, import statements, and more. Take a look at the language specification docs for more information.
30
+ BrighterScript adds several new features to the BrightScript language such as namespaces, classes, import statements, and more. Take a look at the language specification docs for more information.
16
31
 
17
32
  [BrighterScript Language Specification](https://github.com/rokucommunity/BrighterScript/blob/master/docs/readme.md)
18
33
 
@@ -59,12 +74,39 @@ BrighterScript adds several new features to the BrightScript language such as Na
59
74
  - And if it's not enough, the [plugin API](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md) allows extending the compiler to provide extra diagnostics or transformations.
60
75
 
61
76
  ## Who uses Brighterscript?
62
-
63
- Brighterscript is used by [applicaster](https://www.applicaster.com/), [The miracle channel](https://miraclechannel.ca/corco/), and in open source projects such as [rooibos](https://github.com/georgejecook/rooibos/blob/master/docs/index.md), and the [maestro framework](https://github.com/georgejecook/maestro/blob/master/docs/index.md). The language has been in use for almost a year, and there are at least 2,000+ BrighterScript transpiled files on published channels.
64
-
65
- The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=celsoaf.brightscript) VSCode extension, and other tools.
66
-
67
- More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler as part of their build pipeline. Be sure to watch this space!
77
+ <br/>
78
+ <p align="center">
79
+ <a href="https://www.fubo.tv/">
80
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192530108-eb470b85-e687-4575-af69-254aab13428c.png">
81
+ </a>&nbsp;&nbsp;&nbsp;
82
+ <a href="mailto:chris@inverted-solutions.com">
83
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197794500-2bac4903-ed00-463a-b243-24c68fba7962.png">
84
+ </a>&nbsp;&nbsp;&nbsp;
85
+ <a href="https://www.applicaster.com/">
86
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192591901-20441fc8-3c6c-45ea-8851-b22430e6fb8e.png">
87
+ </a>&nbsp;&nbsp;&nbsp;
88
+ <a href="https://www.redspace.com/">
89
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/195908446-8d9652f8-9877-426f-b3c6-09119d788fd8.png">
90
+ </a>&nbsp;&nbsp;&nbsp;
91
+ <br/><br/>
92
+ <a href="https://tantawowa.com/">
93
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197795138-2ec870db-71fe-49e3-a014-692a3f31e6aa.png">
94
+ </a>&nbsp;&nbsp;&nbsp;
95
+ <a href="https://www.miraclechannel.ca/corcoplus">
96
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192593254-f2a32cd4-0482-40de-830d-c1d09690c46b.png">
97
+ </a>&nbsp;&nbsp;&nbsp;
98
+ <a href="https://digitalpictureframe.tv">
99
+ <img height="38" src="https://s3.us-east-1.wasabisys.com/tv.digitalpictureframe.assets/logo-wide.png">
100
+ </a>&nbsp;&nbsp;&nbsp;
101
+ <a href="https://www.haystack.tv/">
102
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192610056-d1b5a382-edf4-47b9-a6a5-d2d3ee9094cb.png">
103
+ </a>&nbsp;&nbsp;&nbsp;
104
+ </p>
105
+ <br/>
106
+
107
+ The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=rokucommunity.brightscript) VSCode extension, the [maestro framework](https://github.com/georgejecook/maestro-roku), and more.
108
+
109
+ [Contact us](https://github.com/rokucommunity/brighterscript/issues/new) if you use BrighterScript in your project and would like your logo listed above. More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler in their build pipeline.
68
110
 
69
111
  ## What's with the name?
70
112
  The name BrighterScript is a compliment to everything that is great about Roku's awesome BrightScript language. Naming things is hard, and discoverability and recognizability are both very important. Here are the reasons we chose this name:
@@ -133,128 +175,27 @@ If you need to configure `bsc`, you can do so in two ways:
133
175
  ## bsconfig.json
134
176
 
135
177
  ### Overview
136
- The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project.
137
-
138
- ### Configuration inheritance with `extends`
139
-
140
- A `bsconfig.json` file can inherit configurations from another file using the `extends` property.
141
-
142
- The extends is a top-level property in `bsconfig.json`. `extends`’ value is a string containing a path to another configuration file to inherit from.
143
-
144
- The configuration from the base file are loaded first, then overridden by those in the inheriting config file. If a circularity is encountered, we report an error.
145
-
146
- The `files` property from the inheriting config file overwrite those from the base config file.
147
-
148
- All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.
149
-
150
- ### Optional `extends` and `project`
151
- There are situations where you want to store some compiler settings in a config file, but not fail if that config file doesn't exist. To do this, you can denote that your `extends` or `project` path is optional by prefixing it with a question mark (`?`). For example:
152
-
153
- - **bsconfig.json** `extends`
154
- ```json
155
- {
156
- "extends": "?path/to/optional/bsconfig.json"
157
- }
158
- ```
159
- - CLI "extends"
160
- ```
161
- bsc --extends "?path/to/optional/bsconfig.json"
162
- ```
163
-
164
- - CLI `project` argument
165
- ```
166
- bsc --project "?path/to/optional/bsconfig.json"
167
- ```
168
- - Node.js API `extends`
169
- ```
170
- var programBuilder = new ProgramBuilder({
171
- "extends": "?path/to/optional/bsconfig.json"
172
- });
173
- ```
174
- - Node.js API `project`
175
- ```
176
- var programBuilder = new ProgramBuilder({
177
- "project": "?path/to/optional/bsconfig.json"
178
- });
179
- ```
180
-
181
- ### bsconfig.json options
182
-
183
- These are the options available in the `bsconfig.json` file.
184
-
185
- - **project**: `string` - A path to a project file. This is really only passed in from the command line or the NodeJS API, and should not be present in `bsconfig.json` files. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
186
-
187
- - **extends**: `string` - Relative or absolute path to another `bsconfig.json` file that this `bsconfig.json` file should import and then override. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
188
-
189
- - **cwd**: `string` - Override the current working directory
190
-
191
- - **rootDir**: `string` - The root directory of your roku project. Defaults to current directory
192
-
193
- - **files**: ` (string | string[] | { src: string | string[]; dest?: string })[]` - The list file globs used to find all files for the project. If using the {src;dest;} format, you can specify a different destination directory for the matched files in src.
194
-
195
- - **outFile**: `string` - The path (including filename) where the output file should be placed (defaults to `"./out/[WORKSPACE_FOLDER_NAME].zip"`).
196
-
197
- - **createPackage**: `boolean` - Creates a zip package. Defaults to true. This setting is ignored when `deploy` is enabled.
198
-
199
- - **watch**: `boolean` - If true, the server will keep running and will watch and recompile on every file change.
200
-
201
- - **deploy**: `boolean` - If true, after a successful build, the project will be deployed to the Roku specified in host.
202
-
203
- - **host**: `string` - The host of the Roku that this project will deploy to.
204
-
205
- - **username**: `string` - the username to use when deploying to a Roku device.
206
-
207
- - **password**: `string` - The password to use when deploying to a roku device.
208
-
209
- - **emitFullPaths**: `boolean` - Emit full paths to files when printing diagnostics to the console. Defaults to false
210
-
211
- - **diagnosticFilters**: `Array<string | number | {src: string; codes: number[]}` - A list of filters used to hide diagnostics.
212
- - A `string` value should be a relative-to-root-dir or absolute file path or glob pattern of the files that should be excluded. Any file matching this pattern will have all diagnostics supressed.
213
- - A `number` value should be a diagnostic code. This will supress all diagnostics with that code for the whole project.
214
- - An object can also be provided to filter specific diagnostic codes for a file pattern. For example,
215
- ```jsonc
216
- "diagnosticFilters": [{
217
- "src": "vendor/**/*",
218
- "codes": [1000, 1011] //ignore these specific codes from vendor libraries
219
- }]
220
- ```
221
- - **diagnosticLevel**: `'hint' | 'info' | 'warn' | 'error'` - Specify what diagnostic levels are printed to the console. This has no effect on what diagnostics are reported in the LanguageServer. Defaults to 'warn'
222
-
223
- - **autoImportComponentScript**: `bool` - BrighterScript only: will automatically import a script at transpile-time for a component with the same name if it exists.
224
-
225
- - **sourceRoot**: `string` - Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.
226
-
227
- - **plugins**: `Array<string>` - List of node scripts or npm modules to load as plugins to the BrighterScript compiler.
228
-
229
- ## Ignore errors and warnings on a per-line basis
230
- In addition to disabling an entire class of errors in `bsconfig.json` by using `ignoreErrorCodes`, you may also disable errors for a subset of the complier rules within a file with the following comment flags:
231
- - `bs:disable-next-line`
232
- - `bs:disable-next-line: code1 code2 code3`
233
- - `bs:disable-line`
234
- - `bs:disable-line: code1 code2 code3`
235
-
236
- Here are some examples:
237
-
238
- ```BrightScript
239
- sub Main()
240
- 'disable errors about invalid syntax here
241
- 'bs:disable-next-line
242
- DoSomething(
243
-
244
- DoSomething( 'bs:disable-line
245
-
246
- 'disable errors about wrong parameter count
247
- DoSomething(1,2,3) 'bs:disable-next-line
248
-
249
- DoSomething(1,2,3) 'bs:disable-next-line:1002
250
- end sub
251
-
252
- sub DoSomething()
253
- end sub
178
+ The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project. Here is a minimal example, which is recommended for new projects:
179
+
180
+ ```jsonc
181
+ {
182
+ "rootDir": "src",
183
+ "files": [
184
+ "**/*"
185
+ ],
186
+ "stagingFolderPath": "dist",
187
+ "retainStagingFolder": true,
188
+ //this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
189
+ "autoImportComponentScript": true,
190
+ "sourceMap": true
191
+ }
254
192
  ```
255
193
 
256
- The primary motivation for this feature was to provide a stopgap measure to hide incorrectly-thrown errors on legitimate BrightScript code due to parser bugs. This is still a new project and it is likely to be missing support for certain BrightScript syntaxes. It is recommended that you only use these comments when absolutely necessary.
194
+ More information on the config file format may be found in the [bsconfig.json documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/bsconfig.md).
195
+
196
+ ## Suppressing compiler messages
257
197
 
198
+ The BrighterScript compiler emits errors and warnings when it encounters potentially invalid code. Errors and warnings may also be emitted by compiler plugins, such as by [the BrighterScript linter](https://github.com/rokucommunity/bslint). These messages can be suppressed if needed; see [the documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/suppressing-compiler-messages.md).
258
199
 
259
200
  ## ropm support
260
201
  In order for BrighterScript-transpiled projects to work as ropm modules, they need a reference to [bslib](https://github.com/rokucommunity/bslib/blob/master/source/bslib.brs) (the BrightScript runtime library for BrighterScript features) in their package. As `ropm` and `brighterscript` become more popular, this could result in many duplicate copies of `bslib.brs`.
@@ -21,6 +21,24 @@
21
21
  "description": "The root directory of your Roku project. Defaults to the current working directory (or cwd property)",
22
22
  "type": "string"
23
23
  },
24
+ "manifest": {
25
+ "description": "A entry to modify manifest values",
26
+ "type": "object",
27
+ "properties": {
28
+ "bs_const": {
29
+ "description": "A dictionary of bs_consts to change or add to the manifest. Each entry ",
30
+ "type": "object",
31
+ "patternProperties": {
32
+ "^.+$": {
33
+ "type": [
34
+ "boolean",
35
+ "null"
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ }
41
+ },
24
42
  "files": {
25
43
  "description": "The list of files that should be used in this project. Supports globs. Optionally, you can specify an object with `src` and `dest` properties to move files from one location into a different destination location",
26
44
  "default": [
@@ -29,6 +47,7 @@
29
47
  "components/**/*.*",
30
48
  "images/**/*.*"
31
49
  ],
50
+ "type": "array",
32
51
  "items": {
33
52
  "anyOf": [
34
53
  {
@@ -105,13 +124,25 @@
105
124
  "description": " The password to use when deploying to a Roku device",
106
125
  "type": "string"
107
126
  },
127
+ "retainStagingDir": {
128
+ "type": "boolean",
129
+ "description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
130
+ "default": false
131
+ },
108
132
  "retainStagingFolder": {
109
133
  "type": "boolean",
134
+ "deprecated": true,
110
135
  "description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
111
136
  "default": false
112
137
  },
138
+ "stagingDir": {
139
+ "type": "string",
140
+ "description": "The path to the staging folder (where all files are copied before creating the zip package)"
141
+ },
113
142
  "stagingFolderPath": {
114
143
  "type": "string",
144
+ "deprecated": true,
145
+ "deprecationMessage": "Deprecated. Use `stagingDir` instead.",
115
146
  "description": "The path to the staging folder (where all files are copied before creating the zip package)"
116
147
  },
117
148
  "ignoreErrorCodes": {
@@ -128,6 +159,24 @@
128
159
  ]
129
160
  }
130
161
  },
162
+ "diagnosticSeverityOverrides": {
163
+ "description": "A map of error codes with their severity level override (error|warn|info)",
164
+ "type": "object",
165
+ "patternProperties": {
166
+ ".{1,}": {
167
+ "type": [
168
+ "number",
169
+ "string"
170
+ ],
171
+ "enum": [
172
+ "error",
173
+ "warn",
174
+ "info",
175
+ "hint"
176
+ ]
177
+ }
178
+ }
179
+ },
131
180
  "emitFullPaths": {
132
181
  "description": "Emit full paths to files when printing diagnostics to the console.",
133
182
  "type": "boolean",
@@ -138,6 +187,11 @@
138
187
  "type": "boolean",
139
188
  "default": false
140
189
  },
190
+ "removeParameterTypes": {
191
+ "description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
192
+ "type": "boolean",
193
+ "default": false
194
+ },
141
195
  "diagnosticFilters": {
142
196
  "description": "A collection of filters used to hide diagnostics for certain files",
143
197
  "type": "array",
@@ -165,7 +219,10 @@
165
219
  "items": {
166
220
  "anyOf": [
167
221
  {
168
- "type": ["number", "string"],
222
+ "type": [
223
+ "number",
224
+ "string"
225
+ ],
169
226
  "description": "A code of diagnostics that should be filtered out from the files matched in 'src'"
170
227
  }
171
228
  ]
@@ -188,6 +245,18 @@
188
245
  ]
189
246
  }
190
247
  },
248
+ "require": {
249
+ "description": "A list of scripts or modules to pass to node's `require()` on startup. This is useful for doing things like ts-node registration",
250
+ "type": "array",
251
+ "items": {
252
+ "anyOf": [
253
+ {
254
+ "type": "string",
255
+ "description": "a path to a node script or an npm module to load dynamically at startup."
256
+ }
257
+ ]
258
+ }
259
+ },
191
260
  "autoImportComponentScript": {
192
261
  "description": "When enabled, every xml component will search for a .bs or .brs file with the same name in the same folder, and add it as a script import if found. Disabled by default",
193
262
  "type": "boolean",
@@ -210,6 +279,11 @@
210
279
  "description": "Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.",
211
280
  "type": "string"
212
281
  },
282
+ "resolveSourceRoot": {
283
+ "description": "Should the `sourceRoot` property be resolve to an absolute path (relative to the bsconfig it's defined in)",
284
+ "type": "boolean",
285
+ "default": false
286
+ },
213
287
  "diagnosticLevel": {
214
288
  "description": "Specify what diagnostic levels are printed to the console. This has no effect on what diagnostics are reported in the LanguageServer. Defaults to 'warn'",
215
289
  "type": "string",
@@ -220,6 +294,16 @@
220
294
  "warn",
221
295
  "error"
222
296
  ]
297
+ },
298
+ "allowBrighterScriptInBrightScript": {
299
+ "description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
300
+ "type": "boolean",
301
+ "default": false
302
+ },
303
+ "legacyCallfuncHandling": {
304
+ "description": "Legacy RokuOS versions required at least one argument in callfunc() invocations. Previous brighterscript versions handled this by inserting invalid as an argument when no other args are present. This is not necessary in modern RokuOS versions.",
305
+ "type": "boolean",
306
+ "default": false
223
307
  }
224
308
  }
225
309
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Enforces that a single action can be running at a time
3
+ */
4
+ export declare class ActionPipeline {
5
+ private workQueue;
6
+ run<T extends Action<any>, R extends Awaited<PromiseLike<ReturnType<T>>>>(action: T): Promise<R>;
7
+ private process;
8
+ private isProcessing;
9
+ }
10
+ export declare type Action<T> = () => T | PromiseLike<T>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionPipeline = void 0;
4
+ const deferred_1 = require("./deferred");
5
+ /**
6
+ * Enforces that a single action can be running at a time
7
+ */
8
+ class ActionPipeline {
9
+ constructor() {
10
+ this.workQueue = [];
11
+ this.isProcessing = false;
12
+ }
13
+ run(action) {
14
+ const work = {
15
+ action: action,
16
+ deferred: new deferred_1.Deferred()
17
+ };
18
+ this.workQueue.push(work);
19
+ this.process();
20
+ return work.deferred.promise;
21
+ }
22
+ process() {
23
+ //if we're already processing,
24
+ if (this.isProcessing) {
25
+ return;
26
+ }
27
+ while (this.workQueue.length > 0) {
28
+ const work = this.workQueue.shift();
29
+ try {
30
+ const result = Promise.resolve(work.action());
31
+ work.deferred.resolve(result);
32
+ }
33
+ catch (e) {
34
+ work.deferred.reject(e);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ exports.ActionPipeline = ActionPipeline;
40
+ //# sourceMappingURL=ActionPipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionPipeline.js","sourceRoot":"","sources":["../src/ActionPipeline.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAA3B;QACY,cAAS,GAAqB,EAAE,CAAC;QA6BjC,iBAAY,GAAG,KAAK,CAAC;IACjC,CAAC;IA5BU,GAAG,CAAuE,MAAS;QACtF,MAAM,IAAI,GAAG;YACT,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI,mBAAQ,EAAO;SAChC,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IACjC,CAAC;IAEO,OAAO;QACX,8BAA8B;QAC9B,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,OAAO;SACV;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACpC,IAAI;gBACA,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAC1B,IAAI,CAAC,MAAM,EAAE,CAChB,CAAC;gBACF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aACjC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC3B;SACJ;IACL,CAAC;CAEJ;AA/BD,wCA+BC"}
@@ -0,0 +1,42 @@
1
+ import type { DottedGetExpression, TypeExpression, VariableExpression } from './parser/Expression';
2
+ import type { TypeChainEntry } from './interfaces';
3
+ import type { AstNode } from './parser/AstNode';
4
+ import { SymbolTypeFlag } from './SymbolTypeFlag';
5
+ import type { Token } from './lexer/Token';
6
+ import type { BrsFile } from './files/BrsFile';
7
+ export declare const InsideSegmentWalkMode: number;
8
+ export interface UnresolvedSymbol {
9
+ typeChain: TypeChainEntry[];
10
+ flags: SymbolTypeFlag;
11
+ endChainFlags: SymbolTypeFlag;
12
+ containingNamespaces: string[];
13
+ file: BrsFile;
14
+ lookups: string[];
15
+ }
16
+ export interface AssignedSymbol {
17
+ token: Token;
18
+ node: AstNode;
19
+ }
20
+ export declare class AstValidationSegmenter {
21
+ file: BrsFile;
22
+ validatedSegments: Map<AstNode, boolean>;
23
+ segmentsForValidation: AstNode[];
24
+ singleValidationSegments: Set<AstNode>;
25
+ unresolvedSegmentsSymbols: Map<AstNode, Set<UnresolvedSymbol>>;
26
+ assignedTokensInSegment: Map<AstNode, Set<AssignedSymbol>>;
27
+ ast: AstNode;
28
+ constructor(file: BrsFile);
29
+ reset(): void;
30
+ processTree(ast: AstNode): void;
31
+ checkExpressionForUnresolved(segment: AstNode, expression: VariableExpression | DottedGetExpression | TypeExpression, assignedSymbolsNames?: Set<string>): any;
32
+ private currentNamespaceStatement;
33
+ private currentClassStatement;
34
+ checkSegmentWalk(segment: AstNode): void;
35
+ getAllUnvalidatedSegments(): AstNode[];
36
+ getSegmentsWithChangedSymbols(changedSymbols: Map<SymbolTypeFlag, Set<string>>): AstNode[];
37
+ markSegmentAsValidated(segment: AstNode): void;
38
+ unValidateAllSegments(): void;
39
+ hasUnvalidatedSegments(): boolean;
40
+ checkIfSegmentNeedsRevalidation(segment: AstNode, changedSymbols: Map<SymbolTypeFlag, Set<string>>): boolean;
41
+ markSegmentsInvalidatedBySymbol(symbolName: string, flag: SymbolTypeFlag): void;
42
+ }