brighterscript 1.0.0-alpha.26 → 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 +82 -5
- package/README.md +1 -1
- package/dist/AstValidationSegmenter.d.ts +1 -1
- package/dist/AstValidationSegmenter.js +4 -5
- 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 -3
- package/dist/DiagnosticMessages.js +5 -8
- package/dist/DiagnosticMessages.js.map +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 +34 -31
- package/dist/Program.js.map +1 -1
- package/dist/Scope.d.ts +7 -34
- package/dist/Scope.js +45 -305
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +1 -8
- package/dist/SymbolTable.js +1 -10
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTypeFlag.d.ts +8 -0
- package/dist/SymbolTypeFlag.js +13 -0
- package/dist/SymbolTypeFlag.js.map +1 -0
- package/dist/XmlScope.d.ts +0 -8
- package/dist/XmlScope.js +6 -84
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +1 -2
- package/dist/astUtils/CachedLookups.js +4 -19
- package/dist/astUtils/CachedLookups.js.map +1 -1
- package/dist/astUtils/creators.d.ts +1 -0
- package/dist/astUtils/creators.js +48 -8
- 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 +3 -2
- package/dist/astUtils/reflection.js +11 -7
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +11 -16
- 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 +46 -29
- 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.d.ts +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +30 -10
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +125 -7
- 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/semanticTokens/BrsFileSemanticTokensProcessor.js +2 -3
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +25 -31
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +34 -1
- package/dist/bscPlugin/validation/ScopeValidator.js +435 -27
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +178 -10
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +1 -1
- package/dist/files/BrsFile.Class.spec.js +15 -7
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +14 -5
- package/dist/files/BrsFile.js +83 -150
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +429 -162
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +2 -3
- package/dist/files/XmlFile.js +1 -3
- 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 +117 -85
- package/dist/interfaces.js +9 -9
- 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 +153 -135
- package/dist/parser/Expression.js +204 -114
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +15 -16
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +8 -4
- package/dist/parser/Parser.js +108 -149
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +48 -72
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.js +49 -35
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +36 -24
- package/dist/parser/SGTypes.js +31 -60
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +214 -207
- package/dist/parser/Statement.js +248 -169
- 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/expression/TypeExpression.spec.js +8 -9
- package/dist/parser/tests/expression/TypeExpression.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/parser/tests/statement/TryCatch.spec.js +9 -2
- package/dist/parser/tests/statement/TryCatch.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/roku-types/data.json +70 -52
- package/dist/roku-types/index.d.ts +43 -21
- package/dist/types/ArrayType.js +1 -2
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +7 -8
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +3 -0
- package/dist/types/AssociativeArrayType.js +10 -2
- package/dist/types/AssociativeArrayType.js.map +1 -1
- package/dist/types/BscType.d.ts +1 -1
- package/dist/types/BscType.js +3 -3
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.js +7 -8
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.spec.js +31 -32
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -1
- package/dist/types/ClassType.spec.js +10 -11
- package/dist/types/ClassType.spec.js.map +1 -1
- package/dist/types/ComponentType.d.ts +2 -1
- package/dist/types/ComponentType.js.map +1 -1
- package/dist/types/EnumType.js +2 -3
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/InheritableType.js +3 -4
- package/dist/types/InheritableType.js.map +1 -1
- package/dist/types/InterfaceType.js +2 -3
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +3 -4
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/ObjectType.js +1 -2
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +1 -1
- package/dist/types/ReferenceType.spec.js +21 -22
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/types/UnionType.js +3 -3
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/UnionType.spec.js +37 -38
- package/dist/types/UnionType.spec.js.map +1 -1
- package/dist/types/helper.spec.js +4 -5
- package/dist/types/helper.spec.js.map +1 -1
- package/dist/util.d.ts +21 -11
- package/dist/util.js +116 -37
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -9
- package/dist/validators/ClassValidator.js +3 -46
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +6 -3
|
@@ -7,8 +7,7 @@ import type { BrsTranspileState } from './BrsTranspileState';
|
|
|
7
7
|
import { ParseMode } from './Parser';
|
|
8
8
|
import type { WalkVisitor, WalkOptions } from '../astUtils/visitors';
|
|
9
9
|
import { type GetTypeOptions, type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
10
|
-
import type {
|
|
11
|
-
import type { TranspileState } from './TranspileState';
|
|
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
|
-
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;
|
|
@@ -38,12 +36,12 @@ export declare class Body extends Statement implements TypedefProvider {
|
|
|
38
36
|
constructor(options?: {
|
|
39
37
|
statements?: Statement[];
|
|
40
38
|
});
|
|
41
|
-
statements: Statement[];
|
|
39
|
+
readonly statements: Statement[];
|
|
42
40
|
readonly kind = AstNodeKind.Body;
|
|
43
|
-
symbolTable: SymbolTable;
|
|
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 {
|
|
@@ -54,28 +52,29 @@ export declare class AssignmentStatement extends Statement {
|
|
|
54
52
|
as?: Token;
|
|
55
53
|
typeExpression?: TypeExpression;
|
|
56
54
|
});
|
|
57
|
-
tokens: {
|
|
58
|
-
equals?: Token;
|
|
59
|
-
name: Identifier;
|
|
60
|
-
as?: Token;
|
|
55
|
+
readonly tokens: {
|
|
56
|
+
readonly equals?: Token;
|
|
57
|
+
readonly name: Identifier;
|
|
58
|
+
readonly as?: Token;
|
|
61
59
|
};
|
|
62
|
-
value: Expression;
|
|
63
|
-
typeExpression
|
|
60
|
+
readonly value: Expression;
|
|
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,66 +84,55 @@ 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
|
-
tokens: {
|
|
97
|
-
comments: Token[];
|
|
98
|
-
};
|
|
99
|
-
readonly kind = AstNodeKind.CommentStatement;
|
|
100
|
-
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?: {
|
|
108
94
|
exitFor?: Token;
|
|
109
95
|
});
|
|
110
96
|
readonly tokens: {
|
|
111
|
-
exitFor?: Token;
|
|
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?: {
|
|
120
107
|
exitWhile?: Token;
|
|
121
108
|
});
|
|
122
109
|
readonly tokens: {
|
|
123
|
-
exitWhile?: Token;
|
|
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: {
|
|
132
120
|
name: Identifier;
|
|
133
121
|
func: FunctionExpression;
|
|
134
122
|
});
|
|
135
|
-
tokens: {
|
|
136
|
-
name: Identifier;
|
|
123
|
+
readonly tokens: {
|
|
124
|
+
readonly name: Identifier;
|
|
137
125
|
};
|
|
138
|
-
func: FunctionExpression;
|
|
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
|
}
|
|
@@ -160,19 +148,20 @@ export declare class IfStatement extends Statement {
|
|
|
160
148
|
isInline?: boolean;
|
|
161
149
|
});
|
|
162
150
|
readonly tokens: {
|
|
163
|
-
if?: Token;
|
|
164
|
-
then?: Token;
|
|
165
|
-
else?: Token;
|
|
166
|
-
endIf?: Token;
|
|
151
|
+
readonly if?: Token;
|
|
152
|
+
readonly then?: Token;
|
|
153
|
+
readonly else?: Token;
|
|
154
|
+
readonly endIf?: Token;
|
|
167
155
|
};
|
|
168
156
|
readonly condition: Expression;
|
|
169
157
|
readonly thenBranch: Block;
|
|
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: {
|
|
@@ -181,12 +170,13 @@ export declare class IncrementStatement extends Statement {
|
|
|
181
170
|
});
|
|
182
171
|
readonly value: Expression;
|
|
183
172
|
readonly tokens: {
|
|
184
|
-
operator: Token;
|
|
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 {
|
|
@@ -211,13 +201,14 @@ export declare class PrintStatement extends Statement {
|
|
|
211
201
|
expressions: Array<Expression | PrintSeparatorTab | PrintSeparatorSpace>;
|
|
212
202
|
});
|
|
213
203
|
readonly tokens: {
|
|
214
|
-
print: Token;
|
|
204
|
+
readonly print: Token;
|
|
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: {
|
|
@@ -228,17 +219,18 @@ export declare class DimStatement extends Statement {
|
|
|
228
219
|
closingSquare?: Token;
|
|
229
220
|
});
|
|
230
221
|
readonly tokens: {
|
|
231
|
-
dim?: Token;
|
|
232
|
-
name: Identifier;
|
|
233
|
-
openingSquare?: Token;
|
|
234
|
-
closingSquare?: Token;
|
|
222
|
+
readonly dim?: Token;
|
|
223
|
+
readonly name: Identifier;
|
|
224
|
+
readonly openingSquare?: Token;
|
|
225
|
+
readonly closingSquare?: Token;
|
|
235
226
|
};
|
|
236
|
-
dimensions: Expression[];
|
|
227
|
+
readonly dimensions: Expression[];
|
|
237
228
|
readonly kind = AstNodeKind.DimStatement;
|
|
238
|
-
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: {
|
|
@@ -246,13 +238,14 @@ export declare class GotoStatement extends Statement {
|
|
|
246
238
|
label: Token;
|
|
247
239
|
});
|
|
248
240
|
readonly tokens: {
|
|
249
|
-
goto?: Token;
|
|
250
|
-
label: Token;
|
|
241
|
+
readonly goto?: Token;
|
|
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: {
|
|
@@ -260,13 +253,13 @@ export declare class LabelStatement extends Statement {
|
|
|
260
253
|
colon?: Token;
|
|
261
254
|
});
|
|
262
255
|
readonly tokens: {
|
|
263
|
-
name: Token;
|
|
264
|
-
colon: Token;
|
|
256
|
+
readonly name: Token;
|
|
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 {
|
|
@@ -275,37 +268,40 @@ export declare class ReturnStatement extends Statement {
|
|
|
275
268
|
value?: Expression;
|
|
276
269
|
});
|
|
277
270
|
readonly tokens: {
|
|
278
|
-
return
|
|
271
|
+
readonly return?: Token;
|
|
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?: {
|
|
288
282
|
end?: Token;
|
|
289
283
|
});
|
|
290
284
|
readonly tokens: {
|
|
291
|
-
end?: Token;
|
|
285
|
+
readonly end?: Token;
|
|
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?: {
|
|
300
295
|
stop?: Token;
|
|
301
296
|
});
|
|
302
297
|
readonly tokens: {
|
|
303
|
-
stop?: Token;
|
|
298
|
+
readonly stop?: Token;
|
|
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: {
|
|
@@ -319,19 +315,20 @@ export declare class ForStatement extends Statement {
|
|
|
319
315
|
increment?: Expression;
|
|
320
316
|
});
|
|
321
317
|
readonly tokens: {
|
|
322
|
-
for?: Token;
|
|
323
|
-
to?: Token;
|
|
324
|
-
endFor?: Token;
|
|
325
|
-
step?: Token;
|
|
318
|
+
readonly for?: Token;
|
|
319
|
+
readonly to?: Token;
|
|
320
|
+
readonly endFor?: Token;
|
|
321
|
+
readonly step?: Token;
|
|
326
322
|
};
|
|
327
|
-
counterDeclaration: AssignmentStatement;
|
|
328
|
-
finalValue: Expression;
|
|
329
|
-
body: Block;
|
|
330
|
-
increment?: Expression;
|
|
323
|
+
readonly counterDeclaration: AssignmentStatement;
|
|
324
|
+
readonly finalValue: Expression;
|
|
325
|
+
readonly body: Block;
|
|
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: {
|
|
@@ -343,17 +340,19 @@ export declare class ForEachStatement extends Statement {
|
|
|
343
340
|
endFor?: Token;
|
|
344
341
|
});
|
|
345
342
|
readonly tokens: {
|
|
346
|
-
forEach?: Token;
|
|
347
|
-
item: Token;
|
|
348
|
-
in?: Token;
|
|
349
|
-
endFor?: Token;
|
|
343
|
+
readonly forEach?: Token;
|
|
344
|
+
readonly item: Token;
|
|
345
|
+
readonly in?: Token;
|
|
346
|
+
readonly endFor?: Token;
|
|
350
347
|
};
|
|
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: {
|
|
@@ -363,15 +362,16 @@ export declare class WhileStatement extends Statement {
|
|
|
363
362
|
body: Block;
|
|
364
363
|
});
|
|
365
364
|
readonly tokens: {
|
|
366
|
-
while?: Token;
|
|
367
|
-
endWhile?: Token;
|
|
365
|
+
readonly while?: Token;
|
|
366
|
+
readonly endWhile?: Token;
|
|
368
367
|
};
|
|
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: {
|
|
@@ -381,16 +381,17 @@ export declare class DottedSetStatement extends Statement {
|
|
|
381
381
|
dot?: Token;
|
|
382
382
|
});
|
|
383
383
|
readonly tokens: {
|
|
384
|
-
name: Identifier;
|
|
385
|
-
dot?: Token;
|
|
384
|
+
readonly name: Identifier;
|
|
385
|
+
readonly dot?: Token;
|
|
386
386
|
};
|
|
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: {
|
|
@@ -401,16 +402,17 @@ export declare class IndexedSetStatement extends Statement {
|
|
|
401
402
|
closingSquare?: Token;
|
|
402
403
|
});
|
|
403
404
|
readonly tokens: {
|
|
404
|
-
openingSquare?: Token;
|
|
405
|
-
closingSquare?: Token;
|
|
405
|
+
readonly openingSquare?: Token;
|
|
406
|
+
readonly closingSquare?: Token;
|
|
406
407
|
};
|
|
407
408
|
readonly obj: Expression;
|
|
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: {
|
|
@@ -418,14 +420,15 @@ export declare class LibraryStatement extends Statement implements TypedefProvid
|
|
|
418
420
|
filePath?: Token;
|
|
419
421
|
});
|
|
420
422
|
readonly tokens: {
|
|
421
|
-
library: Token;
|
|
422
|
-
filePath?: Token;
|
|
423
|
+
readonly library: Token;
|
|
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: {
|
|
@@ -435,11 +438,11 @@ export declare class NamespaceStatement extends Statement implements TypedefProv
|
|
|
435
438
|
endNamespace?: Token;
|
|
436
439
|
});
|
|
437
440
|
readonly tokens: {
|
|
438
|
-
namespace?: Token;
|
|
439
|
-
endNamespace?: Token;
|
|
441
|
+
readonly namespace?: Token;
|
|
442
|
+
readonly endNamespace?: Token;
|
|
440
443
|
};
|
|
441
444
|
readonly nameExpression: VariableExpression | DottedGetExpression;
|
|
442
|
-
body: Body;
|
|
445
|
+
readonly body: Body;
|
|
443
446
|
readonly kind = AstNodeKind.NamespaceStatement;
|
|
444
447
|
/**
|
|
445
448
|
* The string name for this namespace
|
|
@@ -452,28 +455,29 @@ 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
|
-
|
|
465
|
+
path?: Token;
|
|
463
466
|
});
|
|
464
467
|
readonly tokens: {
|
|
465
|
-
import?: Token;
|
|
466
|
-
|
|
468
|
+
readonly import?: Token;
|
|
469
|
+
readonly path: Token;
|
|
467
470
|
};
|
|
468
471
|
readonly kind = AstNodeKind.ImportStatement;
|
|
469
|
-
range: Range;
|
|
470
|
-
filePath: string;
|
|
471
|
-
transpile(state: BrsTranspileState): (string |
|
|
472
|
+
readonly range: Range;
|
|
473
|
+
readonly filePath: 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: {
|
|
@@ -484,16 +488,16 @@ export declare class InterfaceStatement extends Statement implements TypedefProv
|
|
|
484
488
|
body: Statement[];
|
|
485
489
|
endInterface?: Token;
|
|
486
490
|
});
|
|
487
|
-
parentInterfaceName?: TypeExpression;
|
|
488
|
-
body: Statement[];
|
|
491
|
+
readonly parentInterfaceName?: TypeExpression;
|
|
492
|
+
readonly body: Statement[];
|
|
489
493
|
readonly kind = AstNodeKind.InterfaceStatement;
|
|
490
|
-
tokens: {
|
|
491
|
-
interface?: Token;
|
|
492
|
-
name: Identifier;
|
|
493
|
-
extends?: Token;
|
|
494
|
-
endInterface?: Token;
|
|
494
|
+
readonly tokens: {
|
|
495
|
+
readonly interface?: Token;
|
|
496
|
+
readonly name: Identifier;
|
|
497
|
+
readonly extends?: Token;
|
|
498
|
+
readonly endInterface?: Token;
|
|
495
499
|
};
|
|
496
|
-
range: Range;
|
|
500
|
+
readonly range: Range | undefined;
|
|
497
501
|
get fields(): InterfaceFieldStatement[];
|
|
498
502
|
get methods(): InterfaceMethodStatement[];
|
|
499
503
|
hasParentInterface(): boolean;
|
|
@@ -524,18 +528,18 @@ export declare class InterfaceFieldStatement extends Statement implements Typede
|
|
|
524
528
|
optional?: Token;
|
|
525
529
|
});
|
|
526
530
|
readonly kind = AstNodeKind.InterfaceFieldStatement;
|
|
527
|
-
typeExpression?: TypeExpression;
|
|
528
|
-
range: Range;
|
|
529
|
-
tokens: {
|
|
530
|
-
name: Identifier;
|
|
531
|
-
as: Token;
|
|
532
|
-
optional?: Token;
|
|
531
|
+
readonly typeExpression?: TypeExpression;
|
|
532
|
+
readonly range: Range | undefined;
|
|
533
|
+
readonly tokens: {
|
|
534
|
+
readonly name: Identifier;
|
|
535
|
+
readonly as: Token;
|
|
536
|
+
readonly optional?: Token;
|
|
533
537
|
};
|
|
534
538
|
getLeadingTrivia(): Token[];
|
|
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 {
|
|
@@ -556,16 +560,16 @@ export declare class InterfaceMethodStatement extends Statement implements Typed
|
|
|
556
560
|
* Get the name of this method.
|
|
557
561
|
*/
|
|
558
562
|
getName(parseMode: ParseMode): string;
|
|
559
|
-
tokens: {
|
|
560
|
-
optional?: Token;
|
|
561
|
-
functionType: Token;
|
|
562
|
-
name: Identifier;
|
|
563
|
-
leftParen?: Token;
|
|
564
|
-
rightParen?: Token;
|
|
565
|
-
as?: Token;
|
|
566
|
-
};
|
|
567
|
-
params: FunctionParameterExpression[];
|
|
568
|
-
returnTypeExpression?: TypeExpression;
|
|
563
|
+
readonly tokens: {
|
|
564
|
+
readonly optional?: Token;
|
|
565
|
+
readonly functionType: Token;
|
|
566
|
+
readonly name: Identifier;
|
|
567
|
+
readonly leftParen?: Token;
|
|
568
|
+
readonly rightParen?: Token;
|
|
569
|
+
readonly as?: Token;
|
|
570
|
+
};
|
|
571
|
+
readonly params: FunctionParameterExpression[];
|
|
572
|
+
readonly returnTypeExpression?: TypeExpression;
|
|
569
573
|
get isOptional(): boolean;
|
|
570
574
|
getLeadingTrivia(): Token[];
|
|
571
575
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -585,24 +589,24 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
585
589
|
parentClassName?: TypeExpression;
|
|
586
590
|
});
|
|
587
591
|
readonly kind = AstNodeKind.ClassStatement;
|
|
588
|
-
tokens: {
|
|
589
|
-
class?: Token;
|
|
592
|
+
readonly tokens: {
|
|
593
|
+
readonly class?: Token;
|
|
590
594
|
/**
|
|
591
595
|
* The name of the class (without namespace prefix)
|
|
592
596
|
*/
|
|
593
|
-
name: Identifier;
|
|
594
|
-
endClass?: Token;
|
|
595
|
-
extends?: Token;
|
|
597
|
+
readonly name: Identifier;
|
|
598
|
+
readonly endClass?: Token;
|
|
599
|
+
readonly extends?: Token;
|
|
596
600
|
};
|
|
597
601
|
readonly body: Statement[];
|
|
598
602
|
readonly parentClassName: TypeExpression;
|
|
599
603
|
getName(parseMode: ParseMode): string;
|
|
600
604
|
getLeadingTrivia(): Token[];
|
|
601
|
-
memberMap: Record<string, MemberStatement>;
|
|
602
|
-
methods: MethodStatement[];
|
|
603
|
-
fields: FieldStatement[];
|
|
604
|
-
readonly range: Range;
|
|
605
|
-
transpile(state: BrsTranspileState):
|
|
605
|
+
readonly memberMap: Record<string, MemberStatement>;
|
|
606
|
+
readonly methods: MethodStatement[];
|
|
607
|
+
readonly fields: FieldStatement[];
|
|
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.
|
|
@@ -649,20 +653,20 @@ export declare class MethodStatement extends FunctionStatement {
|
|
|
649
653
|
override?: Token;
|
|
650
654
|
});
|
|
651
655
|
readonly kind: AstNodeKind;
|
|
652
|
-
modifiers: Token[];
|
|
656
|
+
readonly modifiers: Token[];
|
|
653
657
|
readonly tokens: {
|
|
654
|
-
name: Identifier;
|
|
655
|
-
override?: Token;
|
|
658
|
+
readonly name: Identifier;
|
|
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
|
|
@@ -685,21 +689,21 @@ export declare class FieldStatement extends Statement implements TypedefProvider
|
|
|
685
689
|
optional?: Token;
|
|
686
690
|
});
|
|
687
691
|
readonly tokens: {
|
|
688
|
-
accessModifier?: Token;
|
|
689
|
-
name: Identifier;
|
|
690
|
-
as?: Token;
|
|
691
|
-
equals?: Token;
|
|
692
|
-
optional?: Token;
|
|
693
|
-
};
|
|
694
|
-
typeExpression?: TypeExpression;
|
|
695
|
-
initialValue?: Expression;
|
|
692
|
+
readonly accessModifier?: Token;
|
|
693
|
+
readonly name: Identifier;
|
|
694
|
+
readonly as?: Token;
|
|
695
|
+
readonly equals?: Token;
|
|
696
|
+
readonly optional?: Token;
|
|
697
|
+
};
|
|
698
|
+
readonly typeExpression?: TypeExpression;
|
|
699
|
+
readonly initialValue?: Expression;
|
|
696
700
|
readonly kind = AstNodeKind.FieldStatement;
|
|
697
701
|
/**
|
|
698
702
|
* Derive a ValueKind from the type token, or the initial value.
|
|
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;
|
|
@@ -715,15 +719,16 @@ export declare class TryCatchStatement extends Statement {
|
|
|
715
719
|
catchStatement?: CatchStatement;
|
|
716
720
|
});
|
|
717
721
|
readonly tokens: {
|
|
718
|
-
try?: Token;
|
|
719
|
-
endTry?: Token;
|
|
722
|
+
readonly try?: Token;
|
|
723
|
+
readonly endTry?: Token;
|
|
720
724
|
};
|
|
721
|
-
tryBranch: Block;
|
|
722
|
-
catchStatement: CatchStatement;
|
|
725
|
+
readonly tryBranch: Block;
|
|
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?: {
|
|
@@ -732,14 +737,15 @@ export declare class CatchStatement extends Statement {
|
|
|
732
737
|
catchBranch?: Block;
|
|
733
738
|
});
|
|
734
739
|
readonly tokens: {
|
|
735
|
-
catch?: Token;
|
|
736
|
-
exceptionVariable?: Identifier;
|
|
740
|
+
readonly catch?: Token;
|
|
741
|
+
readonly exceptionVariable?: Identifier;
|
|
737
742
|
};
|
|
738
|
-
catchBranch?: Block;
|
|
743
|
+
readonly catchBranch?: Block;
|
|
739
744
|
readonly kind = AstNodeKind.CatchStatement;
|
|
740
|
-
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?: {
|
|
@@ -747,30 +753,30 @@ export declare class ThrowStatement extends Statement {
|
|
|
747
753
|
expression?: Expression;
|
|
748
754
|
});
|
|
749
755
|
readonly tokens: {
|
|
750
|
-
throw?: Token;
|
|
756
|
+
readonly throw?: Token;
|
|
751
757
|
};
|
|
752
|
-
expression?: Expression;
|
|
758
|
+
readonly expression?: Expression;
|
|
753
759
|
readonly kind = AstNodeKind.ThrowStatement;
|
|
754
|
-
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
|
-
tokens: {
|
|
766
|
-
enum?: Token;
|
|
767
|
-
name: Identifier;
|
|
768
|
-
endEnum?: Token;
|
|
772
|
+
readonly tokens: {
|
|
773
|
+
readonly enum?: Token;
|
|
774
|
+
readonly name: Identifier;
|
|
775
|
+
readonly endEnum?: Token;
|
|
769
776
|
};
|
|
770
|
-
body: Array<EnumMemberStatement
|
|
777
|
+
readonly body: Array<EnumMemberStatement>;
|
|
771
778
|
readonly kind = AstNodeKind.EnumStatement;
|
|
772
|
-
|
|
773
|
-
get range(): Range;
|
|
779
|
+
get range(): Range | undefined;
|
|
774
780
|
getMembers(): EnumMemberStatement[];
|
|
775
781
|
getLeadingTrivia(): Token[];
|
|
776
782
|
/**
|
|
@@ -798,11 +804,11 @@ export declare class EnumMemberStatement extends Statement implements TypedefPro
|
|
|
798
804
|
equals?: Token;
|
|
799
805
|
value?: Expression;
|
|
800
806
|
});
|
|
801
|
-
tokens: {
|
|
802
|
-
name: Identifier;
|
|
803
|
-
equals?: Token;
|
|
807
|
+
readonly tokens: {
|
|
808
|
+
readonly name: Identifier;
|
|
809
|
+
readonly equals?: Token;
|
|
804
810
|
};
|
|
805
|
-
value?: Expression;
|
|
811
|
+
readonly value?: Expression;
|
|
806
812
|
readonly kind = AstNodeKind.EnumMemberStatement;
|
|
807
813
|
get range(): Range;
|
|
808
814
|
/**
|
|
@@ -811,7 +817,7 @@ export declare class EnumMemberStatement extends Statement implements TypedefPro
|
|
|
811
817
|
get name(): string;
|
|
812
818
|
getLeadingTrivia(): Token[];
|
|
813
819
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
814
|
-
getTypedef(state: BrsTranspileState):
|
|
820
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
815
821
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
816
822
|
getType(options: GetTypeOptions): EnumMemberType;
|
|
817
823
|
}
|
|
@@ -822,14 +828,14 @@ export declare class ConstStatement extends Statement implements TypedefProvider
|
|
|
822
828
|
equals?: Token;
|
|
823
829
|
value: Expression;
|
|
824
830
|
});
|
|
825
|
-
tokens: {
|
|
826
|
-
const: Token;
|
|
827
|
-
name: Identifier;
|
|
828
|
-
equals: Token;
|
|
831
|
+
readonly tokens: {
|
|
832
|
+
readonly const: Token;
|
|
833
|
+
readonly name: Identifier;
|
|
834
|
+
readonly equals: Token;
|
|
829
835
|
};
|
|
830
|
-
value: Expression;
|
|
836
|
+
readonly value: Expression;
|
|
831
837
|
readonly kind = AstNodeKind.ConstStatement;
|
|
832
|
-
range: Range;
|
|
838
|
+
readonly range: Range | undefined;
|
|
833
839
|
get name(): string;
|
|
834
840
|
getLeadingTrivia(): Token[];
|
|
835
841
|
/**
|
|
@@ -837,7 +843,7 @@ export declare class ConstStatement extends Statement implements TypedefProvider
|
|
|
837
843
|
*/
|
|
838
844
|
get fullName(): string;
|
|
839
845
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
840
|
-
getTypedef(state: BrsTranspileState):
|
|
846
|
+
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
841
847
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
842
848
|
getType(options: GetTypeOptions): BscType;
|
|
843
849
|
}
|
|
@@ -846,12 +852,13 @@ export declare class ContinueStatement extends Statement {
|
|
|
846
852
|
continue?: Token;
|
|
847
853
|
loopType: Token;
|
|
848
854
|
});
|
|
849
|
-
tokens: {
|
|
850
|
-
continue?: Token;
|
|
851
|
-
loopType: Token;
|
|
855
|
+
readonly tokens: {
|
|
856
|
+
readonly continue?: Token;
|
|
857
|
+
readonly loopType: Token;
|
|
852
858
|
};
|
|
853
859
|
readonly kind = AstNodeKind.ContinueStatement;
|
|
854
|
-
range: Range;
|
|
855
|
-
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
860
|
+
readonly range: Range | undefined;
|
|
861
|
+
transpile(state: BrsTranspileState): (string | import("source-map").SourceNode)[];
|
|
856
862
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
863
|
+
getLeadingTrivia(): Token[];
|
|
857
864
|
}
|