brighterscript 1.0.0-alpha.27 → 1.0.0-alpha.28
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.
- package/CHANGELOG.md +61 -0
- package/README.md +1 -1
- package/dist/AstValidationSegmenter.d.ts +1 -1
- package/dist/AstValidationSegmenter.js +2 -2
- package/dist/AstValidationSegmenter.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +7 -4
- package/dist/DiagnosticFilterer.js +67 -37
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +1 -1
- package/dist/PluginInterface.js +1 -1
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +1 -1
- package/dist/Program.js +10 -6
- package/dist/Program.js.map +1 -1
- package/dist/Scope.d.ts +6 -27
- package/dist/Scope.js +40 -298
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +1 -1
- package/dist/{SymbolTableFlag.js → SymbolTypeFlag.js} +1 -1
- package/dist/SymbolTypeFlag.js.map +1 -0
- package/dist/XmlScope.d.ts +0 -8
- package/dist/XmlScope.js +0 -77
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.js +4 -8
- package/dist/astUtils/CachedLookups.js.map +1 -1
- package/dist/astUtils/creators.d.ts +1 -0
- package/dist/astUtils/creators.js +3 -2
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +0 -10
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +1 -2
- package/dist/astUtils/reflection.js +3 -7
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +10 -15
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +1 -2
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +1 -5
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +2 -1
- package/dist/bscPlugin/BscPlugin.js +4 -0
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/SignatureHelpUtil.js +4 -3
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +26 -9
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +39 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.js +5 -5
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +51 -5
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
- package/dist/bscPlugin/references/ReferencesProvider.js +56 -0
- package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +1 -6
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +28 -1
- package/dist/bscPlugin/validation/ScopeValidator.js +365 -7
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +89 -3
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +11 -4
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +12 -2
- package/dist/files/BrsFile.js +64 -38
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +373 -6
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.js +1 -1
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +41 -3
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +9 -3
- package/dist/lexer/Lexer.js +36 -15
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +76 -38
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.js +1 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +1 -0
- package/dist/lexer/TokenKind.js +4 -1
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +1 -2
- package/dist/parser/AstNode.js +0 -1
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +1 -1
- package/dist/parser/Expression.d.ts +71 -47
- package/dist/parser/Expression.js +155 -87
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.d.ts +7 -2
- package/dist/parser/Parser.js +40 -87
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +21 -44
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGTypes.js +5 -5
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +92 -84
- package/dist/parser/Statement.js +199 -133
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +0 -13
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +17 -8
- package/dist/parser/TranspileState.js +64 -6
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +1 -1
- package/dist/parser/tests/Parser.spec.js +1 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +1 -3
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +44 -0
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +6 -6
- package/dist/parser/tests/expression/TernaryExpression.spec.js +47 -0
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +2 -2
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +8 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +25 -5
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/preprocessor/Chunk.js +1 -2
- package/dist/preprocessor/Chunk.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.js +2 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +3 -0
- package/dist/types/AssociativeArrayType.js +9 -0
- package/dist/types/AssociativeArrayType.js.map +1 -1
- package/dist/types/BscType.d.ts +1 -1
- package/dist/types/BscType.js +1 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/ComponentType.d.ts +1 -1
- package/dist/types/ReferenceType.d.ts +1 -1
- package/dist/util.d.ts +18 -8
- package/dist/util.js +96 -18
- package/dist/util.js.map +1 -1
- package/package.json +6 -3
- package/dist/SymbolTableFlag.js.map +0 -1
- /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,
|
|
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,10 +27,11 @@ 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):
|
|
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 {
|
|
35
37
|
static MaximumArguments: number;
|
|
@@ -49,10 +51,11 @@ export declare class CallExpression extends Expression {
|
|
|
49
51
|
readonly closingParen?: Token;
|
|
50
52
|
};
|
|
51
53
|
readonly kind = AstNodeKind.CallExpression;
|
|
52
|
-
readonly range: Range;
|
|
53
|
-
transpile(state: BrsTranspileState, nameOverride?: string):
|
|
54
|
+
readonly range: Range | undefined;
|
|
55
|
+
transpile(state: BrsTranspileState, nameOverride?: string): TranspileResult;
|
|
54
56
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
55
57
|
getType(options: GetTypeOptions): any;
|
|
58
|
+
getLeadingTrivia(): Token[];
|
|
56
59
|
}
|
|
57
60
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
58
61
|
constructor(options: {
|
|
@@ -86,7 +89,7 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
86
89
|
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
87
90
|
*/
|
|
88
91
|
get range(): Range;
|
|
89
|
-
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean):
|
|
92
|
+
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): TranspileResult;
|
|
90
93
|
getTypedef(state: BrsTranspileState): SourceNode[];
|
|
91
94
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
92
95
|
getType(options: GetTypeOptions): TypedFunctionType;
|
|
@@ -108,10 +111,11 @@ export declare class FunctionParameterExpression extends Expression {
|
|
|
108
111
|
readonly defaultValue?: Expression;
|
|
109
112
|
readonly typeExpression?: TypeExpression;
|
|
110
113
|
getType(options: GetTypeOptions): BscType;
|
|
111
|
-
get range(): Range;
|
|
112
|
-
transpile(state: BrsTranspileState):
|
|
114
|
+
get range(): Range | undefined;
|
|
115
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
113
116
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
114
117
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
118
|
+
getLeadingTrivia(): Token[];
|
|
115
119
|
}
|
|
116
120
|
export declare class DottedGetExpression extends Expression {
|
|
117
121
|
constructor(options: {
|
|
@@ -128,11 +132,12 @@ export declare class DottedGetExpression extends Expression {
|
|
|
128
132
|
};
|
|
129
133
|
readonly obj: Expression;
|
|
130
134
|
readonly kind = AstNodeKind.DottedGetExpression;
|
|
131
|
-
readonly range: Range;
|
|
132
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
135
|
+
readonly range: Range | undefined;
|
|
136
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
133
137
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
134
138
|
getType(options: GetTypeOptions): BscType;
|
|
135
139
|
getName(parseMode: ParseMode): string;
|
|
140
|
+
getLeadingTrivia(): Token[];
|
|
136
141
|
}
|
|
137
142
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
138
143
|
constructor(options: {
|
|
@@ -149,9 +154,10 @@ export declare class XmlAttributeGetExpression extends Expression {
|
|
|
149
154
|
at?: Token;
|
|
150
155
|
};
|
|
151
156
|
readonly obj: Expression;
|
|
152
|
-
readonly range: Range;
|
|
153
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
157
|
+
readonly range: Range | undefined;
|
|
158
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
154
159
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
160
|
+
getLeadingTrivia(): Token[];
|
|
155
161
|
}
|
|
156
162
|
export declare class IndexedGetExpression extends Expression {
|
|
157
163
|
constructor(options: {
|
|
@@ -175,10 +181,11 @@ export declare class IndexedGetExpression extends Expression {
|
|
|
175
181
|
readonly closingSquare?: Token;
|
|
176
182
|
readonly questionDot?: Token;
|
|
177
183
|
};
|
|
178
|
-
readonly range: Range;
|
|
184
|
+
readonly range: Range | undefined;
|
|
179
185
|
transpile(state: BrsTranspileState): any[];
|
|
180
186
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
181
187
|
getType(options: GetTypeOptions): BscType;
|
|
188
|
+
getLeadingTrivia(): Token[];
|
|
182
189
|
}
|
|
183
190
|
export declare class GroupingExpression extends Expression {
|
|
184
191
|
constructor(options: {
|
|
@@ -192,10 +199,11 @@ export declare class GroupingExpression extends Expression {
|
|
|
192
199
|
};
|
|
193
200
|
readonly expression: Expression;
|
|
194
201
|
readonly kind = AstNodeKind.GroupingExpression;
|
|
195
|
-
readonly range: Range;
|
|
202
|
+
readonly range: Range | undefined;
|
|
196
203
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
197
204
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
198
205
|
getType(options: GetTypeOptions): BscType;
|
|
206
|
+
getLeadingTrivia(): Token[];
|
|
199
207
|
}
|
|
200
208
|
export declare class LiteralExpression extends Expression {
|
|
201
209
|
constructor(options: {
|
|
@@ -206,9 +214,10 @@ export declare class LiteralExpression extends Expression {
|
|
|
206
214
|
};
|
|
207
215
|
readonly kind = AstNodeKind.LiteralExpression;
|
|
208
216
|
get range(): Range;
|
|
209
|
-
getType(options?: GetTypeOptions): DynamicType | import("
|
|
210
|
-
transpile(state: BrsTranspileState):
|
|
217
|
+
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;
|
|
218
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
211
219
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
220
|
+
getLeadingTrivia(): Token[];
|
|
212
221
|
}
|
|
213
222
|
/**
|
|
214
223
|
* This is a special expression only used within template strings. It exists so we can prevent producing lots of empty strings
|
|
@@ -232,20 +241,21 @@ export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
|
232
241
|
}
|
|
233
242
|
export declare class ArrayLiteralExpression extends Expression {
|
|
234
243
|
constructor(options: {
|
|
235
|
-
elements: Array<Expression
|
|
244
|
+
elements: Array<Expression>;
|
|
236
245
|
open?: Token;
|
|
237
246
|
close?: Token;
|
|
238
247
|
});
|
|
239
|
-
readonly elements: Array<Expression
|
|
248
|
+
readonly elements: Array<Expression>;
|
|
240
249
|
readonly tokens: {
|
|
241
250
|
readonly open?: Token;
|
|
242
251
|
readonly close?: Token;
|
|
243
252
|
};
|
|
244
253
|
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
245
|
-
readonly range: Range;
|
|
246
|
-
transpile(state: BrsTranspileState):
|
|
254
|
+
readonly range: Range | undefined;
|
|
255
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
247
256
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
248
257
|
getType(options: GetTypeOptions): BscType;
|
|
258
|
+
getLeadingTrivia(): Token[];
|
|
249
259
|
}
|
|
250
260
|
export declare class AAMemberExpression extends Expression {
|
|
251
261
|
constructor(options: {
|
|
@@ -256,7 +266,7 @@ export declare class AAMemberExpression extends Expression {
|
|
|
256
266
|
comma?: Token;
|
|
257
267
|
});
|
|
258
268
|
readonly kind = AstNodeKind.AAMemberExpression;
|
|
259
|
-
readonly range: Range;
|
|
269
|
+
readonly range: Range | undefined;
|
|
260
270
|
readonly tokens: {
|
|
261
271
|
readonly key: Token;
|
|
262
272
|
readonly colon?: Token;
|
|
@@ -267,23 +277,25 @@ export declare class AAMemberExpression extends Expression {
|
|
|
267
277
|
transpile(state: BrsTranspileState): any[];
|
|
268
278
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
269
279
|
getType(options: GetTypeOptions): BscType;
|
|
280
|
+
getLeadingTrivia(): Token[];
|
|
270
281
|
}
|
|
271
282
|
export declare class AALiteralExpression extends Expression {
|
|
272
283
|
constructor(options: {
|
|
273
|
-
elements: Array<AAMemberExpression
|
|
284
|
+
elements: Array<AAMemberExpression>;
|
|
274
285
|
open?: Token;
|
|
275
286
|
close?: Token;
|
|
276
287
|
});
|
|
277
|
-
readonly elements: Array<AAMemberExpression
|
|
288
|
+
readonly elements: Array<AAMemberExpression>;
|
|
278
289
|
readonly tokens: {
|
|
279
290
|
readonly open?: Token;
|
|
280
291
|
readonly close?: Token;
|
|
281
292
|
};
|
|
282
293
|
readonly kind = AstNodeKind.AALiteralExpression;
|
|
283
|
-
readonly range: Range;
|
|
284
|
-
transpile(state: BrsTranspileState):
|
|
294
|
+
readonly range: Range | undefined;
|
|
295
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
285
296
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
286
297
|
getType(options: GetTypeOptions): BscType;
|
|
298
|
+
getLeadingTrivia(): Token[];
|
|
287
299
|
}
|
|
288
300
|
export declare class UnaryExpression extends Expression {
|
|
289
301
|
constructor(options: {
|
|
@@ -291,14 +303,15 @@ export declare class UnaryExpression extends Expression {
|
|
|
291
303
|
right: Expression;
|
|
292
304
|
});
|
|
293
305
|
readonly kind = AstNodeKind.UnaryExpression;
|
|
294
|
-
readonly range: Range;
|
|
306
|
+
readonly range: Range | undefined;
|
|
295
307
|
readonly tokens: {
|
|
296
308
|
readonly operator: Token;
|
|
297
309
|
};
|
|
298
310
|
readonly right: Expression;
|
|
299
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
311
|
+
transpile(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
300
312
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
301
313
|
getType(options: GetTypeOptions): BscType;
|
|
314
|
+
getLeadingTrivia(): Token[];
|
|
302
315
|
}
|
|
303
316
|
export declare class VariableExpression extends Expression {
|
|
304
317
|
constructor(options: {
|
|
@@ -310,9 +323,10 @@ export declare class VariableExpression extends Expression {
|
|
|
310
323
|
readonly kind = AstNodeKind.VariableExpression;
|
|
311
324
|
readonly range: Range;
|
|
312
325
|
getName(parseMode?: ParseMode): string;
|
|
313
|
-
transpile(state: BrsTranspileState):
|
|
326
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
314
327
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
315
328
|
getType(options: GetTypeOptions): BscType;
|
|
329
|
+
getLeadingTrivia(): Token[];
|
|
316
330
|
}
|
|
317
331
|
export declare class SourceLiteralExpression extends Expression {
|
|
318
332
|
constructor(options: {
|
|
@@ -328,8 +342,13 @@ export declare class SourceLiteralExpression extends Expression {
|
|
|
328
342
|
*/
|
|
329
343
|
private findFunctionIndex;
|
|
330
344
|
private getFunctionName;
|
|
345
|
+
/**
|
|
346
|
+
* Get the line number from our token or from the closest ancestor that has a range
|
|
347
|
+
*/
|
|
348
|
+
private getClosestLineNumber;
|
|
331
349
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
332
350
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
351
|
+
getLeadingTrivia(): Token[];
|
|
333
352
|
}
|
|
334
353
|
/**
|
|
335
354
|
* This expression transpiles and acts exactly like a CallExpression,
|
|
@@ -342,7 +361,7 @@ export declare class NewExpression extends Expression {
|
|
|
342
361
|
call: CallExpression;
|
|
343
362
|
});
|
|
344
363
|
readonly kind = AstNodeKind.NewExpression;
|
|
345
|
-
readonly range: Range;
|
|
364
|
+
readonly range: Range | undefined;
|
|
346
365
|
readonly tokens: {
|
|
347
366
|
readonly new?: Token;
|
|
348
367
|
};
|
|
@@ -351,9 +370,10 @@ export declare class NewExpression extends Expression {
|
|
|
351
370
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
352
371
|
*/
|
|
353
372
|
get className(): DottedGetExpression | VariableExpression;
|
|
354
|
-
transpile(state: BrsTranspileState):
|
|
373
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
355
374
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
356
375
|
getType(options: GetTypeOptions): any;
|
|
376
|
+
getLeadingTrivia(): Token[];
|
|
357
377
|
}
|
|
358
378
|
export declare class CallfuncExpression extends Expression {
|
|
359
379
|
constructor(options: {
|
|
@@ -373,10 +393,11 @@ export declare class CallfuncExpression extends Expression {
|
|
|
373
393
|
readonly closingParen?: Token;
|
|
374
394
|
};
|
|
375
395
|
readonly kind = AstNodeKind.CallfuncExpression;
|
|
376
|
-
readonly range: Range;
|
|
377
|
-
transpile(state: BrsTranspileState):
|
|
396
|
+
readonly range: Range | undefined;
|
|
397
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
378
398
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
379
399
|
getType(options: GetTypeOptions): BscType;
|
|
400
|
+
getLeadingTrivia(): Token[];
|
|
380
401
|
}
|
|
381
402
|
/**
|
|
382
403
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
@@ -388,8 +409,8 @@ export declare class TemplateStringQuasiExpression extends Expression {
|
|
|
388
409
|
});
|
|
389
410
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
390
411
|
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
391
|
-
readonly range: Range;
|
|
392
|
-
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean):
|
|
412
|
+
readonly range: Range | undefined;
|
|
413
|
+
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): TranspileResult;
|
|
393
414
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
394
415
|
}
|
|
395
416
|
export declare class TemplateStringExpression extends Expression {
|
|
@@ -406,9 +427,9 @@ export declare class TemplateStringExpression extends Expression {
|
|
|
406
427
|
};
|
|
407
428
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
408
429
|
readonly expressions: Expression[];
|
|
409
|
-
readonly range: Range;
|
|
430
|
+
readonly range: Range | undefined;
|
|
410
431
|
getType(options: GetTypeOptions): StringType;
|
|
411
|
-
transpile(state: BrsTranspileState):
|
|
432
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
412
433
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
413
434
|
}
|
|
414
435
|
export declare class TaggedTemplateStringExpression extends Expression {
|
|
@@ -427,8 +448,8 @@ export declare class TaggedTemplateStringExpression extends Expression {
|
|
|
427
448
|
};
|
|
428
449
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
429
450
|
readonly expressions: Expression[];
|
|
430
|
-
readonly range: Range;
|
|
431
|
-
transpile(state: BrsTranspileState):
|
|
451
|
+
readonly range: Range | undefined;
|
|
452
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
432
453
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
433
454
|
}
|
|
434
455
|
export declare class AnnotationExpression extends Expression {
|
|
@@ -442,7 +463,7 @@ export declare class AnnotationExpression extends Expression {
|
|
|
442
463
|
readonly at: Token;
|
|
443
464
|
readonly name: Token;
|
|
444
465
|
};
|
|
445
|
-
get range(): Range;
|
|
466
|
+
get range(): Range | undefined;
|
|
446
467
|
readonly name: string;
|
|
447
468
|
call: CallExpression;
|
|
448
469
|
/**
|
|
@@ -453,7 +474,7 @@ export declare class AnnotationExpression extends Expression {
|
|
|
453
474
|
getLeadingTrivia(): Token[];
|
|
454
475
|
transpile(state: BrsTranspileState): any[];
|
|
455
476
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
456
|
-
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
477
|
+
getTypedef(state: BrsTranspileState): (string | SourceNode | TranspileResult)[];
|
|
457
478
|
}
|
|
458
479
|
export declare class TernaryExpression extends Expression {
|
|
459
480
|
constructor(options: {
|
|
@@ -464,7 +485,7 @@ export declare class TernaryExpression extends Expression {
|
|
|
464
485
|
alternate?: Expression;
|
|
465
486
|
});
|
|
466
487
|
readonly kind = AstNodeKind.TernaryExpression;
|
|
467
|
-
readonly range: Range;
|
|
488
|
+
readonly range: Range | undefined;
|
|
468
489
|
readonly tokens: {
|
|
469
490
|
readonly questionMark?: Token;
|
|
470
491
|
readonly colon?: Token;
|
|
@@ -472,8 +493,9 @@ export declare class TernaryExpression extends Expression {
|
|
|
472
493
|
readonly test: Expression;
|
|
473
494
|
readonly consequent?: Expression;
|
|
474
495
|
readonly alternate?: Expression;
|
|
475
|
-
transpile(state: BrsTranspileState):
|
|
496
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
476
497
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
498
|
+
getLeadingTrivia(): Token[];
|
|
477
499
|
}
|
|
478
500
|
export declare class NullCoalescingExpression extends Expression {
|
|
479
501
|
constructor(options: {
|
|
@@ -482,14 +504,15 @@ export declare class NullCoalescingExpression extends Expression {
|
|
|
482
504
|
alternate: Expression;
|
|
483
505
|
});
|
|
484
506
|
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
485
|
-
readonly range: Range;
|
|
507
|
+
readonly range: Range | undefined;
|
|
486
508
|
readonly tokens: {
|
|
487
509
|
readonly questionQuestion?: Token;
|
|
488
510
|
};
|
|
489
511
|
readonly consequent: Expression;
|
|
490
512
|
readonly alternate: Expression;
|
|
491
|
-
transpile(state: BrsTranspileState):
|
|
513
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
492
514
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
515
|
+
getLeadingTrivia(): Token[];
|
|
493
516
|
}
|
|
494
517
|
export declare class RegexLiteralExpression extends Expression {
|
|
495
518
|
constructor(options: {
|
|
@@ -502,10 +525,11 @@ export declare class RegexLiteralExpression extends Expression {
|
|
|
502
525
|
get range(): Range;
|
|
503
526
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
504
527
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
528
|
+
getLeadingTrivia(): Token[];
|
|
505
529
|
}
|
|
506
530
|
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
507
531
|
[key: string]: ExpressionValue;
|
|
508
|
-
};
|
|
532
|
+
} | null;
|
|
509
533
|
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
510
534
|
constructor(options: {
|
|
511
535
|
/**
|
|
@@ -522,7 +546,7 @@ export declare class TypeExpression extends Expression implements TypedefProvide
|
|
|
522
546
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
523
547
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
524
548
|
getType(options: GetTypeOptions): BscType;
|
|
525
|
-
getTypedef(state: TranspileState):
|
|
549
|
+
getTypedef(state: TranspileState): TranspileResult;
|
|
526
550
|
getName(parseMode?: ParseMode): string;
|
|
527
551
|
getNameParts(): string[];
|
|
528
552
|
}
|