brighterscript 1.0.0-alpha.25 → 1.0.0-alpha.27
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 +44 -0
- package/bsconfig.schema.json +5 -0
- package/dist/AstValidationSegmenter.d.ts +1 -1
- package/dist/AstValidationSegmenter.js +6 -7
- package/dist/AstValidationSegmenter.js.map +1 -1
- package/dist/BsConfig.d.ts +1 -0
- package/dist/DiagnosticMessages.d.ts +1 -3
- package/dist/DiagnosticMessages.js +5 -8
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/Program.d.ts +1 -1
- package/dist/Program.js +40 -42
- package/dist/Program.js.map +1 -1
- package/dist/Scope.d.ts +2 -13
- package/dist/Scope.js +27 -35
- 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/SymbolTableFlag.d.ts +8 -0
- package/dist/SymbolTableFlag.js +13 -0
- package/dist/SymbolTableFlag.js.map +1 -0
- package/dist/XmlScope.d.ts +1 -6
- package/dist/XmlScope.js +6 -25
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +1 -2
- package/dist/astUtils/CachedLookups.js +3 -14
- package/dist/astUtils/CachedLookups.js.map +1 -1
- package/dist/astUtils/Editor.spec.js +1 -1
- package/dist/astUtils/Editor.spec.js.map +1 -1
- package/dist/astUtils/creators.js +77 -18
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +4 -4
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +3 -1
- package/dist/astUtils/reflection.js +12 -4
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +59 -42
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +30 -19
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +2 -1
- package/dist/bscPlugin/BscPlugin.js +7 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.js +7 -7
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/SignatureHelpUtil.js +5 -4
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +2 -2
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +23 -23
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +28 -8
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +74 -2
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +2 -5
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +8 -6
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +46 -47
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +120 -39
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +165 -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 +7 -6
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +7 -15
- package/dist/files/BrsFile.js +49 -309
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +111 -157
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +2 -3
- package/dist/files/XmlFile.js +0 -2
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/interfaces.d.ts +109 -84
- package/dist/interfaces.js +9 -9
- package/dist/interfaces.js.map +1 -1
- package/dist/parser/AstNode.spec.js +6 -6
- package/dist/parser/AstNode.spec.js.map +1 -1
- package/dist/parser/Expression.d.ts +301 -164
- package/dist/parser/Expression.js +355 -294
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +26 -27
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +6 -2
- package/dist/parser/Parser.js +361 -160
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +69 -213
- 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 +26 -55
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +381 -238
- package/dist/parser/Statement.js +510 -386
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +2 -2
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +2 -2
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +11 -11
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +30 -5
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +2 -2
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +2 -2
- 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 +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +8 -8
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +2 -2
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +2 -2
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +2 -2
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +10 -3
- package/dist/parser/tests/statement/TryCatch.spec.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.js +2 -3
- package/dist/types/AssociativeArrayType.js.map +1 -1
- package/dist/types/BscType.d.ts +1 -1
- package/dist/types/BscType.js +2 -3
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.js +15 -9
- 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 +16 -7
- package/dist/util.js +89 -43
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -9
- package/dist/validators/ClassValidator.js +9 -52
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,20 +5,26 @@ import type { BrsTranspileState } from './BrsTranspileState';
|
|
|
5
5
|
import { ParseMode } from './Parser';
|
|
6
6
|
import type { WalkOptions, WalkVisitor } from '../astUtils/visitors';
|
|
7
7
|
import type { GetTypeOptions, TranspileResult, TypedefProvider } from '../interfaces';
|
|
8
|
+
import { VoidType } from '../types/VoidType';
|
|
9
|
+
import { DynamicType } from '../types/DynamicType';
|
|
8
10
|
import type { BscType } from '../types/BscType';
|
|
9
11
|
import { TypedFunctionType } from '../types/TypedFunctionType';
|
|
10
12
|
import { AstNodeKind, Expression } from './AstNode';
|
|
11
13
|
import { SourceNode } from 'source-map';
|
|
12
14
|
import type { TranspileState } from './TranspileState';
|
|
13
15
|
import { StringType } from '../types/StringType';
|
|
14
|
-
import { DynamicType } from '../types/DynamicType';
|
|
15
|
-
import { VoidType } from '../types/VoidType';
|
|
16
16
|
export declare type ExpressionVisitor = (expression: Expression, parent: Expression) => void;
|
|
17
17
|
export declare class BinaryExpression extends Expression {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
constructor(options: {
|
|
19
|
+
left: Expression;
|
|
20
|
+
operator: Token;
|
|
21
|
+
right: Expression;
|
|
22
|
+
});
|
|
23
|
+
readonly tokens: {
|
|
24
|
+
readonly operator: Token;
|
|
25
|
+
};
|
|
26
|
+
readonly left: Expression;
|
|
27
|
+
readonly right: Expression;
|
|
22
28
|
readonly kind = AstNodeKind.BinaryExpression;
|
|
23
29
|
readonly range: Range;
|
|
24
30
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
@@ -26,19 +32,22 @@ export declare class BinaryExpression extends Expression {
|
|
|
26
32
|
getType(options: GetTypeOptions): BscType;
|
|
27
33
|
}
|
|
28
34
|
export declare class CallExpression extends Expression {
|
|
35
|
+
static MaximumArguments: number;
|
|
36
|
+
constructor(options: {
|
|
37
|
+
callee: Expression;
|
|
38
|
+
openingParen: Token;
|
|
39
|
+
args?: Expression[];
|
|
40
|
+
closingParen: Token;
|
|
41
|
+
});
|
|
29
42
|
readonly callee: Expression;
|
|
30
|
-
/**
|
|
31
|
-
* Can either be `(`, or `?(` for optional chaining
|
|
32
|
-
*/
|
|
33
|
-
readonly openingParen: Token;
|
|
34
|
-
readonly closingParen: Token;
|
|
35
43
|
readonly args: Expression[];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
readonly tokens: {
|
|
45
|
+
/**
|
|
46
|
+
* Can either be `(`, or `?(` for optional chaining - defaults to '('
|
|
47
|
+
*/
|
|
48
|
+
readonly openingParen?: Token;
|
|
49
|
+
readonly closingParen?: Token;
|
|
50
|
+
};
|
|
42
51
|
readonly kind = AstNodeKind.CallExpression;
|
|
43
52
|
readonly range: Range;
|
|
44
53
|
transpile(state: BrsTranspileState, nameOverride?: string): (string | SourceNode)[];
|
|
@@ -46,21 +55,27 @@ export declare class CallExpression extends Expression {
|
|
|
46
55
|
getType(options: GetTypeOptions): any;
|
|
47
56
|
}
|
|
48
57
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
constructor(options: {
|
|
59
|
+
functionType?: Token;
|
|
60
|
+
leftParen?: Token;
|
|
61
|
+
parameters?: FunctionParameterExpression[];
|
|
62
|
+
rightParen?: Token;
|
|
63
|
+
as?: Token;
|
|
64
|
+
returnTypeExpression?: TypeExpression;
|
|
65
|
+
body: Block;
|
|
66
|
+
endFunctionType?: Token;
|
|
67
|
+
});
|
|
58
68
|
readonly kind = AstNodeKind.FunctionExpression;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
readonly parameters: FunctionParameterExpression[];
|
|
70
|
+
readonly body: Block;
|
|
71
|
+
readonly returnTypeExpression?: TypeExpression;
|
|
72
|
+
readonly tokens: {
|
|
73
|
+
readonly functionType?: Token;
|
|
74
|
+
readonly endFunctionType?: Token;
|
|
75
|
+
readonly leftParen?: Token;
|
|
76
|
+
readonly rightParen?: Token;
|
|
77
|
+
readonly as?: Token;
|
|
78
|
+
};
|
|
64
79
|
/**
|
|
65
80
|
* If this function is part of a FunctionStatement, this will be set. Otherwise this will be undefined
|
|
66
81
|
*/
|
|
@@ -77,13 +92,21 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
77
92
|
getType(options: GetTypeOptions): TypedFunctionType;
|
|
78
93
|
}
|
|
79
94
|
export declare class FunctionParameterExpression extends Expression {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
constructor(options: {
|
|
96
|
+
name: Identifier;
|
|
97
|
+
equals?: Token;
|
|
98
|
+
defaultValue?: Expression;
|
|
99
|
+
as?: Token;
|
|
100
|
+
typeExpression?: TypeExpression;
|
|
101
|
+
});
|
|
86
102
|
readonly kind = AstNodeKind.FunctionParameterExpression;
|
|
103
|
+
readonly tokens: {
|
|
104
|
+
readonly name: Identifier;
|
|
105
|
+
readonly equals?: Token;
|
|
106
|
+
readonly as?: Token;
|
|
107
|
+
};
|
|
108
|
+
readonly defaultValue?: Expression;
|
|
109
|
+
readonly typeExpression?: TypeExpression;
|
|
87
110
|
getType(options: GetTypeOptions): BscType;
|
|
88
111
|
get range(): Range;
|
|
89
112
|
transpile(state: BrsTranspileState): any[];
|
|
@@ -91,17 +114,19 @@ export declare class FunctionParameterExpression extends Expression {
|
|
|
91
114
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
92
115
|
}
|
|
93
116
|
export declare class DottedGetExpression extends Expression {
|
|
117
|
+
constructor(options: {
|
|
118
|
+
obj: Expression;
|
|
119
|
+
name: Identifier;
|
|
120
|
+
/**
|
|
121
|
+
* Can either be `.`, or `?.` for optional chaining - defaults in transpile to '.'
|
|
122
|
+
*/
|
|
123
|
+
dot?: Token;
|
|
124
|
+
});
|
|
125
|
+
readonly tokens: {
|
|
126
|
+
readonly name: Identifier;
|
|
127
|
+
readonly dot?: Token;
|
|
128
|
+
};
|
|
94
129
|
readonly obj: Expression;
|
|
95
|
-
readonly name: Identifier;
|
|
96
|
-
/**
|
|
97
|
-
* Can either be `.`, or `?.` for optional chaining
|
|
98
|
-
*/
|
|
99
|
-
readonly dot: Token;
|
|
100
|
-
constructor(obj: Expression, name: Identifier,
|
|
101
|
-
/**
|
|
102
|
-
* Can either be `.`, or `?.` for optional chaining
|
|
103
|
-
*/
|
|
104
|
-
dot: Token);
|
|
105
130
|
readonly kind = AstNodeKind.DottedGetExpression;
|
|
106
131
|
readonly range: Range;
|
|
107
132
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
@@ -110,52 +135,62 @@ export declare class DottedGetExpression extends Expression {
|
|
|
110
135
|
getName(parseMode: ParseMode): string;
|
|
111
136
|
}
|
|
112
137
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* Can either be `@`, or `?@` for optional chaining
|
|
122
|
-
*/
|
|
123
|
-
at: Token);
|
|
138
|
+
constructor(options: {
|
|
139
|
+
obj: Expression;
|
|
140
|
+
/**
|
|
141
|
+
* Can either be `@`, or `?@` for optional chaining - defaults to '@'
|
|
142
|
+
*/
|
|
143
|
+
at?: Token;
|
|
144
|
+
name: Identifier;
|
|
145
|
+
});
|
|
124
146
|
readonly kind = AstNodeKind.XmlAttributeGetExpression;
|
|
147
|
+
readonly tokens: {
|
|
148
|
+
name: Identifier;
|
|
149
|
+
at?: Token;
|
|
150
|
+
};
|
|
151
|
+
readonly obj: Expression;
|
|
125
152
|
readonly range: Range;
|
|
126
153
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
127
154
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
128
155
|
}
|
|
129
156
|
export declare class IndexedGetExpression extends Expression {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.`
|
|
141
|
-
*/
|
|
142
|
-
openingSquare: Token, closingSquare: Token, questionDotToken?: Token);
|
|
157
|
+
constructor(options: {
|
|
158
|
+
obj: Expression;
|
|
159
|
+
indexes: Expression[];
|
|
160
|
+
/**
|
|
161
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
162
|
+
*/
|
|
163
|
+
openingSquare?: Token;
|
|
164
|
+
closingSquare?: Token;
|
|
165
|
+
questionDot?: Token;
|
|
166
|
+
});
|
|
143
167
|
readonly kind = AstNodeKind.IndexedGetExpression;
|
|
168
|
+
readonly obj: Expression;
|
|
169
|
+
readonly indexes: Expression[];
|
|
170
|
+
readonly tokens: {
|
|
171
|
+
/**
|
|
172
|
+
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.` - defaults to '[' in transpile
|
|
173
|
+
*/
|
|
174
|
+
readonly openingSquare?: Token;
|
|
175
|
+
readonly closingSquare?: Token;
|
|
176
|
+
readonly questionDot?: Token;
|
|
177
|
+
};
|
|
144
178
|
readonly range: Range;
|
|
145
|
-
transpile(state: BrsTranspileState):
|
|
179
|
+
transpile(state: BrsTranspileState): any[];
|
|
146
180
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
147
181
|
getType(options: GetTypeOptions): BscType;
|
|
148
182
|
}
|
|
149
183
|
export declare class GroupingExpression extends Expression {
|
|
184
|
+
constructor(options: {
|
|
185
|
+
leftParen?: Token;
|
|
186
|
+
rightParen?: Token;
|
|
187
|
+
expression: Expression;
|
|
188
|
+
});
|
|
150
189
|
readonly tokens: {
|
|
151
|
-
|
|
152
|
-
|
|
190
|
+
readonly leftParen?: Token;
|
|
191
|
+
readonly rightParen?: Token;
|
|
153
192
|
};
|
|
154
|
-
expression: Expression;
|
|
155
|
-
constructor(tokens: {
|
|
156
|
-
left: Token;
|
|
157
|
-
right: Token;
|
|
158
|
-
}, expression: Expression);
|
|
193
|
+
readonly expression: Expression;
|
|
159
194
|
readonly kind = AstNodeKind.GroupingExpression;
|
|
160
195
|
readonly range: Range;
|
|
161
196
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
@@ -163,11 +198,15 @@ export declare class GroupingExpression extends Expression {
|
|
|
163
198
|
getType(options: GetTypeOptions): BscType;
|
|
164
199
|
}
|
|
165
200
|
export declare class LiteralExpression extends Expression {
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
constructor(options: {
|
|
202
|
+
value: Token;
|
|
203
|
+
});
|
|
204
|
+
readonly tokens: {
|
|
205
|
+
readonly value: Token;
|
|
206
|
+
};
|
|
168
207
|
readonly kind = AstNodeKind.LiteralExpression;
|
|
169
208
|
get range(): Range;
|
|
170
|
-
getType(options?: GetTypeOptions): DynamicType | import("
|
|
209
|
+
getType(options?: GetTypeOptions): DynamicType | import("..").ObjectType | StringType | import("..").IntegerType | import("..").BooleanType | import("..").FloatType | import("..").DoubleType | import("..").LongIntegerType | VoidType | import("../types/FunctionType").FunctionType;
|
|
171
210
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
172
211
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
173
212
|
}
|
|
@@ -176,23 +215,32 @@ export declare class LiteralExpression extends Expression {
|
|
|
176
215
|
* during template string transpile by identifying these expressions explicitly and skipping the bslib_toString around them
|
|
177
216
|
*/
|
|
178
217
|
export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
charCode: number;
|
|
218
|
+
constructor(options: {
|
|
219
|
+
value: Token & {
|
|
220
|
+
charCode: number;
|
|
221
|
+
};
|
|
184
222
|
});
|
|
185
223
|
readonly kind = AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
224
|
+
readonly tokens: {
|
|
225
|
+
readonly value: Token & {
|
|
226
|
+
charCode: number;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
186
229
|
readonly range: Range;
|
|
187
230
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
188
231
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
189
232
|
}
|
|
190
233
|
export declare class ArrayLiteralExpression extends Expression {
|
|
234
|
+
constructor(options: {
|
|
235
|
+
elements: Array<Expression | CommentStatement>;
|
|
236
|
+
open?: Token;
|
|
237
|
+
close?: Token;
|
|
238
|
+
});
|
|
191
239
|
readonly elements: Array<Expression | CommentStatement>;
|
|
192
|
-
readonly
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
240
|
+
readonly tokens: {
|
|
241
|
+
readonly open?: Token;
|
|
242
|
+
readonly close?: Token;
|
|
243
|
+
};
|
|
196
244
|
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
197
245
|
readonly range: Range;
|
|
198
246
|
transpile(state: BrsTranspileState): any[];
|
|
@@ -200,25 +248,37 @@ export declare class ArrayLiteralExpression extends Expression {
|
|
|
200
248
|
getType(options: GetTypeOptions): BscType;
|
|
201
249
|
}
|
|
202
250
|
export declare class AAMemberExpression extends Expression {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
251
|
+
constructor(options: {
|
|
252
|
+
key: Token;
|
|
253
|
+
colon?: Token;
|
|
254
|
+
/** The expression evaluated to determine the member's initial value. */
|
|
255
|
+
value: Expression;
|
|
256
|
+
comma?: Token;
|
|
257
|
+
});
|
|
210
258
|
readonly kind = AstNodeKind.AAMemberExpression;
|
|
211
|
-
range: Range;
|
|
212
|
-
|
|
259
|
+
readonly range: Range;
|
|
260
|
+
readonly tokens: {
|
|
261
|
+
readonly key: Token;
|
|
262
|
+
readonly colon?: Token;
|
|
263
|
+
readonly comma?: Token;
|
|
264
|
+
};
|
|
265
|
+
/** The expression evaluated to determine the member's initial value. */
|
|
266
|
+
readonly value: Expression;
|
|
213
267
|
transpile(state: BrsTranspileState): any[];
|
|
214
268
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
215
269
|
getType(options: GetTypeOptions): BscType;
|
|
216
270
|
}
|
|
217
271
|
export declare class AALiteralExpression extends Expression {
|
|
272
|
+
constructor(options: {
|
|
273
|
+
elements: Array<AAMemberExpression | CommentStatement>;
|
|
274
|
+
open?: Token;
|
|
275
|
+
close?: Token;
|
|
276
|
+
});
|
|
218
277
|
readonly elements: Array<AAMemberExpression | CommentStatement>;
|
|
219
|
-
readonly
|
|
220
|
-
|
|
221
|
-
|
|
278
|
+
readonly tokens: {
|
|
279
|
+
readonly open?: Token;
|
|
280
|
+
readonly close?: Token;
|
|
281
|
+
};
|
|
222
282
|
readonly kind = AstNodeKind.AALiteralExpression;
|
|
223
283
|
readonly range: Range;
|
|
224
284
|
transpile(state: BrsTranspileState): any[];
|
|
@@ -226,30 +286,43 @@ export declare class AALiteralExpression extends Expression {
|
|
|
226
286
|
getType(options: GetTypeOptions): BscType;
|
|
227
287
|
}
|
|
228
288
|
export declare class UnaryExpression extends Expression {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
289
|
+
constructor(options: {
|
|
290
|
+
operator: Token;
|
|
291
|
+
right: Expression;
|
|
292
|
+
});
|
|
232
293
|
readonly kind = AstNodeKind.UnaryExpression;
|
|
233
294
|
readonly range: Range;
|
|
295
|
+
readonly tokens: {
|
|
296
|
+
readonly operator: Token;
|
|
297
|
+
};
|
|
298
|
+
readonly right: Expression;
|
|
234
299
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
235
300
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
236
301
|
getType(options: GetTypeOptions): BscType;
|
|
237
302
|
}
|
|
238
303
|
export declare class VariableExpression extends Expression {
|
|
239
|
-
|
|
240
|
-
|
|
304
|
+
constructor(options: {
|
|
305
|
+
name: Identifier;
|
|
306
|
+
});
|
|
307
|
+
readonly tokens: {
|
|
308
|
+
readonly name: Identifier;
|
|
309
|
+
};
|
|
241
310
|
readonly kind = AstNodeKind.VariableExpression;
|
|
242
311
|
readonly range: Range;
|
|
243
|
-
getName(parseMode
|
|
312
|
+
getName(parseMode?: ParseMode): string;
|
|
244
313
|
transpile(state: BrsTranspileState): any[];
|
|
245
314
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
246
315
|
getType(options: GetTypeOptions): BscType;
|
|
247
316
|
}
|
|
248
317
|
export declare class SourceLiteralExpression extends Expression {
|
|
249
|
-
|
|
250
|
-
|
|
318
|
+
constructor(options: {
|
|
319
|
+
value: Token;
|
|
320
|
+
});
|
|
251
321
|
readonly range: Range;
|
|
252
322
|
readonly kind = AstNodeKind.SourceLiteralExpression;
|
|
323
|
+
readonly tokens: {
|
|
324
|
+
readonly value: Token;
|
|
325
|
+
};
|
|
253
326
|
/**
|
|
254
327
|
* Find the index of the function in its parent
|
|
255
328
|
*/
|
|
@@ -264,11 +337,16 @@ export declare class SourceLiteralExpression extends Expression {
|
|
|
264
337
|
* do more type checking.
|
|
265
338
|
*/
|
|
266
339
|
export declare class NewExpression extends Expression {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
340
|
+
constructor(options: {
|
|
341
|
+
new?: Token;
|
|
342
|
+
call: CallExpression;
|
|
343
|
+
});
|
|
270
344
|
readonly kind = AstNodeKind.NewExpression;
|
|
271
345
|
readonly range: Range;
|
|
346
|
+
readonly tokens: {
|
|
347
|
+
readonly new?: Token;
|
|
348
|
+
};
|
|
349
|
+
readonly call: CallExpression;
|
|
272
350
|
/**
|
|
273
351
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
274
352
|
*/
|
|
@@ -278,13 +356,22 @@ export declare class NewExpression extends Expression {
|
|
|
278
356
|
getType(options: GetTypeOptions): any;
|
|
279
357
|
}
|
|
280
358
|
export declare class CallfuncExpression extends Expression {
|
|
359
|
+
constructor(options: {
|
|
360
|
+
callee: Expression;
|
|
361
|
+
operator?: Token;
|
|
362
|
+
methodName: Identifier;
|
|
363
|
+
openingParen?: Token;
|
|
364
|
+
args?: Expression[];
|
|
365
|
+
closingParen?: Token;
|
|
366
|
+
});
|
|
281
367
|
readonly callee: Expression;
|
|
282
|
-
readonly operator: Token;
|
|
283
|
-
readonly methodName: Identifier;
|
|
284
|
-
readonly openingParen: Token;
|
|
285
368
|
readonly args: Expression[];
|
|
286
|
-
readonly
|
|
287
|
-
|
|
369
|
+
readonly tokens: {
|
|
370
|
+
readonly operator: Token;
|
|
371
|
+
readonly methodName: Identifier;
|
|
372
|
+
readonly openingParen?: Token;
|
|
373
|
+
readonly closingParen?: Token;
|
|
374
|
+
};
|
|
288
375
|
readonly kind = AstNodeKind.CallfuncExpression;
|
|
289
376
|
readonly range: Range;
|
|
290
377
|
transpile(state: BrsTranspileState): any[];
|
|
@@ -296,44 +383,67 @@ export declare class CallfuncExpression extends Expression {
|
|
|
296
383
|
* This is a single expression that represents the string contatenation of all parts of a single quasi.
|
|
297
384
|
*/
|
|
298
385
|
export declare class TemplateStringQuasiExpression extends Expression {
|
|
386
|
+
constructor(options: {
|
|
387
|
+
expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
388
|
+
});
|
|
299
389
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
300
|
-
constructor(expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>);
|
|
301
390
|
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
302
391
|
readonly range: Range;
|
|
303
392
|
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): any[];
|
|
304
393
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
305
394
|
}
|
|
306
395
|
export declare class TemplateStringExpression extends Expression {
|
|
307
|
-
|
|
396
|
+
constructor(options: {
|
|
397
|
+
openingBacktick?: Token;
|
|
398
|
+
quasis: TemplateStringQuasiExpression[];
|
|
399
|
+
expressions: Expression[];
|
|
400
|
+
closingBacktick?: Token;
|
|
401
|
+
});
|
|
402
|
+
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
403
|
+
readonly tokens: {
|
|
404
|
+
readonly openingBacktick?: Token;
|
|
405
|
+
readonly closingBacktick?: Token;
|
|
406
|
+
};
|
|
308
407
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
309
408
|
readonly expressions: Expression[];
|
|
310
|
-
readonly closingBacktick: Token;
|
|
311
|
-
constructor(openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
312
|
-
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
313
409
|
readonly range: Range;
|
|
314
410
|
getType(options: GetTypeOptions): StringType;
|
|
315
411
|
transpile(state: BrsTranspileState): any[];
|
|
316
412
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
317
413
|
}
|
|
318
414
|
export declare class TaggedTemplateStringExpression extends Expression {
|
|
319
|
-
|
|
320
|
-
|
|
415
|
+
constructor(options: {
|
|
416
|
+
tagName: Identifier;
|
|
417
|
+
openingBacktick?: Token;
|
|
418
|
+
quasis: TemplateStringQuasiExpression[];
|
|
419
|
+
expressions: Expression[];
|
|
420
|
+
closingBacktick?: Token;
|
|
421
|
+
});
|
|
422
|
+
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
423
|
+
readonly tokens: {
|
|
424
|
+
readonly tagName: Identifier;
|
|
425
|
+
readonly openingBacktick?: Token;
|
|
426
|
+
readonly closingBacktick?: Token;
|
|
427
|
+
};
|
|
321
428
|
readonly quasis: TemplateStringQuasiExpression[];
|
|
322
429
|
readonly expressions: Expression[];
|
|
323
|
-
readonly closingBacktick: Token;
|
|
324
|
-
constructor(tagName: Identifier, openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
325
|
-
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
326
430
|
readonly range: Range;
|
|
327
431
|
transpile(state: BrsTranspileState): any[];
|
|
328
432
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
329
433
|
}
|
|
330
434
|
export declare class AnnotationExpression extends Expression {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
435
|
+
constructor(options: {
|
|
436
|
+
at?: Token;
|
|
437
|
+
name: Token;
|
|
438
|
+
call?: CallExpression;
|
|
439
|
+
});
|
|
334
440
|
readonly kind = AstNodeKind.AnnotationExpression;
|
|
441
|
+
readonly tokens: {
|
|
442
|
+
readonly at: Token;
|
|
443
|
+
readonly name: Token;
|
|
444
|
+
};
|
|
335
445
|
get range(): Range;
|
|
336
|
-
name: string;
|
|
446
|
+
readonly name: string;
|
|
337
447
|
call: CallExpression;
|
|
338
448
|
/**
|
|
339
449
|
* Convert annotation arguments to JavaScript types
|
|
@@ -346,35 +456,49 @@ export declare class AnnotationExpression extends Expression {
|
|
|
346
456
|
getTypedef(state: BrsTranspileState): (string | SourceNode)[];
|
|
347
457
|
}
|
|
348
458
|
export declare class TernaryExpression extends Expression {
|
|
459
|
+
constructor(options: {
|
|
460
|
+
test: Expression;
|
|
461
|
+
questionMark?: Token;
|
|
462
|
+
consequent?: Expression;
|
|
463
|
+
colon?: Token;
|
|
464
|
+
alternate?: Expression;
|
|
465
|
+
});
|
|
466
|
+
readonly kind = AstNodeKind.TernaryExpression;
|
|
467
|
+
readonly range: Range;
|
|
468
|
+
readonly tokens: {
|
|
469
|
+
readonly questionMark?: Token;
|
|
470
|
+
readonly colon?: Token;
|
|
471
|
+
};
|
|
349
472
|
readonly test: Expression;
|
|
350
|
-
readonly questionMarkToken: Token;
|
|
351
473
|
readonly consequent?: Expression;
|
|
352
|
-
readonly colonToken?: Token;
|
|
353
474
|
readonly alternate?: Expression;
|
|
354
|
-
constructor(test: Expression, questionMarkToken: Token, consequent?: Expression, colonToken?: Token, alternate?: Expression);
|
|
355
|
-
readonly kind = AstNodeKind.TernaryExpression;
|
|
356
|
-
range: Range;
|
|
357
475
|
transpile(state: BrsTranspileState): any[];
|
|
358
476
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
359
477
|
}
|
|
360
478
|
export declare class NullCoalescingExpression extends Expression {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
479
|
+
constructor(options: {
|
|
480
|
+
consequent: Expression;
|
|
481
|
+
questionQuestion?: Token;
|
|
482
|
+
alternate: Expression;
|
|
483
|
+
});
|
|
365
484
|
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
366
485
|
readonly range: Range;
|
|
486
|
+
readonly tokens: {
|
|
487
|
+
readonly questionQuestion?: Token;
|
|
488
|
+
};
|
|
489
|
+
readonly consequent: Expression;
|
|
490
|
+
readonly alternate: Expression;
|
|
367
491
|
transpile(state: BrsTranspileState): any[];
|
|
368
492
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
369
493
|
}
|
|
370
494
|
export declare class RegexLiteralExpression extends Expression {
|
|
371
|
-
|
|
372
|
-
regexLiteral: Token;
|
|
373
|
-
};
|
|
374
|
-
constructor(tokens: {
|
|
495
|
+
constructor(options: {
|
|
375
496
|
regexLiteral: Token;
|
|
376
497
|
});
|
|
377
498
|
readonly kind = AstNodeKind.RegexLiteralExpression;
|
|
499
|
+
readonly tokens: {
|
|
500
|
+
readonly regexLiteral: Token;
|
|
501
|
+
};
|
|
378
502
|
get range(): Range;
|
|
379
503
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
380
504
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -383,17 +507,18 @@ declare type ExpressionValue = string | number | boolean | Expression | Expressi
|
|
|
383
507
|
[key: string]: ExpressionValue;
|
|
384
508
|
};
|
|
385
509
|
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
510
|
+
constructor(options: {
|
|
511
|
+
/**
|
|
512
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
513
|
+
*/
|
|
514
|
+
expression: Expression;
|
|
515
|
+
});
|
|
516
|
+
readonly kind = AstNodeKind.TypeExpression;
|
|
386
517
|
/**
|
|
387
518
|
* The standard AST expression that represents the type for this TypeExpression.
|
|
388
519
|
*/
|
|
389
|
-
expression: Expression;
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* The standard AST expression that represents the type for this TypeExpression.
|
|
393
|
-
*/
|
|
394
|
-
expression: Expression);
|
|
395
|
-
readonly kind = AstNodeKind.TypeExpression;
|
|
396
|
-
range: Range;
|
|
520
|
+
readonly expression: Expression;
|
|
521
|
+
readonly range: Range;
|
|
397
522
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
398
523
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
399
524
|
getType(options: GetTypeOptions): BscType;
|
|
@@ -402,23 +527,35 @@ export declare class TypeExpression extends Expression implements TypedefProvide
|
|
|
402
527
|
getNameParts(): string[];
|
|
403
528
|
}
|
|
404
529
|
export declare class TypeCastExpression extends Expression {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
530
|
+
constructor(options: {
|
|
531
|
+
obj: Expression;
|
|
532
|
+
as?: Token;
|
|
533
|
+
typeExpression?: TypeExpression;
|
|
534
|
+
});
|
|
409
535
|
readonly kind = AstNodeKind.TypeCastExpression;
|
|
410
|
-
|
|
536
|
+
readonly obj: Expression;
|
|
537
|
+
readonly tokens: {
|
|
538
|
+
readonly as?: Token;
|
|
539
|
+
};
|
|
540
|
+
typeExpression?: TypeExpression;
|
|
541
|
+
readonly range: Range;
|
|
411
542
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
412
543
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
413
544
|
getType(options: GetTypeOptions): BscType;
|
|
414
545
|
}
|
|
415
546
|
export declare class TypedArrayExpression extends Expression {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
547
|
+
constructor(options: {
|
|
548
|
+
innerType: Expression;
|
|
549
|
+
leftBracket?: Token;
|
|
550
|
+
rightBracket?: Token;
|
|
551
|
+
});
|
|
552
|
+
readonly tokens: {
|
|
553
|
+
readonly leftBracket?: Token;
|
|
554
|
+
readonly rightBracket?: Token;
|
|
555
|
+
};
|
|
556
|
+
readonly innerType: Expression;
|
|
420
557
|
readonly kind = AstNodeKind.TypedArrayExpression;
|
|
421
|
-
range: Range;
|
|
558
|
+
readonly range: Range;
|
|
422
559
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
423
560
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
424
561
|
getType(options: GetTypeOptions): BscType;
|