brighterscript 1.0.0-alpha.27 → 1.0.0-alpha.29

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 (168) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +1 -1
  3. package/dist/AstValidationSegmenter.d.ts +12 -2
  4. package/dist/AstValidationSegmenter.js +74 -16
  5. package/dist/AstValidationSegmenter.js.map +1 -1
  6. package/dist/DependencyGraph.d.ts +4 -0
  7. package/dist/DependencyGraph.js +19 -0
  8. package/dist/DependencyGraph.js.map +1 -1
  9. package/dist/DiagnosticFilterer.d.ts +7 -4
  10. package/dist/DiagnosticFilterer.js +67 -37
  11. package/dist/DiagnosticFilterer.js.map +1 -1
  12. package/dist/DiagnosticMessages.d.ts +1 -1
  13. package/dist/PluginInterface.js +1 -1
  14. package/dist/PluginInterface.js.map +1 -1
  15. package/dist/Program.d.ts +19 -15
  16. package/dist/Program.js +153 -88
  17. package/dist/Program.js.map +1 -1
  18. package/dist/Scope.d.ts +27 -28
  19. package/dist/Scope.js +174 -361
  20. package/dist/Scope.js.map +1 -1
  21. package/dist/Stopwatch.d.ts +4 -0
  22. package/dist/Stopwatch.js +7 -0
  23. package/dist/Stopwatch.js.map +1 -1
  24. package/dist/SymbolTable.d.ts +2 -1
  25. package/dist/SymbolTable.js +26 -0
  26. package/dist/SymbolTable.js.map +1 -1
  27. package/dist/{SymbolTableFlag.js → SymbolTypeFlag.js} +1 -1
  28. package/dist/SymbolTypeFlag.js.map +1 -0
  29. package/dist/XmlScope.d.ts +0 -8
  30. package/dist/XmlScope.js +0 -77
  31. package/dist/XmlScope.js.map +1 -1
  32. package/dist/astUtils/CachedLookups.js +4 -8
  33. package/dist/astUtils/CachedLookups.js.map +1 -1
  34. package/dist/astUtils/creators.d.ts +1 -0
  35. package/dist/astUtils/creators.js +3 -2
  36. package/dist/astUtils/creators.js.map +1 -1
  37. package/dist/astUtils/creators.spec.js +0 -10
  38. package/dist/astUtils/creators.spec.js.map +1 -1
  39. package/dist/astUtils/reflection.d.ts +4 -4
  40. package/dist/astUtils/reflection.js +8 -7
  41. package/dist/astUtils/reflection.js.map +1 -1
  42. package/dist/astUtils/reflection.spec.js +10 -15
  43. package/dist/astUtils/reflection.spec.js.map +1 -1
  44. package/dist/astUtils/visitors.d.ts +1 -2
  45. package/dist/astUtils/visitors.js.map +1 -1
  46. package/dist/astUtils/visitors.spec.js +1 -5
  47. package/dist/astUtils/visitors.spec.js.map +1 -1
  48. package/dist/bscPlugin/BscPlugin.d.ts +3 -1
  49. package/dist/bscPlugin/BscPlugin.js +10 -0
  50. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  51. package/dist/bscPlugin/SignatureHelpUtil.js +4 -3
  52. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -1
  53. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +1 -0
  54. package/dist/bscPlugin/completions/CompletionsProcessor.js +31 -11
  55. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
  56. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +39 -0
  57. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -1
  58. package/dist/bscPlugin/hover/HoverProcessor.js +5 -5
  59. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
  60. package/dist/bscPlugin/hover/HoverProcessor.spec.js +51 -5
  61. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
  62. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  63. package/dist/bscPlugin/references/ReferencesProvider.js +56 -0
  64. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  65. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  66. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  67. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  68. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +1 -1
  69. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -1
  70. package/dist/bscPlugin/validation/BrsFileAfterValidatior.d.ts +7 -0
  71. package/dist/bscPlugin/validation/BrsFileAfterValidatior.js +18 -0
  72. package/dist/bscPlugin/validation/BrsFileAfterValidatior.js.map +1 -0
  73. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +1 -0
  74. package/dist/bscPlugin/validation/BrsFileValidator.js +17 -10
  75. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  76. package/dist/bscPlugin/validation/ScopeValidator.d.ts +37 -1
  77. package/dist/bscPlugin/validation/ScopeValidator.js +434 -25
  78. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  79. package/dist/bscPlugin/validation/ScopeValidator.spec.js +91 -4
  80. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
  81. package/dist/files/BrsFile.Class.spec.js +11 -4
  82. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  83. package/dist/files/BrsFile.d.ts +23 -5
  84. package/dist/files/BrsFile.js +189 -51
  85. package/dist/files/BrsFile.js.map +1 -1
  86. package/dist/files/BrsFile.spec.js +589 -97
  87. package/dist/files/BrsFile.spec.js.map +1 -1
  88. package/dist/files/BscFile.d.ts +2 -1
  89. package/dist/files/BscFile.js.map +1 -1
  90. package/dist/files/XmlFile.d.ts +2 -2
  91. package/dist/files/XmlFile.js +2 -2
  92. package/dist/files/XmlFile.js.map +1 -1
  93. package/dist/index.d.ts +1 -0
  94. package/dist/index.js +1 -0
  95. package/dist/index.js.map +1 -1
  96. package/dist/interfaces.d.ts +43 -4
  97. package/dist/interfaces.js.map +1 -1
  98. package/dist/lexer/Lexer.d.ts +9 -3
  99. package/dist/lexer/Lexer.js +36 -15
  100. package/dist/lexer/Lexer.js.map +1 -1
  101. package/dist/lexer/Lexer.spec.js +76 -38
  102. package/dist/lexer/Lexer.spec.js.map +1 -1
  103. package/dist/lexer/Token.js +1 -1
  104. package/dist/lexer/Token.js.map +1 -1
  105. package/dist/lexer/TokenKind.d.ts +1 -0
  106. package/dist/lexer/TokenKind.js +4 -1
  107. package/dist/lexer/TokenKind.js.map +1 -1
  108. package/dist/parser/AstNode.d.ts +1 -2
  109. package/dist/parser/AstNode.js +0 -1
  110. package/dist/parser/AstNode.js.map +1 -1
  111. package/dist/parser/BrsTranspileState.d.ts +1 -1
  112. package/dist/parser/Expression.d.ts +77 -47
  113. package/dist/parser/Expression.js +162 -88
  114. package/dist/parser/Expression.js.map +1 -1
  115. package/dist/parser/Parser.d.ts +7 -2
  116. package/dist/parser/Parser.js +40 -90
  117. package/dist/parser/Parser.js.map +1 -1
  118. package/dist/parser/Parser.spec.js +21 -44
  119. package/dist/parser/Parser.spec.js.map +1 -1
  120. package/dist/parser/SGTypes.js +5 -5
  121. package/dist/parser/SGTypes.js.map +1 -1
  122. package/dist/parser/Statement.d.ts +92 -84
  123. package/dist/parser/Statement.js +199 -133
  124. package/dist/parser/Statement.js.map +1 -1
  125. package/dist/parser/Statement.spec.js +0 -13
  126. package/dist/parser/Statement.spec.js.map +1 -1
  127. package/dist/parser/TranspileState.d.ts +17 -8
  128. package/dist/parser/TranspileState.js +67 -8
  129. package/dist/parser/TranspileState.js.map +1 -1
  130. package/dist/parser/tests/Parser.spec.d.ts +1 -1
  131. package/dist/parser/tests/Parser.spec.js +1 -2
  132. package/dist/parser/tests/Parser.spec.js.map +1 -1
  133. package/dist/parser/tests/controlFlow/If.spec.js +1 -1
  134. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  135. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +1 -3
  136. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  137. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +44 -0
  138. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  139. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +6 -6
  140. package/dist/parser/tests/expression/TernaryExpression.spec.js +47 -0
  141. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  142. package/dist/parser/tests/statement/ConstStatement.spec.js +2 -2
  143. package/dist/parser/tests/statement/InterfaceStatement.spec.js +8 -1
  144. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
  145. package/dist/parser/tests/statement/Misc.spec.js +25 -5
  146. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  147. package/dist/preprocessor/Chunk.js +1 -2
  148. package/dist/preprocessor/Chunk.js.map +1 -1
  149. package/dist/preprocessor/PreprocessorParser.js +2 -1
  150. package/dist/preprocessor/PreprocessorParser.js.map +1 -1
  151. package/dist/types/AssociativeArrayType.d.ts +3 -0
  152. package/dist/types/AssociativeArrayType.js +9 -0
  153. package/dist/types/AssociativeArrayType.js.map +1 -1
  154. package/dist/types/BscType.d.ts +1 -1
  155. package/dist/types/BscType.js +1 -0
  156. package/dist/types/BscType.js.map +1 -1
  157. package/dist/types/ComponentType.d.ts +1 -1
  158. package/dist/types/ReferenceType.d.ts +9 -1
  159. package/dist/types/ReferenceType.js +45 -1
  160. package/dist/types/ReferenceType.js.map +1 -1
  161. package/dist/types/ReferenceType.spec.js +15 -0
  162. package/dist/types/ReferenceType.spec.js.map +1 -1
  163. package/dist/util.d.ts +23 -9
  164. package/dist/util.js +115 -21
  165. package/dist/util.js.map +1 -1
  166. package/package.json +6 -3
  167. package/dist/SymbolTableFlag.js.map +0 -1
  168. /package/dist/{SymbolTableFlag.d.ts → SymbolTypeFlag.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { Token, Identifier } from '../lexer/Token';
2
- import type { Block, CommentStatement, FunctionStatement } from './Statement';
2
+ import type { Block, FunctionStatement } from './Statement';
3
3
  import type { Range } from 'vscode-languageserver';
4
4
  import type { BrsTranspileState } from './BrsTranspileState';
5
5
  import { ParseMode } from './Parser';
@@ -8,11 +8,12 @@ import type { GetTypeOptions, TranspileResult, TypedefProvider } from '../interf
8
8
  import { VoidType } from '../types/VoidType';
9
9
  import { DynamicType } from '../types/DynamicType';
10
10
  import type { BscType } from '../types/BscType';
11
- import { TypedFunctionType } from '../types/TypedFunctionType';
12
11
  import { AstNodeKind, Expression } from './AstNode';
13
12
  import { SourceNode } from 'source-map';
14
13
  import type { TranspileState } from './TranspileState';
15
14
  import { StringType } from '../types/StringType';
15
+ import { TypedFunctionType } from '../types';
16
+ import { FunctionType } from '../types/FunctionType';
16
17
  export declare type ExpressionVisitor = (expression: Expression, parent: Expression) => void;
17
18
  export declare class BinaryExpression extends Expression {
18
19
  constructor(options: {
@@ -26,12 +27,19 @@ export declare class BinaryExpression extends Expression {
26
27
  readonly left: Expression;
27
28
  readonly right: Expression;
28
29
  readonly kind = AstNodeKind.BinaryExpression;
29
- readonly range: Range;
30
- transpile(state: BrsTranspileState): (string | SourceNode)[];
30
+ readonly range: Range | undefined;
31
+ transpile(state: BrsTranspileState): TranspileResult;
31
32
  walk(visitor: WalkVisitor, options: WalkOptions): void;
32
33
  getType(options: GetTypeOptions): BscType;
34
+ getLeadingTrivia(): Token[];
33
35
  }
34
36
  export declare class CallExpression extends Expression {
37
+ /**
38
+ * Number of parameters that can be defined on a function
39
+ *
40
+ * Prior to Roku OS 11.5, this was 32
41
+ * As of Roku OS 11.5, this is 63
42
+ */
35
43
  static MaximumArguments: number;
36
44
  constructor(options: {
37
45
  callee: Expression;
@@ -49,10 +57,11 @@ export declare class CallExpression extends Expression {
49
57
  readonly closingParen?: Token;
50
58
  };
51
59
  readonly kind = AstNodeKind.CallExpression;
52
- readonly range: Range;
53
- transpile(state: BrsTranspileState, nameOverride?: string): (string | SourceNode)[];
60
+ readonly range: Range | undefined;
61
+ transpile(state: BrsTranspileState, nameOverride?: string): TranspileResult;
54
62
  walk(visitor: WalkVisitor, options: WalkOptions): void;
55
63
  getType(options: GetTypeOptions): any;
64
+ getLeadingTrivia(): Token[];
56
65
  }
57
66
  export declare class FunctionExpression extends Expression implements TypedefProvider {
58
67
  constructor(options: {
@@ -86,7 +95,7 @@ export declare class FunctionExpression extends Expression implements TypedefPro
86
95
  * and ending with the last n' in 'end function' or 'b' in 'end sub'
87
96
  */
88
97
  get range(): Range;
89
- transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): any[];
98
+ transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): TranspileResult;
90
99
  getTypedef(state: BrsTranspileState): SourceNode[];
91
100
  walk(visitor: WalkVisitor, options: WalkOptions): void;
92
101
  getType(options: GetTypeOptions): TypedFunctionType;
@@ -108,10 +117,11 @@ export declare class FunctionParameterExpression extends Expression {
108
117
  readonly defaultValue?: Expression;
109
118
  readonly typeExpression?: TypeExpression;
110
119
  getType(options: GetTypeOptions): BscType;
111
- get range(): Range;
112
- transpile(state: BrsTranspileState): any[];
120
+ get range(): Range | undefined;
121
+ transpile(state: BrsTranspileState): TranspileResult;
113
122
  getTypedef(state: BrsTranspileState): TranspileResult;
114
123
  walk(visitor: WalkVisitor, options: WalkOptions): void;
124
+ getLeadingTrivia(): Token[];
115
125
  }
116
126
  export declare class DottedGetExpression extends Expression {
117
127
  constructor(options: {
@@ -128,11 +138,12 @@ export declare class DottedGetExpression extends Expression {
128
138
  };
129
139
  readonly obj: Expression;
130
140
  readonly kind = AstNodeKind.DottedGetExpression;
131
- readonly range: Range;
132
- transpile(state: BrsTranspileState): (string | SourceNode)[];
141
+ readonly range: Range | undefined;
142
+ transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
133
143
  walk(visitor: WalkVisitor, options: WalkOptions): void;
134
144
  getType(options: GetTypeOptions): BscType;
135
145
  getName(parseMode: ParseMode): string;
146
+ getLeadingTrivia(): Token[];
136
147
  }
137
148
  export declare class XmlAttributeGetExpression extends Expression {
138
149
  constructor(options: {
@@ -149,9 +160,10 @@ export declare class XmlAttributeGetExpression extends Expression {
149
160
  at?: Token;
150
161
  };
151
162
  readonly obj: Expression;
152
- readonly range: Range;
153
- transpile(state: BrsTranspileState): (string | SourceNode)[];
163
+ readonly range: Range | undefined;
164
+ transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
154
165
  walk(visitor: WalkVisitor, options: WalkOptions): void;
166
+ getLeadingTrivia(): Token[];
155
167
  }
156
168
  export declare class IndexedGetExpression extends Expression {
157
169
  constructor(options: {
@@ -175,10 +187,11 @@ export declare class IndexedGetExpression extends Expression {
175
187
  readonly closingSquare?: Token;
176
188
  readonly questionDot?: Token;
177
189
  };
178
- readonly range: Range;
190
+ readonly range: Range | undefined;
179
191
  transpile(state: BrsTranspileState): any[];
180
192
  walk(visitor: WalkVisitor, options: WalkOptions): void;
181
193
  getType(options: GetTypeOptions): BscType;
194
+ getLeadingTrivia(): Token[];
182
195
  }
183
196
  export declare class GroupingExpression extends Expression {
184
197
  constructor(options: {
@@ -192,10 +205,11 @@ export declare class GroupingExpression extends Expression {
192
205
  };
193
206
  readonly expression: Expression;
194
207
  readonly kind = AstNodeKind.GroupingExpression;
195
- readonly range: Range;
208
+ readonly range: Range | undefined;
196
209
  transpile(state: BrsTranspileState): TranspileResult;
197
210
  walk(visitor: WalkVisitor, options: WalkOptions): void;
198
211
  getType(options: GetTypeOptions): BscType;
212
+ getLeadingTrivia(): Token[];
199
213
  }
200
214
  export declare class LiteralExpression extends Expression {
201
215
  constructor(options: {
@@ -206,9 +220,10 @@ export declare class LiteralExpression extends Expression {
206
220
  };
207
221
  readonly kind = AstNodeKind.LiteralExpression;
208
222
  get range(): Range;
209
- getType(options?: GetTypeOptions): DynamicType | import("..").ObjectType | StringType | import("..").IntegerType | import("..").BooleanType | import("..").FloatType | import("..").DoubleType | import("..").LongIntegerType | VoidType | import("../types/FunctionType").FunctionType;
210
- transpile(state: BrsTranspileState): SourceNode[];
223
+ getType(options?: GetTypeOptions): DynamicType | import("../types").ObjectType | StringType | import("../types").IntegerType | import("../types").BooleanType | import("../types").FloatType | import("../types").DoubleType | import("../types").LongIntegerType | VoidType | FunctionType;
224
+ transpile(state: BrsTranspileState): TranspileResult[];
211
225
  walk(visitor: WalkVisitor, options: WalkOptions): void;
226
+ getLeadingTrivia(): Token[];
212
227
  }
213
228
  /**
214
229
  * This is a special expression only used within template strings. It exists so we can prevent producing lots of empty strings
@@ -232,20 +247,21 @@ export declare class EscapedCharCodeLiteralExpression extends Expression {
232
247
  }
233
248
  export declare class ArrayLiteralExpression extends Expression {
234
249
  constructor(options: {
235
- elements: Array<Expression | CommentStatement>;
250
+ elements: Array<Expression>;
236
251
  open?: Token;
237
252
  close?: Token;
238
253
  });
239
- readonly elements: Array<Expression | CommentStatement>;
254
+ readonly elements: Array<Expression>;
240
255
  readonly tokens: {
241
256
  readonly open?: Token;
242
257
  readonly close?: Token;
243
258
  };
244
259
  readonly kind = AstNodeKind.ArrayLiteralExpression;
245
- readonly range: Range;
246
- transpile(state: BrsTranspileState): any[];
260
+ readonly range: Range | undefined;
261
+ transpile(state: BrsTranspileState): TranspileResult;
247
262
  walk(visitor: WalkVisitor, options: WalkOptions): void;
248
263
  getType(options: GetTypeOptions): BscType;
264
+ getLeadingTrivia(): Token[];
249
265
  }
250
266
  export declare class AAMemberExpression extends Expression {
251
267
  constructor(options: {
@@ -256,7 +272,7 @@ export declare class AAMemberExpression extends Expression {
256
272
  comma?: Token;
257
273
  });
258
274
  readonly kind = AstNodeKind.AAMemberExpression;
259
- readonly range: Range;
275
+ readonly range: Range | undefined;
260
276
  readonly tokens: {
261
277
  readonly key: Token;
262
278
  readonly colon?: Token;
@@ -267,23 +283,25 @@ export declare class AAMemberExpression extends Expression {
267
283
  transpile(state: BrsTranspileState): any[];
268
284
  walk(visitor: WalkVisitor, options: WalkOptions): void;
269
285
  getType(options: GetTypeOptions): BscType;
286
+ getLeadingTrivia(): Token[];
270
287
  }
271
288
  export declare class AALiteralExpression extends Expression {
272
289
  constructor(options: {
273
- elements: Array<AAMemberExpression | CommentStatement>;
290
+ elements: Array<AAMemberExpression>;
274
291
  open?: Token;
275
292
  close?: Token;
276
293
  });
277
- readonly elements: Array<AAMemberExpression | CommentStatement>;
294
+ readonly elements: Array<AAMemberExpression>;
278
295
  readonly tokens: {
279
296
  readonly open?: Token;
280
297
  readonly close?: Token;
281
298
  };
282
299
  readonly kind = AstNodeKind.AALiteralExpression;
283
- readonly range: Range;
284
- transpile(state: BrsTranspileState): any[];
300
+ readonly range: Range | undefined;
301
+ transpile(state: BrsTranspileState): TranspileResult;
285
302
  walk(visitor: WalkVisitor, options: WalkOptions): void;
286
303
  getType(options: GetTypeOptions): BscType;
304
+ getLeadingTrivia(): Token[];
287
305
  }
288
306
  export declare class UnaryExpression extends Expression {
289
307
  constructor(options: {
@@ -291,14 +309,15 @@ export declare class UnaryExpression extends Expression {
291
309
  right: Expression;
292
310
  });
293
311
  readonly kind = AstNodeKind.UnaryExpression;
294
- readonly range: Range;
312
+ readonly range: Range | undefined;
295
313
  readonly tokens: {
296
314
  readonly operator: Token;
297
315
  };
298
316
  readonly right: Expression;
299
- transpile(state: BrsTranspileState): (string | SourceNode)[];
317
+ transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
300
318
  walk(visitor: WalkVisitor, options: WalkOptions): void;
301
319
  getType(options: GetTypeOptions): BscType;
320
+ getLeadingTrivia(): Token[];
302
321
  }
303
322
  export declare class VariableExpression extends Expression {
304
323
  constructor(options: {
@@ -310,9 +329,10 @@ export declare class VariableExpression extends Expression {
310
329
  readonly kind = AstNodeKind.VariableExpression;
311
330
  readonly range: Range;
312
331
  getName(parseMode?: ParseMode): string;
313
- transpile(state: BrsTranspileState): any[];
332
+ transpile(state: BrsTranspileState): TranspileResult;
314
333
  walk(visitor: WalkVisitor, options: WalkOptions): void;
315
334
  getType(options: GetTypeOptions): BscType;
335
+ getLeadingTrivia(): Token[];
316
336
  }
317
337
  export declare class SourceLiteralExpression extends Expression {
318
338
  constructor(options: {
@@ -328,8 +348,13 @@ export declare class SourceLiteralExpression extends Expression {
328
348
  */
329
349
  private findFunctionIndex;
330
350
  private getFunctionName;
351
+ /**
352
+ * Get the line number from our token or from the closest ancestor that has a range
353
+ */
354
+ private getClosestLineNumber;
331
355
  transpile(state: BrsTranspileState): SourceNode[];
332
356
  walk(visitor: WalkVisitor, options: WalkOptions): void;
357
+ getLeadingTrivia(): Token[];
333
358
  }
334
359
  /**
335
360
  * This expression transpiles and acts exactly like a CallExpression,
@@ -342,7 +367,7 @@ export declare class NewExpression extends Expression {
342
367
  call: CallExpression;
343
368
  });
344
369
  readonly kind = AstNodeKind.NewExpression;
345
- readonly range: Range;
370
+ readonly range: Range | undefined;
346
371
  readonly tokens: {
347
372
  readonly new?: Token;
348
373
  };
@@ -351,9 +376,10 @@ export declare class NewExpression extends Expression {
351
376
  * The name of the class to initialize (with optional namespace prefixed)
352
377
  */
353
378
  get className(): DottedGetExpression | VariableExpression;
354
- transpile(state: BrsTranspileState): (string | SourceNode)[];
379
+ transpile(state: BrsTranspileState): TranspileResult;
355
380
  walk(visitor: WalkVisitor, options: WalkOptions): void;
356
381
  getType(options: GetTypeOptions): any;
382
+ getLeadingTrivia(): Token[];
357
383
  }
358
384
  export declare class CallfuncExpression extends Expression {
359
385
  constructor(options: {
@@ -373,10 +399,11 @@ export declare class CallfuncExpression extends Expression {
373
399
  readonly closingParen?: Token;
374
400
  };
375
401
  readonly kind = AstNodeKind.CallfuncExpression;
376
- readonly range: Range;
377
- transpile(state: BrsTranspileState): any[];
402
+ readonly range: Range | undefined;
403
+ transpile(state: BrsTranspileState): TranspileResult;
378
404
  walk(visitor: WalkVisitor, options: WalkOptions): void;
379
405
  getType(options: GetTypeOptions): BscType;
406
+ getLeadingTrivia(): Token[];
380
407
  }
381
408
  /**
382
409
  * Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
@@ -388,8 +415,8 @@ export declare class TemplateStringQuasiExpression extends Expression {
388
415
  });
389
416
  readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
390
417
  readonly kind = AstNodeKind.TemplateStringQuasiExpression;
391
- readonly range: Range;
392
- transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): any[];
418
+ readonly range: Range | undefined;
419
+ transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): TranspileResult;
393
420
  walk(visitor: WalkVisitor, options: WalkOptions): void;
394
421
  }
395
422
  export declare class TemplateStringExpression extends Expression {
@@ -406,9 +433,9 @@ export declare class TemplateStringExpression extends Expression {
406
433
  };
407
434
  readonly quasis: TemplateStringQuasiExpression[];
408
435
  readonly expressions: Expression[];
409
- readonly range: Range;
436
+ readonly range: Range | undefined;
410
437
  getType(options: GetTypeOptions): StringType;
411
- transpile(state: BrsTranspileState): any[];
438
+ transpile(state: BrsTranspileState): TranspileResult;
412
439
  walk(visitor: WalkVisitor, options: WalkOptions): void;
413
440
  }
414
441
  export declare class TaggedTemplateStringExpression extends Expression {
@@ -427,8 +454,8 @@ export declare class TaggedTemplateStringExpression extends Expression {
427
454
  };
428
455
  readonly quasis: TemplateStringQuasiExpression[];
429
456
  readonly expressions: Expression[];
430
- readonly range: Range;
431
- transpile(state: BrsTranspileState): any[];
457
+ readonly range: Range | undefined;
458
+ transpile(state: BrsTranspileState): TranspileResult;
432
459
  walk(visitor: WalkVisitor, options: WalkOptions): void;
433
460
  }
434
461
  export declare class AnnotationExpression extends Expression {
@@ -442,7 +469,7 @@ export declare class AnnotationExpression extends Expression {
442
469
  readonly at: Token;
443
470
  readonly name: Token;
444
471
  };
445
- get range(): Range;
472
+ get range(): Range | undefined;
446
473
  readonly name: string;
447
474
  call: CallExpression;
448
475
  /**
@@ -453,7 +480,7 @@ export declare class AnnotationExpression extends Expression {
453
480
  getLeadingTrivia(): Token[];
454
481
  transpile(state: BrsTranspileState): any[];
455
482
  walk(visitor: WalkVisitor, options: WalkOptions): void;
456
- getTypedef(state: BrsTranspileState): (string | SourceNode)[];
483
+ getTypedef(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
457
484
  }
458
485
  export declare class TernaryExpression extends Expression {
459
486
  constructor(options: {
@@ -464,7 +491,7 @@ export declare class TernaryExpression extends Expression {
464
491
  alternate?: Expression;
465
492
  });
466
493
  readonly kind = AstNodeKind.TernaryExpression;
467
- readonly range: Range;
494
+ readonly range: Range | undefined;
468
495
  readonly tokens: {
469
496
  readonly questionMark?: Token;
470
497
  readonly colon?: Token;
@@ -472,8 +499,9 @@ export declare class TernaryExpression extends Expression {
472
499
  readonly test: Expression;
473
500
  readonly consequent?: Expression;
474
501
  readonly alternate?: Expression;
475
- transpile(state: BrsTranspileState): any[];
502
+ transpile(state: BrsTranspileState): TranspileResult;
476
503
  walk(visitor: WalkVisitor, options: WalkOptions): void;
504
+ getLeadingTrivia(): Token[];
477
505
  }
478
506
  export declare class NullCoalescingExpression extends Expression {
479
507
  constructor(options: {
@@ -482,14 +510,15 @@ export declare class NullCoalescingExpression extends Expression {
482
510
  alternate: Expression;
483
511
  });
484
512
  readonly kind = AstNodeKind.NullCoalescingExpression;
485
- readonly range: Range;
513
+ readonly range: Range | undefined;
486
514
  readonly tokens: {
487
515
  readonly questionQuestion?: Token;
488
516
  };
489
517
  readonly consequent: Expression;
490
518
  readonly alternate: Expression;
491
- transpile(state: BrsTranspileState): any[];
519
+ transpile(state: BrsTranspileState): TranspileResult;
492
520
  walk(visitor: WalkVisitor, options: WalkOptions): void;
521
+ getLeadingTrivia(): Token[];
493
522
  }
494
523
  export declare class RegexLiteralExpression extends Expression {
495
524
  constructor(options: {
@@ -502,10 +531,11 @@ export declare class RegexLiteralExpression extends Expression {
502
531
  get range(): Range;
503
532
  transpile(state: BrsTranspileState): TranspileResult;
504
533
  walk(visitor: WalkVisitor, options: WalkOptions): void;
534
+ getLeadingTrivia(): Token[];
505
535
  }
506
536
  declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
507
537
  [key: string]: ExpressionValue;
508
- };
538
+ } | null;
509
539
  export declare class TypeExpression extends Expression implements TypedefProvider {
510
540
  constructor(options: {
511
541
  /**
@@ -522,7 +552,7 @@ export declare class TypeExpression extends Expression implements TypedefProvide
522
552
  transpile(state: BrsTranspileState): TranspileResult;
523
553
  walk(visitor: WalkVisitor, options: WalkOptions): void;
524
554
  getType(options: GetTypeOptions): BscType;
525
- getTypedef(state: TranspileState): (string | SourceNode)[];
555
+ getTypedef(state: TranspileState): TranspileResult;
526
556
  getName(parseMode?: ParseMode): string;
527
557
  getNameParts(): string[];
528
558
  }