brighterscript 1.0.0-alpha.3 → 1.0.0-alpha.31

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 (608) hide show
  1. package/CHANGELOG.md +1249 -285
  2. package/README.md +61 -131
  3. package/bsconfig.schema.json +68 -2
  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 +232 -0
  9. package/dist/AstValidationSegmenter.js.map +1 -0
  10. package/dist/BsConfig.d.ts +51 -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 +11 -2
  21. package/dist/CodeActionUtil.js +17 -3
  22. package/dist/CodeActionUtil.js.map +1 -1
  23. package/dist/CommentFlagProcessor.d.ts +7 -6
  24. package/dist/CommentFlagProcessor.js +10 -7
  25. package/dist/CommentFlagProcessor.js.map +1 -1
  26. package/dist/CrossScopeValidator.d.ts +67 -0
  27. package/dist/CrossScopeValidator.js +625 -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 +18 -16
  34. package/dist/DiagnosticCollection.js.map +1 -1
  35. package/dist/DiagnosticFilterer.d.ts +8 -4
  36. package/dist/DiagnosticFilterer.js +77 -44
  37. package/dist/DiagnosticFilterer.js.map +1 -1
  38. package/dist/DiagnosticManager.d.ts +56 -0
  39. package/dist/DiagnosticManager.js +218 -0
  40. package/dist/DiagnosticManager.js.map +1 -0
  41. package/dist/DiagnosticMessages.d.ts +187 -20
  42. package/dist/DiagnosticMessages.js +247 -29
  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 +544 -312
  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 +199 -100
  63. package/dist/Program.js +1056 -700
  64. package/dist/Program.js.map +1 -1
  65. package/dist/ProgramBuilder.d.ts +29 -18
  66. package/dist/ProgramBuilder.js +170 -132
  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 +290 -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 +331 -0
  94. package/dist/astUtils/CachedLookups.js.map +1 -0
  95. package/dist/astUtils/Editor.d.ts +69 -0
  96. package/dist/astUtils/Editor.js +245 -0
  97. package/dist/astUtils/Editor.js.map +1 -0
  98. package/dist/astUtils/Editor.spec.js +258 -0
  99. package/dist/astUtils/Editor.spec.js.map +1 -0
  100. package/dist/astUtils/creators.d.ts +33 -10
  101. package/dist/astUtils/creators.js +224 -30
  102. package/dist/astUtils/creators.js.map +1 -1
  103. package/dist/astUtils/creators.spec.js +5 -5
  104. package/dist/astUtils/creators.spec.js.map +1 -1
  105. package/dist/astUtils/reflection.d.ts +146 -82
  106. package/dist/astUtils/reflection.js +308 -132
  107. package/dist/astUtils/reflection.js.map +1 -1
  108. package/dist/astUtils/reflection.spec.js +267 -162
  109. package/dist/astUtils/reflection.spec.js.map +1 -1
  110. package/dist/astUtils/stackedVisitor.js.map +1 -1
  111. package/dist/astUtils/stackedVisitor.spec.js +14 -14
  112. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  113. package/dist/astUtils/visitors.d.ts +115 -53
  114. package/dist/astUtils/visitors.js +70 -13
  115. package/dist/astUtils/visitors.js.map +1 -1
  116. package/dist/astUtils/visitors.spec.js +465 -51
  117. package/dist/astUtils/visitors.spec.js.map +1 -1
  118. package/dist/astUtils/xml.d.ts +9 -8
  119. package/dist/astUtils/xml.js +10 -5
  120. package/dist/astUtils/xml.js.map +1 -1
  121. package/dist/bscPlugin/BscPlugin.d.ts +22 -1
  122. package/dist/bscPlugin/BscPlugin.js +88 -0
  123. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  124. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  125. package/dist/bscPlugin/CallExpressionInfo.js +131 -0
  126. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  127. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  128. package/dist/bscPlugin/FileWriter.js +24 -0
  129. package/dist/bscPlugin/FileWriter.js.map +1 -0
  130. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  131. package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
  132. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  133. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
  134. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +26 -17
  135. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  136. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +94 -20
  137. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  138. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +60 -0
  139. package/dist/bscPlugin/completions/CompletionsProcessor.js +601 -0
  140. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
  141. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2139 -0
  142. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  143. package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
  144. package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
  145. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  146. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
  147. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  148. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  149. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  150. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  151. package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
  152. package/dist/bscPlugin/hover/HoverProcessor.js +218 -0
  153. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
  154. package/dist/bscPlugin/hover/HoverProcessor.spec.d.ts +1 -0
  155. package/dist/bscPlugin/hover/HoverProcessor.spec.js +737 -0
  156. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
  157. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  158. package/dist/bscPlugin/references/ReferencesProvider.js +56 -0
  159. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  160. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  161. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  162. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  163. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
  164. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +144 -0
  165. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
  166. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
  167. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +504 -0
  168. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
  169. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  170. package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
  171. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  172. package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
  173. package/dist/bscPlugin/serialize/BslibManager.js +40 -0
  174. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  175. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  176. package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
  177. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  178. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
  179. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
  180. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
  181. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
  182. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
  183. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
  184. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
  185. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
  186. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
  187. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
  188. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
  189. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
  190. package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
  191. package/dist/bscPlugin/symbols/symbolUtils.js +140 -0
  192. package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
  193. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +21 -0
  194. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +199 -0
  195. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  196. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  197. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
  198. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  199. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  200. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  201. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  202. package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
  203. package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
  204. package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
  205. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +34 -0
  206. package/dist/bscPlugin/validation/BrsFileValidator.js +462 -0
  207. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
  208. package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
  209. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +758 -0
  210. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
  211. package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
  212. package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
  213. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  214. package/dist/bscPlugin/validation/ScopeValidator.d.ts +123 -0
  215. package/dist/bscPlugin/validation/ScopeValidator.js +1026 -0
  216. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
  217. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  218. package/dist/bscPlugin/validation/ScopeValidator.spec.js +2897 -0
  219. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  220. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  221. package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
  222. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  223. package/dist/cli.js +117 -11
  224. package/dist/cli.js.map +1 -1
  225. package/dist/deferred.d.ts +3 -3
  226. package/dist/deferred.js.map +1 -1
  227. package/dist/diagnosticUtils.d.ts +10 -3
  228. package/dist/diagnosticUtils.js +58 -21
  229. package/dist/diagnosticUtils.js.map +1 -1
  230. package/dist/examples/plugins/removePrint.js +8 -12
  231. package/dist/examples/plugins/removePrint.js.map +1 -1
  232. package/dist/files/AssetFile.d.ts +24 -0
  233. package/dist/files/AssetFile.js +25 -0
  234. package/dist/files/AssetFile.js.map +1 -0
  235. package/dist/files/BrsFile.Class.spec.js +858 -153
  236. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  237. package/dist/files/BrsFile.d.ts +147 -82
  238. package/dist/files/BrsFile.js +853 -911
  239. package/dist/files/BrsFile.js.map +1 -1
  240. package/dist/files/BrsFile.spec.js +3056 -836
  241. package/dist/files/BrsFile.spec.js.map +1 -1
  242. package/dist/files/BscFile.d.ts +101 -0
  243. package/dist/files/BscFile.js +15 -0
  244. package/dist/files/BscFile.js.map +1 -0
  245. package/dist/files/Factory.d.ts +25 -0
  246. package/dist/files/Factory.js +22 -0
  247. package/dist/files/Factory.js.map +1 -0
  248. package/dist/files/LazyFileData.d.ts +20 -0
  249. package/dist/files/LazyFileData.js +54 -0
  250. package/dist/files/LazyFileData.js.map +1 -0
  251. package/dist/files/LazyFileData.spec.d.ts +1 -0
  252. package/dist/files/LazyFileData.spec.js +27 -0
  253. package/dist/files/LazyFileData.spec.js.map +1 -0
  254. package/dist/files/XmlFile.d.ts +73 -41
  255. package/dist/files/XmlFile.js +126 -138
  256. package/dist/files/XmlFile.js.map +1 -1
  257. package/dist/files/XmlFile.spec.js +450 -318
  258. package/dist/files/XmlFile.spec.js.map +1 -1
  259. package/dist/files/tests/imports.spec.js +62 -52
  260. package/dist/files/tests/imports.spec.js.map +1 -1
  261. package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
  262. package/dist/files/tests/optionalChaning.spec.js +152 -0
  263. package/dist/files/tests/optionalChaning.spec.js.map +1 -0
  264. package/dist/globalCallables.d.ts +3 -1
  265. package/dist/globalCallables.js +416 -162
  266. package/dist/globalCallables.js.map +1 -1
  267. package/dist/index.d.ts +25 -3
  268. package/dist/index.js +42 -5
  269. package/dist/index.js.map +1 -1
  270. package/dist/interfaces.d.ts +717 -119
  271. package/dist/interfaces.js +21 -0
  272. package/dist/interfaces.js.map +1 -1
  273. package/dist/lexer/Character.spec.js +5 -5
  274. package/dist/lexer/Character.spec.js.map +1 -1
  275. package/dist/lexer/Lexer.d.ts +40 -9
  276. package/dist/lexer/Lexer.js +191 -49
  277. package/dist/lexer/Lexer.js.map +1 -1
  278. package/dist/lexer/Lexer.spec.js +775 -563
  279. package/dist/lexer/Lexer.spec.js.map +1 -1
  280. package/dist/lexer/Token.d.ts +11 -3
  281. package/dist/lexer/Token.js +10 -2
  282. package/dist/lexer/Token.js.map +1 -1
  283. package/dist/lexer/TokenKind.d.ts +27 -1
  284. package/dist/lexer/TokenKind.js +112 -5
  285. package/dist/lexer/TokenKind.js.map +1 -1
  286. package/dist/logging.d.ts +9 -0
  287. package/dist/logging.js +16 -0
  288. package/dist/logging.js.map +1 -0
  289. package/dist/parser/AstNode.d.ts +181 -0
  290. package/dist/parser/AstNode.js +246 -0
  291. package/dist/parser/AstNode.js.map +1 -0
  292. package/dist/parser/AstNode.spec.d.ts +1 -0
  293. package/dist/parser/AstNode.spec.js +165 -0
  294. package/dist/parser/AstNode.spec.js.map +1 -0
  295. package/dist/parser/BrsTranspileState.d.ts +12 -2
  296. package/dist/parser/BrsTranspileState.js +6 -0
  297. package/dist/parser/BrsTranspileState.js.map +1 -1
  298. package/dist/parser/Expression.d.ts +454 -210
  299. package/dist/parser/Expression.js +953 -498
  300. package/dist/parser/Expression.js.map +1 -1
  301. package/dist/parser/Parser.Class.spec.js +200 -95
  302. package/dist/parser/Parser.Class.spec.js.map +1 -1
  303. package/dist/parser/Parser.d.ts +106 -120
  304. package/dist/parser/Parser.js +1432 -931
  305. package/dist/parser/Parser.js.map +1 -1
  306. package/dist/parser/Parser.spec.d.ts +3 -1
  307. package/dist/parser/Parser.spec.js +1383 -456
  308. package/dist/parser/Parser.spec.js.map +1 -1
  309. package/dist/parser/SGParser.d.ts +44 -6
  310. package/dist/parser/SGParser.js +212 -185
  311. package/dist/parser/SGParser.js.map +1 -1
  312. package/dist/parser/SGParser.spec.js +30 -28
  313. package/dist/parser/SGParser.spec.js.map +1 -1
  314. package/dist/parser/SGTypes.d.ts +293 -50
  315. package/dist/parser/SGTypes.js +540 -187
  316. package/dist/parser/SGTypes.js.map +1 -1
  317. package/dist/parser/Statement.d.ts +759 -247
  318. package/dist/parser/Statement.js +1785 -607
  319. package/dist/parser/Statement.js.map +1 -1
  320. package/dist/parser/Statement.spec.js +45 -34
  321. package/dist/parser/Statement.spec.js.map +1 -1
  322. package/dist/parser/TranspileState.d.ts +18 -8
  323. package/dist/parser/TranspileState.js +76 -12
  324. package/dist/parser/TranspileState.js.map +1 -1
  325. package/dist/parser/tests/Parser.spec.d.ts +10 -9
  326. package/dist/parser/tests/Parser.spec.js +18 -14
  327. package/dist/parser/tests/Parser.spec.js.map +1 -1
  328. package/dist/parser/tests/controlFlow/For.spec.js +79 -69
  329. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  330. package/dist/parser/tests/controlFlow/ForEach.spec.js +53 -47
  331. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  332. package/dist/parser/tests/controlFlow/If.spec.js +217 -196
  333. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  334. package/dist/parser/tests/controlFlow/While.spec.js +48 -42
  335. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  336. package/dist/parser/tests/expression/Additive.spec.js +31 -31
  337. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  338. package/dist/parser/tests/expression/ArrayLiterals.spec.js +157 -120
  339. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  340. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +202 -139
  341. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  342. package/dist/parser/tests/expression/Boolean.spec.js +25 -25
  343. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  344. package/dist/parser/tests/expression/Call.spec.js +150 -41
  345. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  346. package/dist/parser/tests/expression/Exponential.spec.js +18 -18
  347. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  348. package/dist/parser/tests/expression/Function.spec.js +257 -257
  349. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  350. package/dist/parser/tests/expression/Indexing.spec.js +160 -90
  351. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  352. package/dist/parser/tests/expression/Multiplicative.spec.js +38 -38
  353. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  354. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +196 -98
  355. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  356. package/dist/parser/tests/expression/PrefixUnary.spec.js +42 -42
  357. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  358. package/dist/parser/tests/expression/Primary.spec.js +42 -42
  359. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  360. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  361. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
  362. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  363. package/dist/parser/tests/expression/Relational.spec.js +44 -44
  364. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  365. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
  366. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  367. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +230 -90
  368. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  369. package/dist/parser/tests/expression/TernaryExpression.spec.js +377 -148
  370. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  371. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  372. package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
  373. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  374. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  375. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  376. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  377. package/dist/parser/tests/statement/AssignmentOperators.spec.js +37 -37
  378. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  379. package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
  380. package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
  381. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
  382. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  383. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  384. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  385. package/dist/parser/tests/statement/Declaration.spec.js +45 -45
  386. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  387. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  388. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  389. package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
  390. package/dist/parser/tests/statement/Enum.spec.js +745 -0
  391. package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
  392. package/dist/parser/tests/statement/For.spec.d.ts +1 -0
  393. package/dist/parser/tests/statement/For.spec.js +45 -0
  394. package/dist/parser/tests/statement/For.spec.js.map +1 -0
  395. package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
  396. package/dist/parser/tests/statement/ForEach.spec.js +36 -0
  397. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
  398. package/dist/parser/tests/statement/Function.spec.js +208 -198
  399. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  400. package/dist/parser/tests/statement/Goto.spec.js +16 -15
  401. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  402. package/dist/parser/tests/statement/Increment.spec.js +51 -51
  403. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  404. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  405. package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
  406. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  407. package/dist/parser/tests/statement/LibraryStatement.spec.js +18 -18
  408. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  409. package/dist/parser/tests/statement/Misc.spec.js +123 -163
  410. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  411. package/dist/parser/tests/statement/PrintStatement.spec.js +125 -108
  412. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  413. package/dist/parser/tests/statement/ReturnStatement.spec.js +51 -49
  414. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  415. package/dist/parser/tests/statement/Set.spec.js +110 -97
  416. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  417. package/dist/parser/tests/statement/Stop.spec.js +13 -12
  418. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  419. package/dist/parser/tests/statement/Throw.spec.js +6 -6
  420. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  421. package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
  422. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  423. package/dist/preprocessor/Manifest.d.ts +6 -6
  424. package/dist/preprocessor/Manifest.js +17 -38
  425. package/dist/preprocessor/Manifest.js.map +1 -1
  426. package/dist/preprocessor/Manifest.spec.d.ts +1 -0
  427. package/dist/preprocessor/Manifest.spec.js +78 -103
  428. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  429. package/dist/roku-types/data.json +19369 -0
  430. package/dist/roku-types/index.d.ts +5497 -0
  431. package/dist/roku-types/index.js +11 -0
  432. package/dist/roku-types/index.js.map +1 -0
  433. package/dist/types/ArrayType.d.ts +9 -5
  434. package/dist/types/ArrayType.js +68 -24
  435. package/dist/types/ArrayType.js.map +1 -1
  436. package/dist/types/ArrayType.spec.js +39 -11
  437. package/dist/types/ArrayType.spec.js.map +1 -1
  438. package/dist/types/AssociativeArrayType.d.ts +14 -0
  439. package/dist/types/AssociativeArrayType.js +60 -0
  440. package/dist/types/AssociativeArrayType.js.map +1 -0
  441. package/dist/types/BaseFunctionType.d.ts +9 -0
  442. package/dist/types/BaseFunctionType.js +25 -0
  443. package/dist/types/BaseFunctionType.js.map +1 -0
  444. package/dist/types/BooleanType.d.ts +10 -5
  445. package/dist/types/BooleanType.js +21 -9
  446. package/dist/types/BooleanType.js.map +1 -1
  447. package/dist/types/BooleanType.spec.js +10 -4
  448. package/dist/types/BooleanType.spec.js.map +1 -1
  449. package/dist/types/BscType.d.ts +29 -3
  450. package/dist/types/BscType.js +121 -0
  451. package/dist/types/BscType.js.map +1 -1
  452. package/dist/types/BscTypeKind.d.ts +25 -0
  453. package/dist/types/BscTypeKind.js +30 -0
  454. package/dist/types/BscTypeKind.js.map +1 -0
  455. package/dist/types/BuiltInInterfaceAdder.d.ts +25 -0
  456. package/dist/types/BuiltInInterfaceAdder.js +201 -0
  457. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  458. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  459. package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
  460. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  461. package/dist/types/ClassType.d.ts +16 -0
  462. package/dist/types/ClassType.js +57 -0
  463. package/dist/types/ClassType.js.map +1 -0
  464. package/dist/types/ClassType.spec.d.ts +1 -0
  465. package/dist/types/ClassType.spec.js +76 -0
  466. package/dist/types/ClassType.spec.js.map +1 -0
  467. package/dist/types/ComponentType.d.ts +27 -0
  468. package/dist/types/ComponentType.js +83 -0
  469. package/dist/types/ComponentType.js.map +1 -0
  470. package/dist/types/DoubleType.d.ts +10 -5
  471. package/dist/types/DoubleType.js +25 -18
  472. package/dist/types/DoubleType.js.map +1 -1
  473. package/dist/types/DoubleType.spec.js +12 -4
  474. package/dist/types/DoubleType.spec.js.map +1 -1
  475. package/dist/types/DynamicType.d.ts +12 -5
  476. package/dist/types/DynamicType.js +22 -6
  477. package/dist/types/DynamicType.js.map +1 -1
  478. package/dist/types/DynamicType.spec.js +16 -5
  479. package/dist/types/DynamicType.spec.js.map +1 -1
  480. package/dist/types/EnumType.d.ts +40 -0
  481. package/dist/types/EnumType.js +80 -0
  482. package/dist/types/EnumType.js.map +1 -0
  483. package/dist/types/EnumType.spec.d.ts +1 -0
  484. package/dist/types/EnumType.spec.js +33 -0
  485. package/dist/types/EnumType.spec.js.map +1 -0
  486. package/dist/types/FloatType.d.ts +10 -5
  487. package/dist/types/FloatType.js +25 -18
  488. package/dist/types/FloatType.js.map +1 -1
  489. package/dist/types/FloatType.spec.js +4 -4
  490. package/dist/types/FloatType.spec.js.map +1 -1
  491. package/dist/types/FunctionType.d.ts +10 -22
  492. package/dist/types/FunctionType.js +26 -63
  493. package/dist/types/FunctionType.js.map +1 -1
  494. package/dist/types/InheritableType.d.ts +28 -0
  495. package/dist/types/InheritableType.js +157 -0
  496. package/dist/types/InheritableType.js.map +1 -0
  497. package/dist/types/IntegerType.d.ts +10 -5
  498. package/dist/types/IntegerType.js +25 -18
  499. package/dist/types/IntegerType.js.map +1 -1
  500. package/dist/types/IntegerType.spec.js +8 -4
  501. package/dist/types/IntegerType.spec.js.map +1 -1
  502. package/dist/types/InterfaceType.d.ts +14 -6
  503. package/dist/types/InterfaceType.js +26 -15
  504. package/dist/types/InterfaceType.js.map +1 -1
  505. package/dist/types/InterfaceType.spec.d.ts +1 -0
  506. package/dist/types/InterfaceType.spec.js +227 -0
  507. package/dist/types/InterfaceType.spec.js.map +1 -0
  508. package/dist/types/InvalidType.d.ts +9 -5
  509. package/dist/types/InvalidType.js +20 -9
  510. package/dist/types/InvalidType.js.map +1 -1
  511. package/dist/types/InvalidType.spec.js +8 -4
  512. package/dist/types/InvalidType.spec.js.map +1 -1
  513. package/dist/types/LongIntegerType.d.ts +10 -5
  514. package/dist/types/LongIntegerType.js +25 -18
  515. package/dist/types/LongIntegerType.js.map +1 -1
  516. package/dist/types/LongIntegerType.spec.js +10 -4
  517. package/dist/types/LongIntegerType.spec.js.map +1 -1
  518. package/dist/types/NamespaceType.d.ts +12 -0
  519. package/dist/types/NamespaceType.js +28 -0
  520. package/dist/types/NamespaceType.js.map +1 -0
  521. package/dist/types/ObjectType.d.ts +10 -5
  522. package/dist/types/ObjectType.js +23 -9
  523. package/dist/types/ObjectType.js.map +1 -1
  524. package/dist/types/ObjectType.spec.js +3 -3
  525. package/dist/types/ObjectType.spec.js.map +1 -1
  526. package/dist/types/ReferenceType.d.ts +79 -0
  527. package/dist/types/ReferenceType.js +522 -0
  528. package/dist/types/ReferenceType.js.map +1 -0
  529. package/dist/types/ReferenceType.spec.d.ts +1 -0
  530. package/dist/types/ReferenceType.spec.js +151 -0
  531. package/dist/types/ReferenceType.spec.js.map +1 -0
  532. package/dist/types/StringType.d.ts +13 -5
  533. package/dist/types/StringType.js +25 -9
  534. package/dist/types/StringType.js.map +1 -1
  535. package/dist/types/StringType.spec.js +3 -3
  536. package/dist/types/StringType.spec.js.map +1 -1
  537. package/dist/types/TypedFunctionType.d.ts +33 -0
  538. package/dist/types/TypedFunctionType.js +106 -0
  539. package/dist/types/TypedFunctionType.js.map +1 -0
  540. package/dist/types/TypedFunctionType.spec.d.ts +1 -0
  541. package/dist/types/TypedFunctionType.spec.js +122 -0
  542. package/dist/types/TypedFunctionType.spec.js.map +1 -0
  543. package/dist/types/UninitializedType.d.ts +8 -6
  544. package/dist/types/UninitializedType.js +15 -9
  545. package/dist/types/UninitializedType.js.map +1 -1
  546. package/dist/types/UnionType.d.ts +20 -0
  547. package/dist/types/UnionType.js +127 -0
  548. package/dist/types/UnionType.js.map +1 -0
  549. package/dist/types/UnionType.spec.d.ts +1 -0
  550. package/dist/types/UnionType.spec.js +129 -0
  551. package/dist/types/UnionType.spec.js.map +1 -0
  552. package/dist/types/VoidType.d.ts +10 -5
  553. package/dist/types/VoidType.js +20 -9
  554. package/dist/types/VoidType.js.map +1 -1
  555. package/dist/types/VoidType.spec.js +3 -3
  556. package/dist/types/VoidType.spec.js.map +1 -1
  557. package/dist/types/helper.spec.d.ts +1 -0
  558. package/dist/types/helper.spec.js +144 -0
  559. package/dist/types/helper.spec.js.map +1 -0
  560. package/dist/types/helpers.d.ts +26 -0
  561. package/dist/types/helpers.js +191 -0
  562. package/dist/types/helpers.js.map +1 -0
  563. package/dist/types/index.d.ts +22 -0
  564. package/dist/types/index.js +39 -0
  565. package/dist/types/index.js.map +1 -0
  566. package/dist/util.d.ts +218 -106
  567. package/dist/util.js +1310 -320
  568. package/dist/util.js.map +1 -1
  569. package/dist/validators/ClassValidator.d.ts +9 -15
  570. package/dist/validators/ClassValidator.js +81 -134
  571. package/dist/validators/ClassValidator.js.map +1 -1
  572. package/package.json +169 -138
  573. package/dist/astUtils/index.d.ts +0 -7
  574. package/dist/astUtils/index.js +0 -26
  575. package/dist/astUtils/index.js.map +0 -1
  576. package/dist/lexer/index.d.ts +0 -3
  577. package/dist/lexer/index.js +0 -17
  578. package/dist/lexer/index.js.map +0 -1
  579. package/dist/parser/index.d.ts +0 -3
  580. package/dist/parser/index.js +0 -16
  581. package/dist/parser/index.js.map +0 -1
  582. package/dist/preprocessor/Chunk.d.ts +0 -82
  583. package/dist/preprocessor/Chunk.js +0 -77
  584. package/dist/preprocessor/Chunk.js.map +0 -1
  585. package/dist/preprocessor/Preprocessor.d.ts +0 -60
  586. package/dist/preprocessor/Preprocessor.js +0 -156
  587. package/dist/preprocessor/Preprocessor.js.map +0 -1
  588. package/dist/preprocessor/Preprocessor.spec.js +0 -152
  589. package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
  590. package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
  591. package/dist/preprocessor/PreprocessorParser.js +0 -194
  592. package/dist/preprocessor/PreprocessorParser.js.map +0 -1
  593. package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
  594. package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
  595. package/dist/preprocessor/index.d.ts +0 -3
  596. package/dist/preprocessor/index.js +0 -16
  597. package/dist/preprocessor/index.js.map +0 -1
  598. package/dist/types/CustomType.d.ts +0 -10
  599. package/dist/types/CustomType.js +0 -35
  600. package/dist/types/CustomType.js.map +0 -1
  601. package/dist/types/FunctionType.spec.js +0 -29
  602. package/dist/types/FunctionType.spec.js.map +0 -1
  603. package/dist/types/LazyType.d.ts +0 -15
  604. package/dist/types/LazyType.js +0 -32
  605. package/dist/types/LazyType.js.map +0 -1
  606. /package/dist/{preprocessor/Preprocessor.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
  607. /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
  608. /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
package/README.md CHANGED
@@ -1,18 +1,22 @@
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
 
14
18
  ## 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.
19
+ 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
20
 
17
21
  [BrighterScript Language Specification](https://github.com/rokucommunity/BrighterScript/blob/master/docs/readme.md)
18
22
 
@@ -59,12 +63,39 @@ BrighterScript adds several new features to the BrightScript language such as Na
59
63
  - 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
64
 
61
65
  ## 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!
66
+ <br/>
67
+ <p align="center">
68
+ <a href="https://www.fubo.tv/">
69
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192530108-eb470b85-e687-4575-af69-254aab13428c.png">
70
+ </a>&nbsp;&nbsp;&nbsp;
71
+ <a href="mailto:chris@inverted-solutions.com">
72
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197794500-2bac4903-ed00-463a-b243-24c68fba7962.png">
73
+ </a>&nbsp;&nbsp;&nbsp;
74
+ <a href="https://www.applicaster.com/">
75
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192591901-20441fc8-3c6c-45ea-8851-b22430e6fb8e.png">
76
+ </a>&nbsp;&nbsp;&nbsp;
77
+ <a href="https://www.redspace.com/">
78
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/195908446-8d9652f8-9877-426f-b3c6-09119d788fd8.png">
79
+ </a>&nbsp;&nbsp;&nbsp;
80
+ <br/><br/>
81
+ <a href="https://tantawowa.com/">
82
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197795138-2ec870db-71fe-49e3-a014-692a3f31e6aa.png">
83
+ </a>&nbsp;&nbsp;&nbsp;
84
+ <a href="https://www.miraclechannel.ca/corcoplus">
85
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192593254-f2a32cd4-0482-40de-830d-c1d09690c46b.png">
86
+ </a>&nbsp;&nbsp;&nbsp;
87
+ <a href="https://channelstore.roku.com/details/222212/phototv">
88
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/169118062-81d94da5-2323-4e31-b19d-7db3f9c88dff.png">
89
+ </a>&nbsp;&nbsp;&nbsp;
90
+ <a href="https://www.haystack.tv/">
91
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192610056-d1b5a382-edf4-47b9-a6a5-d2d3ee9094cb.png">
92
+ </a>&nbsp;&nbsp;&nbsp;
93
+ </p>
94
+ <br/>
95
+
96
+ 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.
97
+
98
+ [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
99
 
69
100
  ## What's with the name?
70
101
  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 +164,27 @@ If you need to configure `bsc`, you can do so in two ways:
133
164
  ## bsconfig.json
134
165
 
135
166
  ### 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
167
+ 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:
168
+
169
+ ```jsonc
170
+ {
171
+ "rootDir": "src",
172
+ "files": [
173
+ "**/*"
174
+ ],
175
+ "stagingFolderPath": "dist",
176
+ "retainStagingFolder": true,
177
+ //this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
178
+ "autoImportComponentScript": true,
179
+ "sourceMap": true
180
+ }
254
181
  ```
255
182
 
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.
183
+ 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).
184
+
185
+ ## Suppressing compiler messages
257
186
 
187
+ 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
188
 
259
189
  ## ropm support
260
190
  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,21 @@
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": ["boolean", "null"]
34
+ }
35
+ }
36
+ }
37
+ }
38
+ },
24
39
  "files": {
25
40
  "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
41
  "default": [
@@ -105,13 +120,24 @@
105
120
  "description": " The password to use when deploying to a Roku device",
106
121
  "type": "string"
107
122
  },
123
+ "retainStagingDir": {
124
+ "type": "boolean",
125
+ "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.",
126
+ "default": false
127
+ },
108
128
  "retainStagingFolder": {
109
129
  "type": "boolean",
130
+ "deprecated": true,
110
131
  "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
132
  "default": false
112
133
  },
134
+ "stagingDir": {
135
+ "type": "string",
136
+ "description": "The path to the staging folder (where all files are copied before creating the zip package)"
137
+ },
113
138
  "stagingFolderPath": {
114
139
  "type": "string",
140
+ "deprecated": true,
115
141
  "description": "The path to the staging folder (where all files are copied before creating the zip package)"
116
142
  },
117
143
  "ignoreErrorCodes": {
@@ -128,6 +154,16 @@
128
154
  ]
129
155
  }
130
156
  },
157
+ "diagnosticSeverityOverrides": {
158
+ "description": "A map of error codes with their severity level override (error|warn|info)",
159
+ "type": "object",
160
+ "patternProperties": {
161
+ ".{1,}": {
162
+ "type": ["number", "string"],
163
+ "enum": ["error", "warn", "info", "hint"]
164
+ }
165
+ }
166
+ },
131
167
  "emitFullPaths": {
132
168
  "description": "Emit full paths to files when printing diagnostics to the console.",
133
169
  "type": "boolean",
@@ -138,6 +174,11 @@
138
174
  "type": "boolean",
139
175
  "default": false
140
176
  },
177
+ "removeParameterTypes": {
178
+ "description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
179
+ "type": "boolean",
180
+ "default": false
181
+ },
141
182
  "diagnosticFilters": {
142
183
  "description": "A collection of filters used to hide diagnostics for certain files",
143
184
  "type": "array",
@@ -165,7 +206,10 @@
165
206
  "items": {
166
207
  "anyOf": [
167
208
  {
168
- "type": ["number", "string"],
209
+ "type": [
210
+ "number",
211
+ "string"
212
+ ],
169
213
  "description": "A code of diagnostics that should be filtered out from the files matched in 'src'"
170
214
  }
171
215
  ]
@@ -188,6 +232,18 @@
188
232
  ]
189
233
  }
190
234
  },
235
+ "require": {
236
+ "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",
237
+ "type": "array",
238
+ "items": {
239
+ "anyOf": [
240
+ {
241
+ "type": "string",
242
+ "description": "a path to a node script or an npm module to load dynamically at startup."
243
+ }
244
+ ]
245
+ }
246
+ },
191
247
  "autoImportComponentScript": {
192
248
  "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
249
  "type": "boolean",
@@ -220,6 +276,16 @@
220
276
  "warn",
221
277
  "error"
222
278
  ]
279
+ },
280
+ "allowBrighterScriptInBrightScript": {
281
+ "description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
282
+ "type": "boolean",
283
+ "default": false
284
+ },
285
+ "legacyCallfuncHandling": {
286
+ "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.",
287
+ "type": "boolean",
288
+ "default": false
223
289
  }
224
290
  }
225
- }
291
+ }
@@ -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
+ }