brighterscript 0.65.0 → 0.66.0-alpha.0
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 +12 -0
- package/README.md +8 -0
- package/dist/BsConfig.d.ts +5 -11
- package/dist/CacheVerifier.d.ts +8 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +9 -4
- package/dist/DiagnosticMessages.js +8 -3
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/FunctionScope.d.ts +1 -0
- package/dist/FunctionScope.js +3 -0
- package/dist/FunctionScope.js.map +1 -1
- package/dist/PluginInterface.d.ts +0 -4
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +6 -39
- package/dist/Program.js +42 -44
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +4 -0
- package/dist/ProgramBuilder.js +12 -7
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +1 -5
- package/dist/Scope.js +3 -28
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +44 -6
- package/dist/SymbolTable.js +151 -25
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.js +11 -12
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/creators.d.ts +16 -6
- package/dist/astUtils/creators.js +39 -16
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +46 -37
- package/dist/astUtils/reflection.js +145 -147
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +1 -6
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +4 -11
- package/dist/astUtils/visitors.js +0 -7
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +4 -2
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +6 -6
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.js +4 -0
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +2 -2
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.js +71 -59
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +110 -10
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +6 -5
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +1 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +11 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +53 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +4 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +72 -16
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +72 -18
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/XmlFileValidator.js +9 -9
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +47 -10
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +8 -10
- package/dist/files/BrsFile.js +72 -52
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +56 -14
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +19 -19
- package/dist/files/XmlFile.js +24 -42
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +61 -9
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +8 -11
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/globalCallables.js +2 -1
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +20 -1
- package/dist/interfaces.js +13 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +2 -0
- package/dist/lexer/TokenKind.js +5 -1
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +78 -1
- package/dist/parser/AstNode.js +80 -1
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/Expression.d.ts +87 -53
- package/dist/parser/Expression.js +243 -139
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +10 -7
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +9 -5
- package/dist/parser/Parser.js +125 -78
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +2 -0
- package/dist/parser/Parser.spec.js +117 -5
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +42 -4
- package/dist/parser/SGParser.js +191 -195
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +13 -10
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +279 -51
- package/dist/parser/SGTypes.js +562 -185
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +88 -70
- package/dist/parser/Statement.js +222 -145
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +5 -2
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/types/ArrayType.d.ts +6 -4
- package/dist/types/ArrayType.js +30 -22
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +8 -8
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/BooleanType.d.ts +7 -4
- package/dist/types/BooleanType.js +13 -8
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +9 -3
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +25 -2
- package/dist/types/BscType.js +64 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +22 -0
- package/dist/types/BscTypeKind.js +27 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/ClassType.d.ts +11 -0
- package/dist/types/ClassType.js +31 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +75 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/DoubleType.d.ts +7 -4
- package/dist/types/DoubleType.js +16 -20
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +11 -3
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +9 -3
- package/dist/types/DynamicType.js +16 -2
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +15 -4
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +22 -0
- package/dist/types/EnumType.js +59 -0
- package/dist/types/EnumType.js.map +1 -0
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +7 -4
- package/dist/types/FloatType.js +16 -20
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +3 -3
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +6 -4
- package/dist/types/FunctionType.js +22 -19
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/FunctionType.spec.js +5 -5
- package/dist/types/FunctionType.spec.js.map +1 -1
- package/dist/types/InheritableType.d.ts +25 -0
- package/dist/types/InheritableType.js +88 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +7 -4
- package/dist/types/IntegerType.js +16 -20
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +7 -3
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +10 -10
- package/dist/types/InterfaceType.js +24 -45
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +59 -45
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +6 -4
- package/dist/types/InvalidType.js +12 -8
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +7 -3
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +7 -4
- package/dist/types/LongIntegerType.js +16 -20
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +9 -3
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +11 -0
- package/dist/types/NamespaceType.js +25 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +8 -4
- package/dist/types/ObjectType.js +26 -7
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +2 -2
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +51 -0
- package/dist/types/ReferenceType.js +274 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +122 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +10 -4
- package/dist/types/StringType.js +16 -8
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +2 -2
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +6 -3
- package/dist/types/UninitializedType.js +14 -3
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +18 -0
- package/dist/types/UnionType.js +91 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +103 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +7 -4
- package/dist/types/VoidType.js +13 -8
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +2 -2
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +130 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -0
- package/dist/types/helpers.js +131 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +9 -8
- package/dist/util.js +78 -32
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -4
- package/dist/validators/ClassValidator.js +6 -30
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +2 -1
- package/dist/types/CustomType.d.ts +0 -9
- package/dist/types/CustomType.js +0 -32
- package/dist/types/CustomType.js.map +0 -1
package/dist/parser/AstNode.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ import { CancellationTokenSource } from 'vscode-languageserver';
|
|
|
4
4
|
import { InternalWalkMode } from '../astUtils/visitors';
|
|
5
5
|
import type { SymbolTable } from '../SymbolTable';
|
|
6
6
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
7
|
-
import type { TranspileResult } from '../interfaces';
|
|
7
|
+
import type { GetTypeOptions, TranspileResult } from '../interfaces';
|
|
8
8
|
import type { AnnotationExpression } from './Expression';
|
|
9
|
+
import type { BscType } from '../types/BscType';
|
|
9
10
|
/**
|
|
10
11
|
* A BrightScript AST node
|
|
11
12
|
*/
|
|
12
13
|
export declare abstract class AstNode {
|
|
14
|
+
abstract kind: AstNodeKind;
|
|
13
15
|
/**
|
|
14
16
|
* The starting and ending location of the node.
|
|
15
17
|
*/
|
|
@@ -48,6 +50,10 @@ export declare abstract class AstNode {
|
|
|
48
50
|
* FInd the deepest child that includes the given position
|
|
49
51
|
*/
|
|
50
52
|
findChildAtPosition<TNodeType extends AstNode = AstNode>(position: Position, options?: WalkOptions): TNodeType;
|
|
53
|
+
/**
|
|
54
|
+
* Get the BscType of this node.
|
|
55
|
+
*/
|
|
56
|
+
getType(options: GetTypeOptions): BscType;
|
|
51
57
|
/**
|
|
52
58
|
* Links all child nodes to their parent AstNode, and the same with symbol tables. This performs a full AST walk, so you should use this sparingly
|
|
53
59
|
*/
|
|
@@ -70,3 +76,74 @@ export declare abstract class Expression extends AstNode {
|
|
|
70
76
|
*/
|
|
71
77
|
visitMode: InternalWalkMode;
|
|
72
78
|
}
|
|
79
|
+
export declare enum AstNodeKind {
|
|
80
|
+
Body = "Body",
|
|
81
|
+
BinaryExpression = "BinaryExpression",
|
|
82
|
+
CallExpression = "CallExpression",
|
|
83
|
+
FunctionExpression = "FunctionExpression",
|
|
84
|
+
FunctionParameterExpression = "FunctionParameterExpression",
|
|
85
|
+
NamespacedVariableNameExpression = "NamespacedVariableNameExpression",
|
|
86
|
+
DottedGetExpression = "DottedGetExpression",
|
|
87
|
+
XmlAttributeGetExpression = "XmlAttributeGetExpression",
|
|
88
|
+
IndexedGetExpression = "IndexedGetExpression",
|
|
89
|
+
GroupingExpression = "GroupingExpression",
|
|
90
|
+
LiteralExpression = "LiteralExpression",
|
|
91
|
+
EscapedCharCodeLiteralExpression = "EscapedCharCodeLiteralExpression",
|
|
92
|
+
ArrayLiteralExpression = "ArrayLiteralExpression",
|
|
93
|
+
AAMemberExpression = "AAMemberExpression",
|
|
94
|
+
AALiteralExpression = "AALiteralExpression",
|
|
95
|
+
UnaryExpression = "UnaryExpression",
|
|
96
|
+
VariableExpression = "VariableExpression",
|
|
97
|
+
SourceLiteralExpression = "SourceLiteralExpression",
|
|
98
|
+
NewExpression = "NewExpression",
|
|
99
|
+
CallfuncExpression = "CallfuncExpression",
|
|
100
|
+
TemplateStringQuasiExpression = "TemplateStringQuasiExpression",
|
|
101
|
+
TemplateStringExpression = "TemplateStringExpression",
|
|
102
|
+
TaggedTemplateStringExpression = "TaggedTemplateStringExpression",
|
|
103
|
+
AnnotationExpression = "AnnotationExpression",
|
|
104
|
+
TernaryExpression = "TernaryExpression",
|
|
105
|
+
NullCoalescingExpression = "NullCoalescingExpression",
|
|
106
|
+
RegexLiteralExpression = "RegexLiteralExpression",
|
|
107
|
+
EmptyStatement = "EmptyStatement",
|
|
108
|
+
AssignmentStatement = "AssignmentStatement",
|
|
109
|
+
ExpressionStatement = "ExpressionStatement",
|
|
110
|
+
CommentStatement = "CommentStatement",
|
|
111
|
+
ExitForStatement = "ExitForStatement",
|
|
112
|
+
ExitWhileStatement = "ExitWhileStatement",
|
|
113
|
+
FunctionStatement = "FunctionStatement",
|
|
114
|
+
IfStatement = "IfStatement",
|
|
115
|
+
IncrementStatement = "IncrementStatement",
|
|
116
|
+
PrintStatement = "PrintStatement",
|
|
117
|
+
DimStatement = "DimStatement",
|
|
118
|
+
GotoStatement = "GotoStatement",
|
|
119
|
+
LabelStatement = "LabelStatement",
|
|
120
|
+
ReturnStatement = "ReturnStatement",
|
|
121
|
+
EndStatement = "EndStatement",
|
|
122
|
+
StopStatement = "StopStatement",
|
|
123
|
+
ForStatement = "ForStatement",
|
|
124
|
+
ForEachStatement = "ForEachStatement",
|
|
125
|
+
WhileStatement = "WhileStatement",
|
|
126
|
+
DottedSetStatement = "DottedSetStatement",
|
|
127
|
+
IndexedSetStatement = "IndexedSetStatement",
|
|
128
|
+
LibraryStatement = "LibraryStatement",
|
|
129
|
+
NamespaceStatement = "NamespaceStatement",
|
|
130
|
+
ImportStatement = "ImportStatement",
|
|
131
|
+
InterfaceStatement = "InterfaceStatement",
|
|
132
|
+
InterfaceFieldStatement = "InterfaceFieldStatement",
|
|
133
|
+
InterfaceMethodStatement = "InterfaceMethodStatement",
|
|
134
|
+
ClassStatement = "ClassStatement",
|
|
135
|
+
MethodStatement = "MethodStatement",
|
|
136
|
+
ClassMethodStatement = "ClassMethodStatement",
|
|
137
|
+
FieldStatement = "FieldStatement",
|
|
138
|
+
ClassFieldStatement = "ClassFieldStatement",
|
|
139
|
+
TryCatchStatement = "TryCatchStatement",
|
|
140
|
+
CatchStatement = "CatchStatement",
|
|
141
|
+
ThrowStatement = "ThrowStatement",
|
|
142
|
+
EnumStatement = "EnumStatement",
|
|
143
|
+
EnumMemberStatement = "EnumMemberStatement",
|
|
144
|
+
ConstStatement = "ConstStatement",
|
|
145
|
+
ContinueStatement = "ContinueStatement",
|
|
146
|
+
Block = "Block",
|
|
147
|
+
TypeExpression = "TypeExpression",
|
|
148
|
+
TypeCastExpression = "TypeCastExpression"
|
|
149
|
+
}
|
package/dist/parser/AstNode.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Expression = exports.Statement = exports.AstNode = void 0;
|
|
3
|
+
exports.AstNodeKind = exports.Expression = exports.Statement = exports.AstNode = void 0;
|
|
4
4
|
const visitors_1 = require("../astUtils/visitors");
|
|
5
5
|
const vscode_languageserver_1 = require("vscode-languageserver");
|
|
6
6
|
const visitors_2 = require("../astUtils/visitors");
|
|
7
7
|
const util_1 = require("../util");
|
|
8
|
+
const DynamicType_1 = require("../types/DynamicType");
|
|
8
9
|
/**
|
|
9
10
|
* A BrightScript AST node
|
|
10
11
|
*/
|
|
@@ -75,6 +76,12 @@ class AstNode {
|
|
|
75
76
|
}
|
|
76
77
|
}, options);
|
|
77
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the BscType of this node.
|
|
81
|
+
*/
|
|
82
|
+
getType(options) {
|
|
83
|
+
return DynamicType_1.DynamicType.instance;
|
|
84
|
+
}
|
|
78
85
|
/**
|
|
79
86
|
* Links all child nodes to their parent AstNode, and the same with symbol tables. This performs a full AST walk, so you should use this sparingly
|
|
80
87
|
*/
|
|
@@ -107,4 +114,76 @@ class Expression extends AstNode {
|
|
|
107
114
|
}
|
|
108
115
|
}
|
|
109
116
|
exports.Expression = Expression;
|
|
117
|
+
var AstNodeKind;
|
|
118
|
+
(function (AstNodeKind) {
|
|
119
|
+
AstNodeKind["Body"] = "Body";
|
|
120
|
+
AstNodeKind["BinaryExpression"] = "BinaryExpression";
|
|
121
|
+
AstNodeKind["CallExpression"] = "CallExpression";
|
|
122
|
+
AstNodeKind["FunctionExpression"] = "FunctionExpression";
|
|
123
|
+
AstNodeKind["FunctionParameterExpression"] = "FunctionParameterExpression";
|
|
124
|
+
AstNodeKind["NamespacedVariableNameExpression"] = "NamespacedVariableNameExpression";
|
|
125
|
+
AstNodeKind["DottedGetExpression"] = "DottedGetExpression";
|
|
126
|
+
AstNodeKind["XmlAttributeGetExpression"] = "XmlAttributeGetExpression";
|
|
127
|
+
AstNodeKind["IndexedGetExpression"] = "IndexedGetExpression";
|
|
128
|
+
AstNodeKind["GroupingExpression"] = "GroupingExpression";
|
|
129
|
+
AstNodeKind["LiteralExpression"] = "LiteralExpression";
|
|
130
|
+
AstNodeKind["EscapedCharCodeLiteralExpression"] = "EscapedCharCodeLiteralExpression";
|
|
131
|
+
AstNodeKind["ArrayLiteralExpression"] = "ArrayLiteralExpression";
|
|
132
|
+
AstNodeKind["AAMemberExpression"] = "AAMemberExpression";
|
|
133
|
+
AstNodeKind["AALiteralExpression"] = "AALiteralExpression";
|
|
134
|
+
AstNodeKind["UnaryExpression"] = "UnaryExpression";
|
|
135
|
+
AstNodeKind["VariableExpression"] = "VariableExpression";
|
|
136
|
+
AstNodeKind["SourceLiteralExpression"] = "SourceLiteralExpression";
|
|
137
|
+
AstNodeKind["NewExpression"] = "NewExpression";
|
|
138
|
+
AstNodeKind["CallfuncExpression"] = "CallfuncExpression";
|
|
139
|
+
AstNodeKind["TemplateStringQuasiExpression"] = "TemplateStringQuasiExpression";
|
|
140
|
+
AstNodeKind["TemplateStringExpression"] = "TemplateStringExpression";
|
|
141
|
+
AstNodeKind["TaggedTemplateStringExpression"] = "TaggedTemplateStringExpression";
|
|
142
|
+
AstNodeKind["AnnotationExpression"] = "AnnotationExpression";
|
|
143
|
+
AstNodeKind["TernaryExpression"] = "TernaryExpression";
|
|
144
|
+
AstNodeKind["NullCoalescingExpression"] = "NullCoalescingExpression";
|
|
145
|
+
AstNodeKind["RegexLiteralExpression"] = "RegexLiteralExpression";
|
|
146
|
+
AstNodeKind["EmptyStatement"] = "EmptyStatement";
|
|
147
|
+
AstNodeKind["AssignmentStatement"] = "AssignmentStatement";
|
|
148
|
+
AstNodeKind["ExpressionStatement"] = "ExpressionStatement";
|
|
149
|
+
AstNodeKind["CommentStatement"] = "CommentStatement";
|
|
150
|
+
AstNodeKind["ExitForStatement"] = "ExitForStatement";
|
|
151
|
+
AstNodeKind["ExitWhileStatement"] = "ExitWhileStatement";
|
|
152
|
+
AstNodeKind["FunctionStatement"] = "FunctionStatement";
|
|
153
|
+
AstNodeKind["IfStatement"] = "IfStatement";
|
|
154
|
+
AstNodeKind["IncrementStatement"] = "IncrementStatement";
|
|
155
|
+
AstNodeKind["PrintStatement"] = "PrintStatement";
|
|
156
|
+
AstNodeKind["DimStatement"] = "DimStatement";
|
|
157
|
+
AstNodeKind["GotoStatement"] = "GotoStatement";
|
|
158
|
+
AstNodeKind["LabelStatement"] = "LabelStatement";
|
|
159
|
+
AstNodeKind["ReturnStatement"] = "ReturnStatement";
|
|
160
|
+
AstNodeKind["EndStatement"] = "EndStatement";
|
|
161
|
+
AstNodeKind["StopStatement"] = "StopStatement";
|
|
162
|
+
AstNodeKind["ForStatement"] = "ForStatement";
|
|
163
|
+
AstNodeKind["ForEachStatement"] = "ForEachStatement";
|
|
164
|
+
AstNodeKind["WhileStatement"] = "WhileStatement";
|
|
165
|
+
AstNodeKind["DottedSetStatement"] = "DottedSetStatement";
|
|
166
|
+
AstNodeKind["IndexedSetStatement"] = "IndexedSetStatement";
|
|
167
|
+
AstNodeKind["LibraryStatement"] = "LibraryStatement";
|
|
168
|
+
AstNodeKind["NamespaceStatement"] = "NamespaceStatement";
|
|
169
|
+
AstNodeKind["ImportStatement"] = "ImportStatement";
|
|
170
|
+
AstNodeKind["InterfaceStatement"] = "InterfaceStatement";
|
|
171
|
+
AstNodeKind["InterfaceFieldStatement"] = "InterfaceFieldStatement";
|
|
172
|
+
AstNodeKind["InterfaceMethodStatement"] = "InterfaceMethodStatement";
|
|
173
|
+
AstNodeKind["ClassStatement"] = "ClassStatement";
|
|
174
|
+
AstNodeKind["MethodStatement"] = "MethodStatement";
|
|
175
|
+
AstNodeKind["ClassMethodStatement"] = "ClassMethodStatement";
|
|
176
|
+
AstNodeKind["FieldStatement"] = "FieldStatement";
|
|
177
|
+
AstNodeKind["ClassFieldStatement"] = "ClassFieldStatement";
|
|
178
|
+
AstNodeKind["TryCatchStatement"] = "TryCatchStatement";
|
|
179
|
+
AstNodeKind["CatchStatement"] = "CatchStatement";
|
|
180
|
+
AstNodeKind["ThrowStatement"] = "ThrowStatement";
|
|
181
|
+
AstNodeKind["EnumStatement"] = "EnumStatement";
|
|
182
|
+
AstNodeKind["EnumMemberStatement"] = "EnumMemberStatement";
|
|
183
|
+
AstNodeKind["ConstStatement"] = "ConstStatement";
|
|
184
|
+
AstNodeKind["ContinueStatement"] = "ContinueStatement";
|
|
185
|
+
AstNodeKind["Block"] = "Block";
|
|
186
|
+
AstNodeKind["TypeExpression"] = "TypeExpression";
|
|
187
|
+
AstNodeKind["TypeCastExpression"] = "TypeCastExpression";
|
|
188
|
+
})(AstNodeKind = exports.AstNodeKind || (exports.AstNodeKind = {}));
|
|
110
189
|
//# sourceMappingURL=AstNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AstNode.js","sourceRoot":"","sources":["../../src/parser/AstNode.ts"],"names":[],"mappings":";;;AACA,mDAAgD;AAEhD,iEAAgE;AAChE,mDAAwD;AAKxD,kCAA2B;
|
|
1
|
+
{"version":3,"file":"AstNode.js","sourceRoot":"","sources":["../../src/parser/AstNode.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,20 +4,26 @@ import type { Range } from 'vscode-languageserver';
|
|
|
4
4
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
5
5
|
import { ParseMode } from './Parser';
|
|
6
6
|
import type { WalkOptions, WalkVisitor } from '../astUtils/visitors';
|
|
7
|
-
import type { TranspileResult, TypedefProvider } from '../interfaces';
|
|
7
|
+
import type { GetTypeOptions, TranspileResult, TypedefProvider } from '../interfaces';
|
|
8
8
|
import type { BscType } from '../types/BscType';
|
|
9
9
|
import { FunctionType } from '../types/FunctionType';
|
|
10
|
-
import { Expression } from './AstNode';
|
|
10
|
+
import { AstNodeKind, Expression } from './AstNode';
|
|
11
11
|
import { SourceNode } from 'source-map';
|
|
12
|
+
import type { TranspileState } from './TranspileState';
|
|
13
|
+
import { StringType } from '../types/StringType';
|
|
14
|
+
import { DynamicType } from '../types/DynamicType';
|
|
15
|
+
import { VoidType } from '../types/VoidType';
|
|
12
16
|
export declare type ExpressionVisitor = (expression: Expression, parent: Expression) => void;
|
|
13
17
|
export declare class BinaryExpression extends Expression {
|
|
14
18
|
left: Expression;
|
|
15
19
|
operator: Token;
|
|
16
20
|
right: Expression;
|
|
17
21
|
constructor(left: Expression, operator: Token, right: Expression);
|
|
22
|
+
readonly kind = AstNodeKind.BinaryExpression;
|
|
18
23
|
readonly range: Range;
|
|
19
24
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
20
25
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
26
|
+
getType(options: GetTypeOptions): BscType;
|
|
21
27
|
}
|
|
22
28
|
export declare class CallExpression extends Expression {
|
|
23
29
|
readonly callee: Expression;
|
|
@@ -33,14 +39,11 @@ export declare class CallExpression extends Expression {
|
|
|
33
39
|
* Can either be `(`, or `?(` for optional chaining
|
|
34
40
|
*/
|
|
35
41
|
openingParen: Token, closingParen: Token, args: Expression[], unused?: any);
|
|
42
|
+
readonly kind = AstNodeKind.CallExpression;
|
|
36
43
|
readonly range: Range;
|
|
37
|
-
/**
|
|
38
|
-
* Get the name of the wrapping namespace (if it exists)
|
|
39
|
-
* @deprecated use `.findAncestor(isNamespaceStatement)` instead.
|
|
40
|
-
*/
|
|
41
|
-
get namespaceName(): NamespacedVariableNameExpression;
|
|
42
44
|
transpile(state: BrsTranspileState, nameOverride?: string): any[];
|
|
43
45
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
46
|
+
getType(options: GetTypeOptions): any;
|
|
44
47
|
}
|
|
45
48
|
export declare class FunctionExpression extends Expression implements TypedefProvider {
|
|
46
49
|
readonly parameters: FunctionParameterExpression[];
|
|
@@ -50,22 +53,9 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
50
53
|
readonly leftParen: Token;
|
|
51
54
|
readonly rightParen: Token;
|
|
52
55
|
readonly asToken?: Token;
|
|
53
|
-
readonly
|
|
54
|
-
constructor(parameters: FunctionParameterExpression[], body: Block, functionType: Token | null, end: Token, leftParen: Token, rightParen: Token, asToken?: Token,
|
|
55
|
-
|
|
56
|
-
* The type this function returns
|
|
57
|
-
*/
|
|
58
|
-
returnType: BscType;
|
|
59
|
-
/**
|
|
60
|
-
* Get the name of the wrapping namespace (if it exists)
|
|
61
|
-
* @deprecated use `.findAncestor(isNamespaceStatement)` instead.
|
|
62
|
-
*/
|
|
63
|
-
get namespaceName(): NamespacedVariableNameExpression;
|
|
64
|
-
/**
|
|
65
|
-
* Get the name of the wrapping namespace (if it exists)
|
|
66
|
-
* @deprecated use `.findAncestor(isFunctionExpression)` instead.
|
|
67
|
-
*/
|
|
68
|
-
get parentFunction(): FunctionExpression;
|
|
56
|
+
readonly returnTypeExpression?: TypeExpression;
|
|
57
|
+
constructor(parameters: FunctionParameterExpression[], body: Block, functionType: Token | null, end: Token, leftParen: Token, rightParen: Token, asToken?: Token, returnTypeExpression?: TypeExpression);
|
|
58
|
+
readonly kind = AstNodeKind.FunctionExpression;
|
|
69
59
|
/**
|
|
70
60
|
* The list of function calls that are declared within this function scope. This excludes CallExpressions
|
|
71
61
|
* declared in child functions
|
|
@@ -75,11 +65,6 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
75
65
|
* If this function is part of a FunctionStatement, this will be set. Otherwise this will be undefined
|
|
76
66
|
*/
|
|
77
67
|
functionStatement?: FunctionStatement;
|
|
78
|
-
/**
|
|
79
|
-
* A list of all child functions declared directly within this function
|
|
80
|
-
* @deprecated use `.walk(createVisitor({ FunctionExpression: ()=>{}), { walkMode: WalkMode.visitAllRecursive })` instead
|
|
81
|
-
*/
|
|
82
|
-
get childFunctionExpressions(): FunctionExpression[];
|
|
83
68
|
/**
|
|
84
69
|
* The range of the function, starting at the 'f' in function or 's' in sub (or the open paren if the keyword is missing),
|
|
85
70
|
* and ending with the last n' in 'end function' or 'b' in 'end sub'
|
|
@@ -88,29 +73,22 @@ export declare class FunctionExpression extends Expression implements TypedefPro
|
|
|
88
73
|
transpile(state: BrsTranspileState, name?: Identifier, includeBody?: boolean): any[];
|
|
89
74
|
getTypedef(state: BrsTranspileState): SourceNode[];
|
|
90
75
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
91
|
-
|
|
76
|
+
getType(options: GetTypeOptions): FunctionType;
|
|
92
77
|
}
|
|
93
78
|
export declare class FunctionParameterExpression extends Expression {
|
|
94
79
|
name: Identifier;
|
|
95
|
-
|
|
80
|
+
equalToken?: Token;
|
|
96
81
|
defaultValue?: Expression;
|
|
97
82
|
asToken?: Token;
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
typeExpression?: TypeExpression;
|
|
84
|
+
constructor(name: Identifier, equalToken?: Token, defaultValue?: Expression, asToken?: Token, typeExpression?: TypeExpression);
|
|
85
|
+
readonly kind = AstNodeKind.FunctionParameterExpression;
|
|
86
|
+
getType(options: GetTypeOptions): BscType;
|
|
100
87
|
get range(): Range;
|
|
101
88
|
transpile(state: BrsTranspileState): any[];
|
|
102
89
|
getTypedef(state: BrsTranspileState): TranspileResult;
|
|
103
90
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
104
91
|
}
|
|
105
|
-
export declare class NamespacedVariableNameExpression extends Expression {
|
|
106
|
-
readonly expression: DottedGetExpression | VariableExpression;
|
|
107
|
-
constructor(expression: DottedGetExpression | VariableExpression);
|
|
108
|
-
range: Range;
|
|
109
|
-
transpile(state: BrsTranspileState): SourceNode[];
|
|
110
|
-
getNameParts(): string[];
|
|
111
|
-
getName(parseMode: ParseMode): string;
|
|
112
|
-
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
113
|
-
}
|
|
114
92
|
export declare class DottedGetExpression extends Expression {
|
|
115
93
|
readonly obj: Expression;
|
|
116
94
|
readonly name: Identifier;
|
|
@@ -123,9 +101,12 @@ export declare class DottedGetExpression extends Expression {
|
|
|
123
101
|
* Can either be `.`, or `?.` for optional chaining
|
|
124
102
|
*/
|
|
125
103
|
dot: Token);
|
|
104
|
+
readonly kind = AstNodeKind.DottedGetExpression;
|
|
126
105
|
readonly range: Range;
|
|
127
106
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
128
107
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
108
|
+
getType(options: GetTypeOptions): BscType;
|
|
109
|
+
getName(parseMode: ParseMode): string;
|
|
129
110
|
}
|
|
130
111
|
export declare class XmlAttributeGetExpression extends Expression {
|
|
131
112
|
readonly obj: Expression;
|
|
@@ -139,6 +120,7 @@ export declare class XmlAttributeGetExpression extends Expression {
|
|
|
139
120
|
* Can either be `@`, or `?@` for optional chaining
|
|
140
121
|
*/
|
|
141
122
|
at: Token);
|
|
123
|
+
readonly kind = AstNodeKind.XmlAttributeGetExpression;
|
|
142
124
|
readonly range: Range;
|
|
143
125
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
144
126
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -157,6 +139,7 @@ export declare class IndexedGetExpression extends Expression {
|
|
|
157
139
|
* Can either be `[` or `?[`. If `?.[` is used, this will be `[` and `optionalChainingToken` will be `?.`
|
|
158
140
|
*/
|
|
159
141
|
openingSquare: Token, closingSquare: Token, questionDotToken?: Token);
|
|
142
|
+
readonly kind = AstNodeKind.IndexedGetExpression;
|
|
160
143
|
readonly range: Range;
|
|
161
144
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
162
145
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -171,18 +154,18 @@ export declare class GroupingExpression extends Expression {
|
|
|
171
154
|
left: Token;
|
|
172
155
|
right: Token;
|
|
173
156
|
}, expression: Expression);
|
|
157
|
+
readonly kind = AstNodeKind.GroupingExpression;
|
|
174
158
|
readonly range: Range;
|
|
175
159
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
176
160
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
161
|
+
getType(options: GetTypeOptions): BscType;
|
|
177
162
|
}
|
|
178
163
|
export declare class LiteralExpression extends Expression {
|
|
179
164
|
token: Token;
|
|
180
165
|
constructor(token: Token);
|
|
166
|
+
readonly kind = AstNodeKind.LiteralExpression;
|
|
181
167
|
get range(): Range;
|
|
182
|
-
|
|
183
|
-
* The (data) type of this expression
|
|
184
|
-
*/
|
|
185
|
-
type: BscType;
|
|
168
|
+
getType(options?: GetTypeOptions): DynamicType | import("..").FloatType | import("..").IntegerType | import("..").DoubleType | import("..").LongIntegerType | StringType | import("..").BooleanType | import("..").InvalidType | VoidType | FunctionType | import("..").ObjectType;
|
|
186
169
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
187
170
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
188
171
|
}
|
|
@@ -197,6 +180,7 @@ export declare class EscapedCharCodeLiteralExpression extends Expression {
|
|
|
197
180
|
constructor(token: Token & {
|
|
198
181
|
charCode: number;
|
|
199
182
|
});
|
|
183
|
+
readonly kind = AstNodeKind.EscapedCharCodeLiteralExpression;
|
|
200
184
|
readonly range: Range;
|
|
201
185
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
202
186
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -207,6 +191,7 @@ export declare class ArrayLiteralExpression extends Expression {
|
|
|
207
191
|
readonly close: Token;
|
|
208
192
|
readonly hasSpread: boolean;
|
|
209
193
|
constructor(elements: Array<Expression | CommentStatement>, open: Token, close: Token, hasSpread?: boolean);
|
|
194
|
+
readonly kind = AstNodeKind.ArrayLiteralExpression;
|
|
210
195
|
readonly range: Range;
|
|
211
196
|
transpile(state: BrsTranspileState): any[];
|
|
212
197
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -219,24 +204,29 @@ export declare class AAMemberExpression extends Expression {
|
|
|
219
204
|
constructor(keyToken: Token, colonToken: Token,
|
|
220
205
|
/** The expression evaluated to determine the member's initial value. */
|
|
221
206
|
value: Expression);
|
|
207
|
+
readonly kind = AstNodeKind.AAMemberExpression;
|
|
222
208
|
range: Range;
|
|
223
209
|
commaToken?: Token;
|
|
224
210
|
transpile(state: BrsTranspileState): any[];
|
|
225
211
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
212
|
+
getType(options: GetTypeOptions): BscType;
|
|
226
213
|
}
|
|
227
214
|
export declare class AALiteralExpression extends Expression {
|
|
228
215
|
readonly elements: Array<AAMemberExpression | CommentStatement>;
|
|
229
216
|
readonly open: Token;
|
|
230
217
|
readonly close: Token;
|
|
231
218
|
constructor(elements: Array<AAMemberExpression | CommentStatement>, open: Token, close: Token);
|
|
219
|
+
readonly kind = AstNodeKind.AALiteralExpression;
|
|
232
220
|
readonly range: Range;
|
|
233
221
|
transpile(state: BrsTranspileState): any[];
|
|
234
222
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
223
|
+
getType(options: GetTypeOptions): BscType;
|
|
235
224
|
}
|
|
236
225
|
export declare class UnaryExpression extends Expression {
|
|
237
226
|
operator: Token;
|
|
238
227
|
right: Expression;
|
|
239
228
|
constructor(operator: Token, right: Expression);
|
|
229
|
+
readonly kind = AstNodeKind.UnaryExpression;
|
|
240
230
|
readonly range: Range;
|
|
241
231
|
transpile(state: BrsTranspileState): (string | SourceNode)[];
|
|
242
232
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -244,15 +234,22 @@ export declare class UnaryExpression extends Expression {
|
|
|
244
234
|
export declare class VariableExpression extends Expression {
|
|
245
235
|
readonly name: Identifier;
|
|
246
236
|
constructor(name: Identifier);
|
|
237
|
+
readonly kind = AstNodeKind.VariableExpression;
|
|
247
238
|
readonly range: Range;
|
|
248
239
|
getName(parseMode: ParseMode): string;
|
|
249
240
|
transpile(state: BrsTranspileState): any[];
|
|
250
241
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
242
|
+
getType(options: GetTypeOptions): BscType;
|
|
251
243
|
}
|
|
252
244
|
export declare class SourceLiteralExpression extends Expression {
|
|
253
245
|
readonly token: Token;
|
|
254
246
|
constructor(token: Token);
|
|
255
247
|
readonly range: Range;
|
|
248
|
+
readonly kind = AstNodeKind.SourceLiteralExpression;
|
|
249
|
+
/**
|
|
250
|
+
* Find the index of the function in its parent
|
|
251
|
+
*/
|
|
252
|
+
private findFunctionIndex;
|
|
256
253
|
private getFunctionName;
|
|
257
254
|
transpile(state: BrsTranspileState): SourceNode[];
|
|
258
255
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -266,13 +263,15 @@ export declare class NewExpression extends Expression {
|
|
|
266
263
|
readonly newKeyword: Token;
|
|
267
264
|
readonly call: CallExpression;
|
|
268
265
|
constructor(newKeyword: Token, call: CallExpression);
|
|
266
|
+
readonly kind = AstNodeKind.NewExpression;
|
|
267
|
+
readonly range: Range;
|
|
269
268
|
/**
|
|
270
269
|
* The name of the class to initialize (with optional namespace prefixed)
|
|
271
270
|
*/
|
|
272
|
-
get className():
|
|
273
|
-
readonly range: Range;
|
|
271
|
+
get className(): DottedGetExpression | VariableExpression;
|
|
274
272
|
transpile(state: BrsTranspileState): any[];
|
|
275
273
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
274
|
+
getType(options: GetTypeOptions): any;
|
|
276
275
|
}
|
|
277
276
|
export declare class CallfuncExpression extends Expression {
|
|
278
277
|
readonly callee: Expression;
|
|
@@ -282,14 +281,11 @@ export declare class CallfuncExpression extends Expression {
|
|
|
282
281
|
readonly args: Expression[];
|
|
283
282
|
readonly closingParen: Token;
|
|
284
283
|
constructor(callee: Expression, operator: Token, methodName: Identifier, openingParen: Token, args: Expression[], closingParen: Token);
|
|
284
|
+
readonly kind = AstNodeKind.CallfuncExpression;
|
|
285
285
|
readonly range: Range;
|
|
286
|
-
/**
|
|
287
|
-
* Get the name of the wrapping namespace (if it exists)
|
|
288
|
-
* @deprecated use `.findAncestor(isNamespaceStatement)` instead.
|
|
289
|
-
*/
|
|
290
|
-
get namespaceName(): NamespacedVariableNameExpression;
|
|
291
286
|
transpile(state: BrsTranspileState): any[];
|
|
292
287
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
288
|
+
getType(options: GetTypeOptions): BscType;
|
|
293
289
|
}
|
|
294
290
|
/**
|
|
295
291
|
* Since template strings can contain newlines, we need to concatenate multiple strings together with chr() calls.
|
|
@@ -298,6 +294,7 @@ export declare class CallfuncExpression extends Expression {
|
|
|
298
294
|
export declare class TemplateStringQuasiExpression extends Expression {
|
|
299
295
|
readonly expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>;
|
|
300
296
|
constructor(expressions: Array<LiteralExpression | EscapedCharCodeLiteralExpression>);
|
|
297
|
+
readonly kind = AstNodeKind.TemplateStringQuasiExpression;
|
|
301
298
|
readonly range: Range;
|
|
302
299
|
transpile(state: BrsTranspileState, skipEmptyStrings?: boolean): any[];
|
|
303
300
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -308,7 +305,9 @@ export declare class TemplateStringExpression extends Expression {
|
|
|
308
305
|
readonly expressions: Expression[];
|
|
309
306
|
readonly closingBacktick: Token;
|
|
310
307
|
constructor(openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
308
|
+
readonly kind = AstNodeKind.TemplateStringExpression;
|
|
311
309
|
readonly range: Range;
|
|
310
|
+
getType(options: GetTypeOptions): StringType;
|
|
312
311
|
transpile(state: BrsTranspileState): any[];
|
|
313
312
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
314
313
|
}
|
|
@@ -319,6 +318,7 @@ export declare class TaggedTemplateStringExpression extends Expression {
|
|
|
319
318
|
readonly expressions: Expression[];
|
|
320
319
|
readonly closingBacktick: Token;
|
|
321
320
|
constructor(tagName: Identifier, openingBacktick: Token, quasis: TemplateStringQuasiExpression[], expressions: Expression[], closingBacktick: Token);
|
|
321
|
+
readonly kind = AstNodeKind.TaggedTemplateStringExpression;
|
|
322
322
|
readonly range: Range;
|
|
323
323
|
transpile(state: BrsTranspileState): any[];
|
|
324
324
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -327,8 +327,9 @@ export declare class AnnotationExpression extends Expression {
|
|
|
327
327
|
readonly atToken: Token;
|
|
328
328
|
readonly nameToken: Token;
|
|
329
329
|
constructor(atToken: Token, nameToken: Token);
|
|
330
|
-
|
|
330
|
+
readonly kind = AstNodeKind.AnnotationExpression;
|
|
331
331
|
range: Range;
|
|
332
|
+
name: string;
|
|
332
333
|
call: CallExpression;
|
|
333
334
|
/**
|
|
334
335
|
* Convert annotation arguments to JavaScript types
|
|
@@ -346,6 +347,7 @@ export declare class TernaryExpression extends Expression {
|
|
|
346
347
|
readonly colonToken?: Token;
|
|
347
348
|
readonly alternate?: Expression;
|
|
348
349
|
constructor(test: Expression, questionMarkToken: Token, consequent?: Expression, colonToken?: Token, alternate?: Expression);
|
|
350
|
+
readonly kind = AstNodeKind.TernaryExpression;
|
|
349
351
|
range: Range;
|
|
350
352
|
transpile(state: BrsTranspileState): any[];
|
|
351
353
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -355,6 +357,7 @@ export declare class NullCoalescingExpression extends Expression {
|
|
|
355
357
|
questionQuestionToken: Token;
|
|
356
358
|
alternate: Expression;
|
|
357
359
|
constructor(consequent: Expression, questionQuestionToken: Token, alternate: Expression);
|
|
360
|
+
readonly kind = AstNodeKind.NullCoalescingExpression;
|
|
358
361
|
readonly range: Range;
|
|
359
362
|
transpile(state: BrsTranspileState): any[];
|
|
360
363
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -366,6 +369,7 @@ export declare class RegexLiteralExpression extends Expression {
|
|
|
366
369
|
constructor(tokens: {
|
|
367
370
|
regexLiteral: Token;
|
|
368
371
|
});
|
|
372
|
+
readonly kind = AstNodeKind.RegexLiteralExpression;
|
|
369
373
|
get range(): Range;
|
|
370
374
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
371
375
|
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
@@ -373,4 +377,34 @@ export declare class RegexLiteralExpression extends Expression {
|
|
|
373
377
|
declare type ExpressionValue = string | number | boolean | Expression | ExpressionValue[] | {
|
|
374
378
|
[key: string]: ExpressionValue;
|
|
375
379
|
};
|
|
380
|
+
export declare class TypeExpression extends Expression implements TypedefProvider {
|
|
381
|
+
/**
|
|
382
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
383
|
+
*/
|
|
384
|
+
expression: Expression;
|
|
385
|
+
constructor(
|
|
386
|
+
/**
|
|
387
|
+
* The standard AST expression that represents the type for this TypeExpression.
|
|
388
|
+
*/
|
|
389
|
+
expression: Expression);
|
|
390
|
+
readonly kind = AstNodeKind.TypeExpression;
|
|
391
|
+
range: Range;
|
|
392
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
393
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
394
|
+
getType(options: GetTypeOptions): BscType;
|
|
395
|
+
getTypedef(state: TranspileState): (string | SourceNode)[];
|
|
396
|
+
getName(parseMode?: ParseMode): string;
|
|
397
|
+
getNameParts(): string[];
|
|
398
|
+
}
|
|
399
|
+
export declare class TypeCastExpression extends Expression {
|
|
400
|
+
obj: Expression;
|
|
401
|
+
asToken?: Token;
|
|
402
|
+
typeExpression?: TypeExpression;
|
|
403
|
+
constructor(obj: Expression, asToken?: Token, typeExpression?: TypeExpression);
|
|
404
|
+
readonly kind = AstNodeKind.TypeCastExpression;
|
|
405
|
+
range: Range;
|
|
406
|
+
transpile(state: BrsTranspileState): TranspileResult;
|
|
407
|
+
walk(visitor: WalkVisitor, options: WalkOptions): void;
|
|
408
|
+
getType(options: GetTypeOptions): BscType;
|
|
409
|
+
}
|
|
376
410
|
export {};
|