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.
- package/CHANGELOG.md +71 -0
- package/README.md +1 -1
- package/dist/AstValidationSegmenter.d.ts +12 -2
- package/dist/AstValidationSegmenter.js +74 -16
- package/dist/AstValidationSegmenter.js.map +1 -1
- package/dist/DependencyGraph.d.ts +4 -0
- package/dist/DependencyGraph.js +19 -0
- package/dist/DependencyGraph.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 +19 -15
- package/dist/Program.js +153 -88
- package/dist/Program.js.map +1 -1
- package/dist/Scope.d.ts +27 -28
- package/dist/Scope.js +174 -361
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.d.ts +4 -0
- package/dist/Stopwatch.js +7 -0
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +2 -1
- package/dist/SymbolTable.js +26 -0
- package/dist/SymbolTable.js.map +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 +4 -4
- package/dist/astUtils/reflection.js +8 -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 +3 -1
- package/dist/bscPlugin/BscPlugin.js +10 -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 +31 -11
- 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/transpile/BrsFileTranspileProcessor.js +1 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileAfterValidatior.d.ts +7 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidatior.js +18 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidatior.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +17 -10
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +37 -1
- package/dist/bscPlugin/validation/ScopeValidator.js +434 -25
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +91 -4
- 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 +23 -5
- package/dist/files/BrsFile.js +189 -51
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +589 -97
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +2 -1
- package/dist/files/BscFile.js.map +1 -1
- package/dist/files/XmlFile.d.ts +2 -2
- package/dist/files/XmlFile.js +2 -2
- 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 +43 -4
- 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 +77 -47
- package/dist/parser/Expression.js +162 -88
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.d.ts +7 -2
- package/dist/parser/Parser.js +40 -90
- 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 +67 -8
- 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 +9 -1
- package/dist/types/ReferenceType.js +45 -1
- package/dist/types/ReferenceType.js.map +1 -1
- package/dist/types/ReferenceType.spec.js +15 -0
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/util.d.ts +23 -9
- package/dist/util.js +115 -21
- 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
|
@@ -6,9 +6,8 @@ import type { Range } from 'vscode-languageserver';
|
|
|
6
6
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
7
7
|
import { ParseMode } from './Parser';
|
|
8
8
|
import type { WalkVisitor, WalkOptions } from '../astUtils/visitors';
|
|
9
|
-
import type
|
|
10
|
-
import type {
|
|
11
|
-
import type { TranspileState } from './TranspileState';
|
|
9
|
+
import { type GetTypeOptions, type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
10
|
+
import type { BscType } from '../types/BscType';
|
|
12
11
|
import { SymbolTable } from '../SymbolTable';
|
|
13
12
|
import type { Expression } from './AstNode';
|
|
14
13
|
import { AstNodeKind } from './AstNode';
|
|
@@ -17,7 +16,6 @@ import { ClassType } from '../types/ClassType';
|
|
|
17
16
|
import { EnumMemberType, EnumType } from '../types/EnumType';
|
|
18
17
|
import { NamespaceType } from '../types/NamespaceType';
|
|
19
18
|
import { InterfaceType } from '../types/InterfaceType';
|
|
20
|
-
import type { BscType } from '../types/BscType';
|
|
21
19
|
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
22
20
|
export declare class EmptyStatement extends Statement {
|
|
23
21
|
constructor(options?: {
|
|
@@ -26,7 +24,7 @@ export declare class EmptyStatement extends Statement {
|
|
|
26
24
|
/**
|
|
27
25
|
* Create a negative range to indicate this is an interpolated location
|
|
28
26
|
*/
|
|
29
|
-
readonly range
|
|
27
|
+
readonly range?: Range;
|
|
30
28
|
readonly kind = AstNodeKind.EmptyStatement;
|
|
31
29
|
transpile(state: BrsTranspileState): any[];
|
|
32
30
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -43,7 +41,7 @@ export declare class Body extends Statement implements TypedefProvider {
|
|
|
43
41
|
readonly symbolTable: SymbolTable;
|
|
44
42
|
get range(): Range;
|
|
45
43
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
46
|
-
getTypedef(state: BrsTranspileState):
|
|
44
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
47
45
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
48
46
|
}
|
|
49
47
|
export declare class AssignmentStatement extends Statement {
|
|
@@ -60,22 +58,23 @@ export declare class AssignmentStatement extends Statement {
|
|
|
60
58
|
readonly as?: Token;
|
|
61
59
|
};
|
|
62
60
|
readonly value: Expression;
|
|
63
|
-
readonly typeExpression
|
|
61
|
+
readonly typeExpression?: TypeExpression;
|
|
64
62
|
readonly kind = AstNodeKind.AssignmentStatement;
|
|
65
|
-
readonly range: Range;
|
|
63
|
+
readonly range: Range | undefined;
|
|
66
64
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
67
65
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
68
66
|
getType(options: GetTypeOptions): BscType;
|
|
67
|
+
getLeadingTrivia(): Token[];
|
|
69
68
|
}
|
|
70
69
|
export declare class Block extends Statement {
|
|
71
70
|
constructor(options: {
|
|
72
71
|
statements: Statement[];
|
|
73
|
-
startingRange
|
|
72
|
+
startingRange?: Range;
|
|
74
73
|
});
|
|
75
74
|
readonly statements: Statement[];
|
|
76
|
-
readonly startingRange
|
|
75
|
+
readonly startingRange?: Range;
|
|
77
76
|
readonly kind = AstNodeKind.Block;
|
|
78
|
-
readonly range: Range;
|
|
77
|
+
readonly range: Range | undefined;
|
|
79
78
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
80
79
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
81
80
|
}
|
|
@@ -85,23 +84,10 @@ export declare class ExpressionStatement extends Statement {
|
|
|
85
84
|
});
|
|
86
85
|
readonly expression: Expression;
|
|
87
86
|
readonly kind = AstNodeKind.ExpressionStatement;
|
|
88
|
-
readonly range: Range;
|
|
87
|
+
readonly range: Range | undefined;
|
|
89
88
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
90
89
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
91
|
-
|
|
92
|
-
export declare class CommentStatement extends Statement implements Expression, TypedefProvider {
|
|
93
|
-
constructor(options: {
|
|
94
|
-
comments: Token[];
|
|
95
|
-
});
|
|
96
|
-
readonly tokens: {
|
|
97
|
-
readonly comments: Token[];
|
|
98
|
-
};
|
|
99
|
-
readonly kind = AstNodeKind.CommentStatement;
|
|
100
|
-
readonly range: Range;
|
|
101
|
-
get text(): string;
|
|
102
|
-
transpile(state: BrsTranspileState): any[];
|
|
103
|
-
getTypedef(state: TranspileState): any[];
|
|
104
|
-
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
90
|
+
getLeadingTrivia(): Token[];
|
|
105
91
|
}
|
|
106
92
|
export declare class ExitForStatement extends Statement {
|
|
107
93
|
constructor(options?: {
|
|
@@ -111,9 +97,10 @@ export declare class ExitForStatement extends Statement {
|
|
|
111
97
|
readonly exitFor?: Token;
|
|
112
98
|
};
|
|
113
99
|
readonly kind = AstNodeKind.ExitForStatement;
|
|
114
|
-
readonly range
|
|
115
|
-
transpile(state: BrsTranspileState):
|
|
100
|
+
readonly range?: Range;
|
|
101
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
116
102
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
103
|
+
getLeadingTrivia(): Token[];
|
|
117
104
|
}
|
|
118
105
|
export declare class ExitWhileStatement extends Statement {
|
|
119
106
|
constructor(options?: {
|
|
@@ -123,9 +110,10 @@ export declare class ExitWhileStatement extends Statement {
|
|
|
123
110
|
readonly exitWhile?: Token;
|
|
124
111
|
};
|
|
125
112
|
readonly kind = AstNodeKind.ExitWhileStatement;
|
|
126
|
-
readonly range
|
|
127
|
-
transpile(state: BrsTranspileState):
|
|
113
|
+
readonly range?: Range;
|
|
114
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
128
115
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
116
|
+
getLeadingTrivia(): Token[];
|
|
129
117
|
}
|
|
130
118
|
export declare class FunctionStatement extends Statement implements TypedefProvider {
|
|
131
119
|
constructor(options: {
|
|
@@ -137,14 +125,14 @@ export declare class FunctionStatement extends Statement implements TypedefProvi
|
|
|
137
125
|
};
|
|
138
126
|
readonly func: FunctionExpression;
|
|
139
127
|
readonly kind: AstNodeKind;
|
|
140
|
-
readonly range: Range;
|
|
128
|
+
readonly range: Range | undefined;
|
|
141
129
|
/**
|
|
142
130
|
* Get the name of this expression based on the parse mode
|
|
143
131
|
*/
|
|
144
132
|
getName(parseMode: ParseMode): string;
|
|
145
133
|
getLeadingTrivia(): Token[];
|
|
146
|
-
transpile(state: BrsTranspileState):
|
|
147
|
-
getTypedef(state: BrsTranspileState):
|
|
134
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
135
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
148
136
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
149
137
|
getType(options: GetTypeOptions): TypedFunctionType;
|
|
150
138
|
}
|
|
@@ -170,9 +158,10 @@ export declare class IfStatement extends Statement {
|
|
|
170
158
|
readonly elseBranch?: IfStatement | Block;
|
|
171
159
|
readonly isInline?: boolean;
|
|
172
160
|
readonly kind = AstNodeKind.IfStatement;
|
|
173
|
-
readonly range: Range;
|
|
174
|
-
transpile(state: BrsTranspileState):
|
|
161
|
+
readonly range: Range | undefined;
|
|
162
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
175
163
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
164
|
+
getLeadingTrivia(): Token[];
|
|
176
165
|
}
|
|
177
166
|
export declare class IncrementStatement extends Statement {
|
|
178
167
|
constructor(options: {
|
|
@@ -184,9 +173,10 @@ export declare class IncrementStatement extends Statement {
|
|
|
184
173
|
readonly operator: Token;
|
|
185
174
|
};
|
|
186
175
|
readonly kind = AstNodeKind.IncrementStatement;
|
|
187
|
-
readonly range: Range;
|
|
188
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
176
|
+
readonly range: Range | undefined;
|
|
177
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode | TranspileResult)[];
|
|
189
178
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
179
|
+
getLeadingTrivia(): Token[];
|
|
190
180
|
}
|
|
191
181
|
/** Used to indent the current `print` position to the next 16-character-width output zone. */
|
|
192
182
|
export interface PrintSeparatorTab extends Token {
|
|
@@ -215,9 +205,10 @@ export declare class PrintStatement extends Statement {
|
|
|
215
205
|
};
|
|
216
206
|
readonly expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
217
207
|
readonly kind = AstNodeKind.PrintStatement;
|
|
218
|
-
readonly range: Range;
|
|
219
|
-
transpile(state: BrsTranspileState):
|
|
208
|
+
readonly range: Range | undefined;
|
|
209
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
220
210
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
211
|
+
getLeadingTrivia(): Token[];
|
|
221
212
|
}
|
|
222
213
|
export declare class DimStatement extends Statement {
|
|
223
214
|
constructor(options: {
|
|
@@ -235,10 +226,11 @@ export declare class DimStatement extends Statement {
|
|
|
235
226
|
};
|
|
236
227
|
readonly dimensions: Expression[];
|
|
237
228
|
readonly kind = AstNodeKind.DimStatement;
|
|
238
|
-
readonly range: Range;
|
|
239
|
-
transpile(state: BrsTranspileState):
|
|
229
|
+
readonly range: Range | undefined;
|
|
230
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
240
231
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
241
232
|
getType(options: GetTypeOptions): BscType;
|
|
233
|
+
getLeadingTrivia(): Token[];
|
|
242
234
|
}
|
|
243
235
|
export declare class GotoStatement extends Statement {
|
|
244
236
|
constructor(options: {
|
|
@@ -250,9 +242,10 @@ export declare class GotoStatement extends Statement {
|
|
|
250
242
|
readonly label: Token;
|
|
251
243
|
};
|
|
252
244
|
readonly kind = AstNodeKind.GotoStatement;
|
|
253
|
-
readonly range: Range;
|
|
254
|
-
transpile(state: BrsTranspileState): (string |
|
|
245
|
+
readonly range: Range | undefined;
|
|
246
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
255
247
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
248
|
+
getLeadingTrivia(): Token[];
|
|
256
249
|
}
|
|
257
250
|
export declare class LabelStatement extends Statement {
|
|
258
251
|
constructor(options: {
|
|
@@ -264,9 +257,9 @@ export declare class LabelStatement extends Statement {
|
|
|
264
257
|
readonly colon: Token;
|
|
265
258
|
};
|
|
266
259
|
readonly kind = AstNodeKind.LabelStatement;
|
|
267
|
-
readonly range: Range;
|
|
260
|
+
readonly range: Range | undefined;
|
|
268
261
|
getLeadingTrivia(): Token[];
|
|
269
|
-
transpile(state: BrsTranspileState):
|
|
262
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
270
263
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
271
264
|
}
|
|
272
265
|
export declare class ReturnStatement extends Statement {
|
|
@@ -279,9 +272,10 @@ export declare class ReturnStatement extends Statement {
|
|
|
279
272
|
};
|
|
280
273
|
readonly value?: Expression;
|
|
281
274
|
readonly kind = AstNodeKind.ReturnStatement;
|
|
282
|
-
readonly range: Range;
|
|
283
|
-
transpile(state: BrsTranspileState):
|
|
275
|
+
readonly range: Range | undefined;
|
|
276
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
284
277
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
278
|
+
getLeadingTrivia(): Token[];
|
|
285
279
|
}
|
|
286
280
|
export declare class EndStatement extends Statement {
|
|
287
281
|
constructor(options?: {
|
|
@@ -292,8 +286,9 @@ export declare class EndStatement extends Statement {
|
|
|
292
286
|
};
|
|
293
287
|
readonly kind = AstNodeKind.EndStatement;
|
|
294
288
|
readonly range: Range;
|
|
295
|
-
transpile(state: BrsTranspileState):
|
|
289
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
296
290
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
291
|
+
getLeadingTrivia(): Token[];
|
|
297
292
|
}
|
|
298
293
|
export declare class StopStatement extends Statement {
|
|
299
294
|
constructor(options?: {
|
|
@@ -304,8 +299,9 @@ export declare class StopStatement extends Statement {
|
|
|
304
299
|
};
|
|
305
300
|
readonly kind = AstNodeKind.StopStatement;
|
|
306
301
|
readonly range: Range;
|
|
307
|
-
transpile(state: BrsTranspileState):
|
|
302
|
+
transpile(state: BrsTranspileState): TranspileResult[];
|
|
308
303
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
304
|
+
getLeadingTrivia(): Token[];
|
|
309
305
|
}
|
|
310
306
|
export declare class ForStatement extends Statement {
|
|
311
307
|
constructor(options: {
|
|
@@ -329,9 +325,10 @@ export declare class ForStatement extends Statement {
|
|
|
329
325
|
readonly body: Block;
|
|
330
326
|
readonly increment?: Expression;
|
|
331
327
|
readonly kind = AstNodeKind.ForStatement;
|
|
332
|
-
readonly range: Range;
|
|
333
|
-
transpile(state: BrsTranspileState):
|
|
328
|
+
readonly range: Range | undefined;
|
|
329
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
334
330
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
331
|
+
getLeadingTrivia(): Token[];
|
|
335
332
|
}
|
|
336
333
|
export declare class ForEachStatement extends Statement {
|
|
337
334
|
constructor(options: {
|
|
@@ -351,9 +348,11 @@ export declare class ForEachStatement extends Statement {
|
|
|
351
348
|
readonly body: Block;
|
|
352
349
|
readonly target: Expression;
|
|
353
350
|
readonly kind = AstNodeKind.ForEachStatement;
|
|
354
|
-
readonly range: Range;
|
|
355
|
-
transpile(state: BrsTranspileState):
|
|
351
|
+
readonly range: Range | undefined;
|
|
352
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
356
353
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
354
|
+
getType(options: GetTypeOptions): BscType;
|
|
355
|
+
getLeadingTrivia(): Token[];
|
|
357
356
|
}
|
|
358
357
|
export declare class WhileStatement extends Statement {
|
|
359
358
|
constructor(options: {
|
|
@@ -369,9 +368,10 @@ export declare class WhileStatement extends Statement {
|
|
|
369
368
|
readonly condition: Expression;
|
|
370
369
|
readonly body: Block;
|
|
371
370
|
readonly kind = AstNodeKind.WhileStatement;
|
|
372
|
-
readonly range: Range;
|
|
373
|
-
transpile(state: BrsTranspileState):
|
|
371
|
+
readonly range: Range | undefined;
|
|
372
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
374
373
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
374
|
+
getLeadingTrivia(): Token[];
|
|
375
375
|
}
|
|
376
376
|
export declare class DottedSetStatement extends Statement {
|
|
377
377
|
constructor(options: {
|
|
@@ -387,10 +387,11 @@ export declare class DottedSetStatement extends Statement {
|
|
|
387
387
|
readonly obj: Expression;
|
|
388
388
|
readonly value: Expression;
|
|
389
389
|
readonly kind = AstNodeKind.DottedSetStatement;
|
|
390
|
-
readonly range: Range;
|
|
390
|
+
readonly range: Range | undefined;
|
|
391
391
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
392
392
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
393
393
|
getType(options: GetTypeOptions): BscType;
|
|
394
|
+
getLeadingTrivia(): Token[];
|
|
394
395
|
}
|
|
395
396
|
export declare class IndexedSetStatement extends Statement {
|
|
396
397
|
constructor(options: {
|
|
@@ -408,9 +409,10 @@ export declare class IndexedSetStatement extends Statement {
|
|
|
408
409
|
readonly indexes: Expression[];
|
|
409
410
|
readonly value: Expression;
|
|
410
411
|
readonly kind = AstNodeKind.IndexedSetStatement;
|
|
411
|
-
readonly range: Range;
|
|
412
|
+
readonly range: Range | undefined;
|
|
412
413
|
transpile(state: BrsTranspileState): any[];
|
|
413
414
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
415
|
+
getLeadingTrivia(): Token[];
|
|
414
416
|
}
|
|
415
417
|
export declare class LibraryStatement extends Statement implements TypedefProvider {
|
|
416
418
|
constructor(options: {
|
|
@@ -422,10 +424,11 @@ export declare class LibraryStatement extends Statement implements TypedefProvid
|
|
|
422
424
|
readonly filePath?: Token;
|
|
423
425
|
};
|
|
424
426
|
readonly kind = AstNodeKind.LibraryStatement;
|
|
425
|
-
readonly range: Range;
|
|
426
|
-
transpile(state: BrsTranspileState):
|
|
427
|
-
getTypedef(state: BrsTranspileState):
|
|
427
|
+
readonly range: Range | undefined;
|
|
428
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
429
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
428
430
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
431
|
+
getLeadingTrivia(): Token[];
|
|
429
432
|
}
|
|
430
433
|
export declare class NamespaceStatement extends Statement implements TypedefProvider {
|
|
431
434
|
constructor(options: {
|
|
@@ -452,14 +455,14 @@ export declare class NamespaceStatement extends Statement implements TypedefProv
|
|
|
452
455
|
getLeadingTrivia(): Token[];
|
|
453
456
|
getNameParts(): Identifier[];
|
|
454
457
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
455
|
-
getTypedef(state: BrsTranspileState):
|
|
458
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
456
459
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
457
460
|
getType(options: GetTypeOptions): NamespaceType;
|
|
458
461
|
}
|
|
459
462
|
export declare class ImportStatement extends Statement implements TypedefProvider {
|
|
460
463
|
constructor(options: {
|
|
461
464
|
import?: Token;
|
|
462
|
-
path
|
|
465
|
+
path?: Token;
|
|
463
466
|
});
|
|
464
467
|
readonly tokens: {
|
|
465
468
|
readonly import?: Token;
|
|
@@ -468,12 +471,13 @@ export declare class ImportStatement extends Statement implements TypedefProvide
|
|
|
468
471
|
readonly kind = AstNodeKind.ImportStatement;
|
|
469
472
|
readonly range: Range;
|
|
470
473
|
readonly filePath: string;
|
|
471
|
-
transpile(state: BrsTranspileState): (string |
|
|
474
|
+
transpile(state: BrsTranspileState): (string | TranspileResult)[];
|
|
472
475
|
/**
|
|
473
476
|
* Get the typedef for this statement
|
|
474
477
|
*/
|
|
475
478
|
getTypedef(state: BrsTranspileState): string[];
|
|
476
479
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
480
|
+
getLeadingTrivia(): Token[];
|
|
477
481
|
}
|
|
478
482
|
export declare class InterfaceStatement extends Statement implements TypedefProvider {
|
|
479
483
|
constructor(options: {
|
|
@@ -493,7 +497,7 @@ export declare class InterfaceStatement extends Statement implements TypedefProv
|
|
|
493
497
|
readonly extends?: Token;
|
|
494
498
|
readonly endInterface?: Token;
|
|
495
499
|
};
|
|
496
|
-
readonly range: Range;
|
|
500
|
+
readonly range: Range | undefined;
|
|
497
501
|
get fields(): InterfaceFieldStatement[];
|
|
498
502
|
get methods(): InterfaceMethodStatement[];
|
|
499
503
|
hasParentInterface(): boolean;
|
|
@@ -525,7 +529,7 @@ export declare class InterfaceFieldStatement extends Statement implements Typede
|
|
|
525
529
|
});
|
|
526
530
|
readonly kind = AstNodeKind.InterfaceFieldStatement;
|
|
527
531
|
readonly typeExpression?: TypeExpression;
|
|
528
|
-
readonly range: Range;
|
|
532
|
+
readonly range: Range | undefined;
|
|
529
533
|
readonly tokens: {
|
|
530
534
|
readonly name: Identifier;
|
|
531
535
|
readonly as: Token;
|
|
@@ -535,7 +539,7 @@ export declare class InterfaceFieldStatement extends Statement implements Typede
|
|
|
535
539
|
get name(): string;
|
|
536
540
|
get isOptional(): boolean;
|
|
537
541
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
538
|
-
getTypedef(state: BrsTranspileState):
|
|
542
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
539
543
|
getType(options: GetTypeOptions): BscType;
|
|
540
544
|
}
|
|
541
545
|
export declare class InterfaceMethodStatement extends Statement implements TypedefProvider {
|
|
@@ -601,8 +605,8 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
601
605
|
readonly memberMap: Record<string, MemberStatement>;
|
|
602
606
|
readonly methods: MethodStatement[];
|
|
603
607
|
readonly fields: FieldStatement[];
|
|
604
|
-
readonly range: Range;
|
|
605
|
-
transpile(state: BrsTranspileState):
|
|
608
|
+
readonly range: Range | undefined;
|
|
609
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
606
610
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
607
611
|
/**
|
|
608
612
|
* Find the parent index for this class's parent.
|
|
@@ -655,14 +659,14 @@ export declare class MethodStatement extends FunctionStatement {
|
|
|
655
659
|
readonly override?: Token;
|
|
656
660
|
};
|
|
657
661
|
get accessModifier(): Token;
|
|
658
|
-
readonly range: Range;
|
|
662
|
+
readonly range: Range | undefined;
|
|
659
663
|
/**
|
|
660
664
|
* Get the name of this method.
|
|
661
665
|
*/
|
|
662
666
|
getName(parseMode: ParseMode): string;
|
|
663
667
|
getLeadingTrivia(): Token[];
|
|
664
|
-
transpile(state: BrsTranspileState):
|
|
665
|
-
getTypedef(state: BrsTranspileState):
|
|
668
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
669
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
666
670
|
/**
|
|
667
671
|
* All child classes must call the parent constructor. The type checker will warn users when they don't call it in their own class,
|
|
668
672
|
* but we still need to call it even if they have omitted it. This injects the super call if it's missing
|
|
@@ -699,7 +703,7 @@ export declare class FieldStatement extends Statement implements TypedefProvider
|
|
|
699
703
|
* Defaults to `DynamicType`
|
|
700
704
|
*/
|
|
701
705
|
getType(options: GetTypeOptions): BscType;
|
|
702
|
-
readonly range: Range;
|
|
706
|
+
readonly range: Range | undefined;
|
|
703
707
|
getLeadingTrivia(): Token[];
|
|
704
708
|
get isOptional(): boolean;
|
|
705
709
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
@@ -721,9 +725,10 @@ export declare class TryCatchStatement extends Statement {
|
|
|
721
725
|
readonly tryBranch: Block;
|
|
722
726
|
readonly catchStatement: CatchStatement;
|
|
723
727
|
readonly kind = AstNodeKind.TryCatchStatement;
|
|
724
|
-
readonly range: Range;
|
|
728
|
+
readonly range: Range | undefined;
|
|
725
729
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
726
730
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
731
|
+
getLeadingTrivia(): Token[];
|
|
727
732
|
}
|
|
728
733
|
export declare class CatchStatement extends Statement {
|
|
729
734
|
constructor(options?: {
|
|
@@ -737,9 +742,10 @@ export declare class CatchStatement extends Statement {
|
|
|
737
742
|
};
|
|
738
743
|
readonly catchBranch?: Block;
|
|
739
744
|
readonly kind = AstNodeKind.CatchStatement;
|
|
740
|
-
readonly range: Range;
|
|
745
|
+
readonly range: Range | undefined;
|
|
741
746
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
742
747
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
748
|
+
getLeadingTrivia(): Token[];
|
|
743
749
|
}
|
|
744
750
|
export declare class ThrowStatement extends Statement {
|
|
745
751
|
constructor(options?: {
|
|
@@ -751,25 +757,26 @@ export declare class ThrowStatement extends Statement {
|
|
|
751
757
|
};
|
|
752
758
|
readonly expression?: Expression;
|
|
753
759
|
readonly kind = AstNodeKind.ThrowStatement;
|
|
754
|
-
readonly range: Range;
|
|
755
|
-
transpile(state: BrsTranspileState):
|
|
760
|
+
readonly range: Range | undefined;
|
|
761
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
756
762
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
763
|
+
getLeadingTrivia(): Token[];
|
|
757
764
|
}
|
|
758
765
|
export declare class EnumStatement extends Statement implements TypedefProvider {
|
|
759
766
|
constructor(options: {
|
|
760
767
|
enum?: Token;
|
|
761
768
|
name: Identifier;
|
|
762
769
|
endEnum?: Token;
|
|
763
|
-
body: Array<EnumMemberStatement
|
|
770
|
+
body: Array<EnumMemberStatement>;
|
|
764
771
|
});
|
|
765
772
|
readonly tokens: {
|
|
766
773
|
readonly enum?: Token;
|
|
767
774
|
readonly name: Identifier;
|
|
768
775
|
readonly endEnum?: Token;
|
|
769
776
|
};
|
|
770
|
-
readonly body: Array<EnumMemberStatement
|
|
777
|
+
readonly body: Array<EnumMemberStatement>;
|
|
771
778
|
readonly kind = AstNodeKind.EnumStatement;
|
|
772
|
-
get range(): Range;
|
|
779
|
+
get range(): Range | undefined;
|
|
773
780
|
getMembers(): EnumMemberStatement[];
|
|
774
781
|
getLeadingTrivia(): Token[];
|
|
775
782
|
/**
|
|
@@ -810,7 +817,7 @@ export declare class EnumMemberStatement extends Statement implements TypedefPro
|
|
|
810
817
|
get name(): string;
|
|
811
818
|
getLeadingTrivia(): Token[];
|
|
812
819
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
813
|
-
getTypedef(state: BrsTranspileState):
|
|
820
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
814
821
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
815
822
|
getType(options: GetTypeOptions): EnumMemberType;
|
|
816
823
|
}
|
|
@@ -828,7 +835,7 @@ export declare class ConstStatement extends Statement implements TypedefProvider
|
|
|
828
835
|
};
|
|
829
836
|
readonly value: Expression;
|
|
830
837
|
readonly kind = AstNodeKind.ConstStatement;
|
|
831
|
-
readonly range: Range;
|
|
838
|
+
readonly range: Range | undefined;
|
|
832
839
|
get name(): string;
|
|
833
840
|
getLeadingTrivia(): Token[];
|
|
834
841
|
/**
|
|
@@ -836,7 +843,7 @@ export declare class ConstStatement extends Statement implements TypedefProvider
|
|
|
836
843
|
*/
|
|
837
844
|
get fullName(): string;
|
|
838
845
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
839
|
-
getTypedef(state: BrsTranspileState):
|
|
846
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
840
847
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
841
848
|
getType(options: GetTypeOptions): BscType;
|
|
842
849
|
}
|
|
@@ -850,7 +857,8 @@ export declare class ContinueStatement extends Statement {
|
|
|
850
857
|
readonly loopType: Token;
|
|
851
858
|
};
|
|
852
859
|
readonly kind = AstNodeKind.ContinueStatement;
|
|
853
|
-
readonly range: Range;
|
|
854
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
860
|
+
readonly range: Range | undefined;
|
|
861
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
855
862
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
863
|
+
getLeadingTrivia(): Token[];
|
|
856
864
|
}
|