brighterscript 0.66.0-alpha.2 → 0.66.0-alpha.4
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 +51 -0
- package/README.md +0 -6
- package/dist/BsConfig.d.ts +0 -5
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CodeActionUtil.d.ts +2 -2
- package/dist/DiagnosticCollection.js +8 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +6 -1
- package/dist/DiagnosticMessages.js +5 -0
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/FunctionScope.d.ts +1 -1
- package/dist/LanguageServer.d.ts +22 -1
- package/dist/LanguageServer.js +124 -51
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +10 -2
- package/dist/Logger.js.map +1 -1
- package/dist/Program.d.ts +1 -3
- package/dist/Program.js +14 -16
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.js +1 -1
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +11 -6
- package/dist/Scope.js +77 -93
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +11 -5
- package/dist/SymbolTable.js +21 -8
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +4 -0
- package/dist/astUtils/reflection.js +9 -1
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +5 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +108 -77
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +83 -29
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +0 -4
- package/dist/bscPlugin/validation/BrsFileValidator.js +10 -16
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +4 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +77 -42
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +715 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/cli.js +103 -13
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +1 -1
- package/dist/deferred.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +5 -0
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +1 -11
- package/dist/files/BrsFile.js +9 -101
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +3 -267
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/globalCallables.js +87 -79
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +11 -5
- package/dist/interfaces.js.map +1 -1
- package/dist/parser/Expression.d.ts +4 -3
- package/dist/parser/Expression.js +32 -9
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/SGParser.d.ts +2 -2
- package/dist/parser/Statement.d.ts +11 -6
- package/dist/parser/Statement.js +54 -21
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +2 -2
- package/dist/types/BaseFunctionType.d.ts +8 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +3 -0
- package/dist/types/BooleanType.js +7 -1
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +1 -0
- package/dist/types/BscTypeKind.js +1 -0
- package/dist/types/BscTypeKind.js.map +1 -1
- package/dist/types/ClassType.js +1 -1
- package/dist/types/ClassType.js.map +1 -1
- package/dist/types/DoubleType.d.ts +3 -0
- package/dist/types/DoubleType.js +6 -0
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/EnumType.d.ts +23 -4
- package/dist/types/EnumType.js +18 -2
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/FloatType.d.ts +3 -0
- package/dist/types/FloatType.js +6 -0
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FunctionType.d.ts +6 -19
- package/dist/types/FunctionType.js +12 -44
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +3 -0
- package/dist/types/IntegerType.js +6 -0
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/InterfaceType.js +3 -3
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InvalidType.d.ts +1 -0
- package/dist/types/InvalidType.js +3 -1
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +3 -0
- package/dist/types/LongIntegerType.js +6 -0
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/ObjectType.js +2 -9
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.spec.js +6 -6
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/types/StringType.d.ts +3 -0
- package/dist/types/StringType.js +9 -1
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +27 -0
- package/dist/types/TypedFunctionType.js +69 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +23 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UnionType.js +1 -1
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/VoidType.js +2 -1
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/util.d.ts +22 -6
- package/dist/util.js +248 -82
- package/dist/util.js.map +1 -1
- package/package.json +4 -2
- package/dist/types/FunctionType.spec.js +0 -23
- package/dist/types/FunctionType.spec.js.map +0 -1
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/validation/ScopeValidator.spec.d.ts} +0 -0
|
@@ -4,6 +4,7 @@ exports.BooleanType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class BooleanType extends BscType_1.BscType {
|
|
8
9
|
constructor(typeText) {
|
|
9
10
|
super();
|
|
@@ -12,7 +13,8 @@ class BooleanType extends BscType_1.BscType {
|
|
|
12
13
|
}
|
|
13
14
|
isTypeCompatible(targetType) {
|
|
14
15
|
return ((0, reflection_1.isBooleanType)(targetType) ||
|
|
15
|
-
(0, reflection_1.isDynamicType)(targetType)
|
|
16
|
+
(0, reflection_1.isDynamicType)(targetType) ||
|
|
17
|
+
(0, reflection_1.isObjectType)(targetType));
|
|
16
18
|
}
|
|
17
19
|
toString() {
|
|
18
20
|
var _a;
|
|
@@ -24,6 +26,10 @@ class BooleanType extends BscType_1.BscType {
|
|
|
24
26
|
isEqual(targetType) {
|
|
25
27
|
return (0, reflection_1.isBooleanType)(targetType);
|
|
26
28
|
}
|
|
29
|
+
getMemberType(memberName, options) {
|
|
30
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
31
|
+
return DynamicType_1.DynamicType.instance;
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
exports.BooleanType = BooleanType;
|
|
29
35
|
BooleanType.instance = new BooleanType('boolean');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanType.js","sourceRoot":"","sources":["../../src/types/BooleanType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BooleanType.js","sourceRoot":"","sources":["../../src/types/BooleanType.ts"],"names":[],"mappings":";;;AAAA,uDAAoF;AAEpF,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,WAAY,SAAQ,iBAAO;IACpC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,WAAW,CAAC;IAF/C,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC,CAC3B,CAAC;IACN,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,SAAS,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,UAAmB;QACvB,OAAO,IAAA,0BAAa,EAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;;AAlCL,kCAmCC;AA1BiB,oBAAQ,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ export declare enum BscTypeKind {
|
|
|
8
8
|
EnumMemberType = "EnumMemberType",
|
|
9
9
|
FloatType = "FloatType",
|
|
10
10
|
FunctionType = "FunctionType",
|
|
11
|
+
TypedFunctionType = "TypedFunctionType",
|
|
11
12
|
IntegerType = "IntegerType",
|
|
12
13
|
InterfaceType = "InterfaceType",
|
|
13
14
|
InvalidType = "InvalidType",
|
|
@@ -12,6 +12,7 @@ var BscTypeKind;
|
|
|
12
12
|
BscTypeKind["EnumMemberType"] = "EnumMemberType";
|
|
13
13
|
BscTypeKind["FloatType"] = "FloatType";
|
|
14
14
|
BscTypeKind["FunctionType"] = "FunctionType";
|
|
15
|
+
BscTypeKind["TypedFunctionType"] = "TypedFunctionType";
|
|
15
16
|
BscTypeKind["IntegerType"] = "IntegerType";
|
|
16
17
|
BscTypeKind["InterfaceType"] = "InterfaceType";
|
|
17
18
|
BscTypeKind["InvalidType"] = "InvalidType";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BscTypeKind.js","sourceRoot":"","sources":["../../src/types/BscTypeKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"BscTypeKind.js","sourceRoot":"","sources":["../../src/types/BscTypeKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAsBX;AAtBD,WAAY,WAAW;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,4CAA6B,CAAA;IAC7B,sDAAuC,CAAA;IACvC,0CAA2B,CAAA;IAC3B,8CAA+B,CAAA;IAC/B,0CAA2B,CAAA;IAC3B,kDAAmC,CAAA;IACnC,8CAA+B,CAAA;IAC/B,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,wCAAyB,CAAA;IACzB,sDAAuC,CAAA;IACvC,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;AACzB,CAAC,EAtBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsBtB"}
|
package/dist/types/ClassType.js
CHANGED
|
@@ -15,7 +15,7 @@ class ClassType extends InheritableType_1.InheritableType {
|
|
|
15
15
|
if (this.isEqual(targetType)) {
|
|
16
16
|
return true;
|
|
17
17
|
}
|
|
18
|
-
else if ((0, reflection_1.isDynamicType)(targetType)) {
|
|
18
|
+
else if ((0, reflection_1.isDynamicType)(targetType) || (0, reflection_1.isObjectType)(targetType)) {
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
21
|
else if ((0, reflection_1.isClassType)(targetType)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassType.js","sourceRoot":"","sources":["../../src/types/ClassType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ClassType.js","sourceRoot":"","sources":["../../src/types/ClassType.ts"],"names":[],"mappings":";;;AAAA,uDAAkF;AAElF,+CAA4C;AAC5C,uDAAoD;AAEpD,MAAa,SAAU,SAAQ,iCAAe;IAE1C,YAAmB,IAAY,EAAkB,UAAoB;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QADT,SAAI,GAAJ,IAAI,CAAQ;QAAkB,eAAU,GAAV,UAAU,CAAU;QAIrD,SAAI,GAAG,yBAAW,CAAC,SAAS,CAAC;IAF7C,CAAC;IAIM,gBAAgB,CAAC,UAAmB;QACvC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC;SACf;aAAM,IAAI,IAAA,0BAAa,EAAC,UAAU,CAAC,IAAI,IAAA,yBAAY,EAAC,UAAU,CAAC,EAAE;YAC9D,OAAO,IAAI,CAAC;SACf;aAAM,IAAI,IAAA,wBAAW,EAAC,UAAU,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;SAC5C;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,UAAmB;QACvB,OAAO,IAAA,wBAAW,EAAC,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAChG,CAAC;CACJ;AAtBD,8BAsBC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
1
2
|
import { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
4
|
+
import { DynamicType } from './DynamicType';
|
|
3
5
|
export declare class DoubleType extends BscType {
|
|
4
6
|
typeText?: string;
|
|
5
7
|
constructor(typeText?: string);
|
|
@@ -9,4 +11,5 @@ export declare class DoubleType extends BscType {
|
|
|
9
11
|
toString(): string;
|
|
10
12
|
toTypeString(): string;
|
|
11
13
|
isEqual(targetType: BscType): boolean;
|
|
14
|
+
getMemberType(memberName: string, options: GetTypeOptions): DynamicType;
|
|
12
15
|
}
|
package/dist/types/DoubleType.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.DoubleType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class DoubleType extends BscType_1.BscType {
|
|
8
9
|
constructor(typeText) {
|
|
9
10
|
super();
|
|
@@ -12,6 +13,7 @@ class DoubleType extends BscType_1.BscType {
|
|
|
12
13
|
}
|
|
13
14
|
isTypeCompatible(targetType) {
|
|
14
15
|
return ((0, reflection_1.isDynamicType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType) ||
|
|
15
17
|
(0, reflection_1.isIntegerType)(targetType) ||
|
|
16
18
|
(0, reflection_1.isFloatType)(targetType) ||
|
|
17
19
|
(0, reflection_1.isDoubleType)(targetType) ||
|
|
@@ -27,6 +29,10 @@ class DoubleType extends BscType_1.BscType {
|
|
|
27
29
|
isEqual(targetType) {
|
|
28
30
|
return (0, reflection_1.isDoubleType)(targetType);
|
|
29
31
|
}
|
|
32
|
+
getMemberType(memberName, options) {
|
|
33
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
34
|
+
return DynamicType_1.DynamicType.instance;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
exports.DoubleType = DoubleType;
|
|
32
38
|
DoubleType.instance = new DoubleType('double');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleType.js","sourceRoot":"","sources":["../../src/types/DoubleType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"DoubleType.js","sourceRoot":"","sources":["../../src/types/DoubleType.ts"],"names":[],"mappings":";;;AAAA,uDAAkI;AAElI,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAG5C,MAAa,UAAW,SAAQ,iBAAO;IACnC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,UAAU,CAAC;IAF9C,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,wBAAW,EAAC,UAAU,CAAC;YACvB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAChC,CAAC;IACN,CAAC;IACM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,QAAQ,CAAC;IACrC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAEM,OAAO,CAAC,UAAmB;QAC9B,OAAO,IAAA,yBAAY,EAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;;AApCL,gCAqCC;AA5BiB,mBAAQ,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/types/EnumType.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
1
2
|
import { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
4
|
+
import { DynamicType } from './DynamicType';
|
|
3
5
|
export declare class EnumType extends BscType {
|
|
4
6
|
name: string;
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
9
|
+
*/
|
|
10
|
+
underlyingType: BscType;
|
|
11
|
+
constructor(name: string,
|
|
12
|
+
/**
|
|
13
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
14
|
+
*/
|
|
15
|
+
underlyingType?: BscType);
|
|
6
16
|
readonly kind = BscTypeKind.EnumType;
|
|
7
|
-
isTypeCompatible(targetType: BscType):
|
|
17
|
+
isTypeCompatible(targetType: BscType): boolean;
|
|
8
18
|
toString(): string;
|
|
9
19
|
toTypeString(): string;
|
|
10
20
|
isEqual(targetType: BscType): boolean;
|
|
@@ -12,11 +22,20 @@ export declare class EnumType extends BscType {
|
|
|
12
22
|
export declare class EnumMemberType extends BscType {
|
|
13
23
|
enumName: string;
|
|
14
24
|
memberName: string;
|
|
15
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
27
|
+
*/
|
|
28
|
+
underlyingType: BscType;
|
|
29
|
+
constructor(enumName: string, memberName: string,
|
|
30
|
+
/**
|
|
31
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
32
|
+
*/
|
|
33
|
+
underlyingType?: BscType);
|
|
16
34
|
readonly kind = BscTypeKind.EnumMemberType;
|
|
17
|
-
isAssignableTo(targetType: BscType):
|
|
35
|
+
isAssignableTo(targetType: BscType): boolean;
|
|
18
36
|
isTypeCompatible(targetType: BscType): boolean;
|
|
19
37
|
toString(): string;
|
|
20
38
|
toTypeString(): string;
|
|
21
39
|
isEqual(targetType: BscType): boolean;
|
|
40
|
+
getMemberType(memberName: string, options: GetTypeOptions): DynamicType;
|
|
22
41
|
}
|
package/dist/types/EnumType.js
CHANGED
|
@@ -4,14 +4,21 @@ exports.EnumMemberType = exports.EnumType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class EnumType extends BscType_1.BscType {
|
|
8
|
-
constructor(name
|
|
9
|
+
constructor(name,
|
|
10
|
+
/**
|
|
11
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
12
|
+
*/
|
|
13
|
+
underlyingType = DynamicType_1.DynamicType.instance) {
|
|
9
14
|
super(name);
|
|
10
15
|
this.name = name;
|
|
16
|
+
this.underlyingType = underlyingType;
|
|
11
17
|
this.kind = BscTypeKind_1.BscTypeKind.EnumType;
|
|
12
18
|
}
|
|
13
19
|
isTypeCompatible(targetType) {
|
|
14
20
|
return ((0, reflection_1.isDynamicType)(targetType) ||
|
|
21
|
+
(0, reflection_1.isObjectType)(targetType) ||
|
|
15
22
|
this.isEqual(targetType) ||
|
|
16
23
|
((0, reflection_1.isEnumMemberType)(targetType) && (targetType === null || targetType === void 0 ? void 0 : targetType.enumName.toLowerCase()) === this.name.toLowerCase()));
|
|
17
24
|
}
|
|
@@ -27,10 +34,15 @@ class EnumType extends BscType_1.BscType {
|
|
|
27
34
|
}
|
|
28
35
|
exports.EnumType = EnumType;
|
|
29
36
|
class EnumMemberType extends BscType_1.BscType {
|
|
30
|
-
constructor(enumName, memberName
|
|
37
|
+
constructor(enumName, memberName,
|
|
38
|
+
/**
|
|
39
|
+
* The runtime type for this enum (i.e. what type the value will be transpiled into)
|
|
40
|
+
*/
|
|
41
|
+
underlyingType = DynamicType_1.DynamicType.instance) {
|
|
31
42
|
super(`${enumName}.${memberName}`);
|
|
32
43
|
this.enumName = enumName;
|
|
33
44
|
this.memberName = memberName;
|
|
45
|
+
this.underlyingType = underlyingType;
|
|
34
46
|
this.kind = BscTypeKind_1.BscTypeKind.EnumMemberType;
|
|
35
47
|
}
|
|
36
48
|
isAssignableTo(targetType) {
|
|
@@ -54,6 +66,10 @@ class EnumMemberType extends BscType_1.BscType {
|
|
|
54
66
|
(targetType === null || targetType === void 0 ? void 0 : targetType.enumName.toLowerCase()) === this.enumName.toLowerCase() &&
|
|
55
67
|
(targetType === null || targetType === void 0 ? void 0 : targetType.memberName.toLowerCase()) === this.memberName.toLowerCase();
|
|
56
68
|
}
|
|
69
|
+
getMemberType(memberName, options) {
|
|
70
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
71
|
+
return DynamicType_1.DynamicType.instance;
|
|
72
|
+
}
|
|
57
73
|
}
|
|
58
74
|
exports.EnumMemberType = EnumMemberType;
|
|
59
75
|
//# sourceMappingURL=EnumType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumType.js","sourceRoot":"","sources":["../../src/types/EnumType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"EnumType.js","sourceRoot":"","sources":["../../src/types/EnumType.ts"],"names":[],"mappings":";;;AAAA,uDAAmG;AAEnG,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,QAAS,SAAQ,iBAAO;IACjC,YACW,IAAY;IACnB;;OAEG;IACI,iBAA0B,yBAAW,CAAC,QAAQ;QAErD,KAAK,CAAC,IAAI,CAAC,CAAC;QANL,SAAI,GAAJ,IAAI,CAAQ;QAIZ,mBAAc,GAAd,cAAc,CAAgC;QAKzC,SAAI,GAAG,yBAAW,CAAC,QAAQ,CAAC;IAF5C,CAAC;IAIM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACxB,CAAC,IAAA,6BAAgB,EAAC,UAAU,CAAC,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAC,WAAW,EAAE,MAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CACnG,CAAC;IACN,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAEM,YAAY;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,OAAO,CAAC,UAAmB;QAC9B,OAAO,IAAA,uBAAU,EAAC,UAAU,CAAC,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAC,WAAW,EAAE,MAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAChG,CAAC;CACJ;AAjCD,4BAiCC;AAGD,MAAa,cAAe,SAAQ,iBAAO;IACvC,YACW,QAAgB,EAChB,UAAkB;IACzB;;OAEG;IACI,iBAA0B,yBAAW,CAAC,QAAQ;QAErD,KAAK,CAAC,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC;QAP5B,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;QAIlB,mBAAc,GAAd,cAAc,CAAgC;QAKzC,SAAI,GAAG,yBAAW,CAAC,cAAc,CAAC;IAFlD,CAAC;IAIM,cAAc,CAAC,UAAmB;QACrC,OAAO,CACH,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACxB,CAAC,IAAA,uBAAU,EAAC,UAAU,CAAC;gBACnB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAC,WAAW,EAAE,MAAK,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;YACnE,IAAA,0BAAa,EAAC,UAAU,CAAC,CAC5B,CAAC;IACN,CAAC;IAEM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACxB,IAAA,0BAAa,EAAC,UAAU,CAAC,CAC5B,CAAC;IACN,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAEM,YAAY;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,OAAO,CAAC,UAAmB;QAC9B,OAAO,IAAA,6BAAgB,EAAC,UAAU,CAAC;YAC/B,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAC,WAAW,EAAE,MAAK,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAClE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,CAAC,WAAW,EAAE,MAAK,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IAC/E,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;CACJ;AAhDD,wCAgDC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
1
2
|
import { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
4
|
+
import { DynamicType } from './DynamicType';
|
|
3
5
|
export declare class FloatType extends BscType {
|
|
4
6
|
typeText?: string;
|
|
5
7
|
constructor(typeText?: string);
|
|
@@ -9,4 +11,5 @@ export declare class FloatType extends BscType {
|
|
|
9
11
|
toString(): string;
|
|
10
12
|
toTypeString(): string;
|
|
11
13
|
isEqual(targetType: BscType): boolean;
|
|
14
|
+
getMemberType(memberName: string, options: GetTypeOptions): DynamicType;
|
|
12
15
|
}
|
package/dist/types/FloatType.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.FloatType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class FloatType extends BscType_1.BscType {
|
|
8
9
|
constructor(typeText) {
|
|
9
10
|
super();
|
|
@@ -12,6 +13,7 @@ class FloatType extends BscType_1.BscType {
|
|
|
12
13
|
}
|
|
13
14
|
isTypeCompatible(targetType) {
|
|
14
15
|
return ((0, reflection_1.isDynamicType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType) ||
|
|
15
17
|
(0, reflection_1.isIntegerType)(targetType) ||
|
|
16
18
|
(0, reflection_1.isFloatType)(targetType) ||
|
|
17
19
|
(0, reflection_1.isDoubleType)(targetType) ||
|
|
@@ -27,6 +29,10 @@ class FloatType extends BscType_1.BscType {
|
|
|
27
29
|
isEqual(targetType) {
|
|
28
30
|
return (0, reflection_1.isFloatType)(targetType);
|
|
29
31
|
}
|
|
32
|
+
getMemberType(memberName, options) {
|
|
33
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
34
|
+
return DynamicType_1.DynamicType.instance;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
exports.FloatType = FloatType;
|
|
32
38
|
FloatType.instance = new FloatType('float');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatType.js","sourceRoot":"","sources":["../../src/types/FloatType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"FloatType.js","sourceRoot":"","sources":["../../src/types/FloatType.ts"],"names":[],"mappings":";;;AAAA,uDAAkI;AAElI,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,SAAU,SAAQ,iBAAO;IAClC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,SAAS,CAAC;IAF7C,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,wBAAW,EAAC,UAAU,CAAC;YACvB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAChC,CAAC;IAEN,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,OAAO,CAAC;IACpC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAEM,OAAO,CAAC,UAAmB;QAC9B,OAAO,IAAA,wBAAW,EAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;;AAtCL,8BAuCC;AA9BiB,kBAAQ,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseFunctionType } from './BaseFunctionType';
|
|
2
|
+
import type { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
3
|
-
export declare class FunctionType extends
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
4
|
+
export declare class FunctionType extends BaseFunctionType {
|
|
5
|
+
typeText?: string;
|
|
6
|
+
constructor(typeText?: string);
|
|
6
7
|
readonly kind = BscTypeKind.FunctionType;
|
|
7
|
-
|
|
8
|
-
* The name of the function for this type. Can be null
|
|
9
|
-
*/
|
|
10
|
-
name: string;
|
|
11
|
-
/**
|
|
12
|
-
* Determines if this is a sub or not
|
|
13
|
-
*/
|
|
14
|
-
isSub: boolean;
|
|
15
|
-
params: {
|
|
16
|
-
name: string;
|
|
17
|
-
type: BscType;
|
|
18
|
-
isOptional: boolean;
|
|
19
|
-
}[];
|
|
20
|
-
setName(name: string): this;
|
|
21
|
-
addParameter(name: string, type: BscType, isOptional: boolean): this;
|
|
8
|
+
static instance: FunctionType;
|
|
22
9
|
isTypeCompatible(targetType: BscType): boolean;
|
|
23
10
|
toString(): string;
|
|
24
11
|
toTypeString(): string;
|
|
@@ -2,68 +2,36 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FunctionType = void 0;
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
|
-
const
|
|
5
|
+
const BaseFunctionType_1 = require("./BaseFunctionType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(returnType) {
|
|
7
|
+
class FunctionType extends BaseFunctionType_1.BaseFunctionType {
|
|
8
|
+
constructor(typeText) {
|
|
10
9
|
super();
|
|
11
|
-
this.
|
|
10
|
+
this.typeText = typeText;
|
|
12
11
|
this.kind = BscTypeKind_1.BscTypeKind.FunctionType;
|
|
13
|
-
/**
|
|
14
|
-
* Determines if this is a sub or not
|
|
15
|
-
*/
|
|
16
|
-
this.isSub = false;
|
|
17
|
-
this.params = [];
|
|
18
|
-
}
|
|
19
|
-
setName(name) {
|
|
20
|
-
this.name = name;
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
addParameter(name, type, isOptional) {
|
|
24
|
-
this.params.push({
|
|
25
|
-
name: name,
|
|
26
|
-
type: type,
|
|
27
|
-
isOptional: isOptional === true ? true : false
|
|
28
|
-
});
|
|
29
|
-
return this;
|
|
30
12
|
}
|
|
31
13
|
isTypeCompatible(targetType) {
|
|
32
|
-
if (
|
|
14
|
+
if ((0, reflection_1.isDynamicType)(targetType) ||
|
|
15
|
+
(0, reflection_1.isCallableType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType)) {
|
|
33
17
|
return true;
|
|
34
18
|
}
|
|
35
|
-
return
|
|
19
|
+
return false;
|
|
36
20
|
}
|
|
37
21
|
toString() {
|
|
38
|
-
|
|
39
|
-
for (let param of this.params) {
|
|
40
|
-
paramTexts.push(`${param.name}${param.isOptional ? '?' : ''} as ${param.type.toString()}`);
|
|
41
|
-
}
|
|
42
|
-
return `${this.isSub ? 'sub' : 'function'} ${this.name}(${paramTexts.join(', ')}) as ${this.returnType.toString()}`;
|
|
22
|
+
return this.toTypeString();
|
|
43
23
|
}
|
|
44
24
|
toTypeString() {
|
|
45
|
-
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = this.typeText) !== null && _a !== void 0 ? _a : 'function';
|
|
46
27
|
}
|
|
47
28
|
isEqual(targetType) {
|
|
48
29
|
if ((0, reflection_1.isFunctionType)(targetType)) {
|
|
49
|
-
//compare all parameters
|
|
50
|
-
let len = Math.max(this.params.length, targetType.params.length);
|
|
51
|
-
for (let i = 0; i < len; i++) {
|
|
52
|
-
let myParam = this.params[i];
|
|
53
|
-
let targetParam = targetType.params[i];
|
|
54
|
-
if (!myParam || !targetParam || !myParam.type.isAssignableTo(targetParam.type)) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
//compare return type
|
|
59
|
-
if (!this.returnType || !targetType.returnType || !this.returnType.isAssignableTo(targetType.returnType)) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
//made it here, all params and return type are equivalent
|
|
63
30
|
return true;
|
|
64
31
|
}
|
|
65
32
|
return false;
|
|
66
33
|
}
|
|
67
34
|
}
|
|
68
35
|
exports.FunctionType = FunctionType;
|
|
36
|
+
FunctionType.instance = new FunctionType('function');
|
|
69
37
|
//# sourceMappingURL=FunctionType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionType.js","sourceRoot":"","sources":["../../src/types/FunctionType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"FunctionType.js","sourceRoot":"","sources":["../../src/types/FunctionType.ts"],"names":[],"mappings":";;;AAAA,uDAAqG;AACrG,yDAAsD;AAEtD,+CAA4C;AAE5C,MAAa,YAAa,SAAQ,mCAAgB;IAC9C,YAAmB,QAAiB;QAChC,KAAK,EAAE,CAAC;QADO,aAAQ,GAAR,QAAQ,CAAS;QAIpB,SAAI,GAAG,yBAAW,CAAC,YAAY,CAAC;IAFhD,CAAC;IAQM,gBAAgB,CAAC,UAAmB;QACvC,IACI,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,2BAAc,EAAC,UAAU,CAAC;YAC1B,IAAA,yBAAY,EAAC,UAAU,CAAC,EAC1B;YACE,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAE/B,CAAC;IAEM,YAAY;;QACf,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,UAAU,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,UAAmB;QACvB,IAAI,IAAA,2BAAc,EAAC,UAAU,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;;AApCL,oCAqCC;AA7BiB,qBAAQ,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
1
2
|
import { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
4
|
+
import { DynamicType } from './DynamicType';
|
|
3
5
|
export declare class IntegerType extends BscType {
|
|
4
6
|
typeText?: string;
|
|
5
7
|
constructor(typeText?: string);
|
|
@@ -9,4 +11,5 @@ export declare class IntegerType extends BscType {
|
|
|
9
11
|
toString(): string;
|
|
10
12
|
toTypeString(): string;
|
|
11
13
|
isEqual(otherType: BscType): boolean;
|
|
14
|
+
getMemberType(memberName: string, options: GetTypeOptions): DynamicType;
|
|
12
15
|
}
|
|
@@ -4,6 +4,7 @@ exports.IntegerType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class IntegerType extends BscType_1.BscType {
|
|
8
9
|
constructor(typeText) {
|
|
9
10
|
super();
|
|
@@ -12,6 +13,7 @@ class IntegerType extends BscType_1.BscType {
|
|
|
12
13
|
}
|
|
13
14
|
isTypeCompatible(targetType) {
|
|
14
15
|
return ((0, reflection_1.isDynamicType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType) ||
|
|
15
17
|
(0, reflection_1.isIntegerType)(targetType) ||
|
|
16
18
|
(0, reflection_1.isFloatType)(targetType) ||
|
|
17
19
|
(0, reflection_1.isDoubleType)(targetType) ||
|
|
@@ -27,6 +29,10 @@ class IntegerType extends BscType_1.BscType {
|
|
|
27
29
|
isEqual(otherType) {
|
|
28
30
|
return (0, reflection_1.isIntegerType)(otherType);
|
|
29
31
|
}
|
|
32
|
+
getMemberType(memberName, options) {
|
|
33
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
34
|
+
return DynamicType_1.DynamicType.instance;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
exports.IntegerType = IntegerType;
|
|
32
38
|
IntegerType.instance = new IntegerType('integer');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerType.js","sourceRoot":"","sources":["../../src/types/IntegerType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"IntegerType.js","sourceRoot":"","sources":["../../src/types/IntegerType.ts"],"names":[],"mappings":";;;AAAA,uDAAkI;AAElI,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,WAAY,SAAQ,iBAAO;IACpC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,WAAW,CAAC;IAF/C,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,wBAAW,EAAC,UAAU,CAAC;YACvB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAChC,CAAC;IACN,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,SAAS,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,SAAkB;QACtB,OAAO,IAAA,0BAAa,EAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;;AArCL,kCAsCC;AA7BiB,oBAAQ,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -13,11 +13,11 @@ class InterfaceType extends InheritableType_1.InheritableType {
|
|
|
13
13
|
this.kind = BscTypeKind_1.BscTypeKind.InterfaceType;
|
|
14
14
|
}
|
|
15
15
|
isTypeCompatible(targetType) {
|
|
16
|
-
|
|
17
|
-
if (this.isEqual(targetType)) {
|
|
16
|
+
if ((0, reflection_1.isDynamicType)(targetType) || (0, reflection_1.isObjectType)(targetType)) {
|
|
18
17
|
return true;
|
|
19
18
|
}
|
|
20
|
-
|
|
19
|
+
//TODO: We need to make sure that things don't get assigned to built-in types
|
|
20
|
+
if (this.isEqual(targetType)) {
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
const ancestorTypes = this.getAncestorTypeList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterfaceType.js","sourceRoot":"","sources":["../../src/types/InterfaceType.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"InterfaceType.js","sourceRoot":"","sources":["../../src/types/InterfaceType.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,uDAAsH;AAEtH,+CAA4C;AAC5C,uDAAoD;AAEpD,MAAa,aAAc,SAAQ,iCAAe;IAC9C,YACW,IAAY,EACH,cAAwB;QAExC,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAHrB,SAAI,GAAJ,IAAI,CAAQ;QACH,mBAAc,GAAd,cAAc,CAAU;QAK5B,SAAI,GAAG,yBAAW,CAAC,aAAa,CAAC;IAFjD,CAAC;IAIM,gBAAgB,CAAC,UAAmB;QACvC,IAAI,IAAA,0BAAa,EAAC,UAAU,CAAC,IAAI,IAAA,yBAAY,EAAC,UAAU,CAAC,EAAE;YACvD,OAAO,IAAI,CAAC;SACf;QACD,6EAA6E;QAC7E,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC;SACf;QACD,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACjD,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE;YACvE,OAAO,IAAI,CAAC;SACf;QACD,IAAI,IAAA,8BAAiB,EAAC,UAAU,CAAC,IAAI,IAAA,wBAAW,EAAC,UAAU,CAAC,EAAE;YAC1D,OAAO,IAAI,CAAC,gCAAgC,CAAC,UAAU,EAAE,4BAAc,CAAC,OAAO,CAAC,CAAC;SACpF;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,UAAmB;QACvB,OAAO,IAAA,4BAAe,EAAC,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACpG,CAAC;CACJ;AAlCD,sCAkCC"}
|
|
@@ -4,6 +4,7 @@ export declare class InvalidType extends BscType {
|
|
|
4
4
|
typeText?: string;
|
|
5
5
|
constructor(typeText?: string);
|
|
6
6
|
readonly kind = BscTypeKind.InvalidType;
|
|
7
|
+
static instance: InvalidType;
|
|
7
8
|
isTypeCompatible(targetType: BscType): boolean;
|
|
8
9
|
toString(): string;
|
|
9
10
|
toTypeString(): string;
|
|
@@ -12,7 +12,8 @@ class InvalidType extends BscType_1.BscType {
|
|
|
12
12
|
}
|
|
13
13
|
isTypeCompatible(targetType) {
|
|
14
14
|
return ((0, reflection_1.isInvalidType)(targetType) ||
|
|
15
|
-
(0, reflection_1.isDynamicType)(targetType)
|
|
15
|
+
(0, reflection_1.isDynamicType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType));
|
|
16
17
|
}
|
|
17
18
|
toString() {
|
|
18
19
|
var _a;
|
|
@@ -26,4 +27,5 @@ class InvalidType extends BscType_1.BscType {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
exports.InvalidType = InvalidType;
|
|
30
|
+
InvalidType.instance = new InvalidType('invalid');
|
|
29
31
|
//# sourceMappingURL=InvalidType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidType.js","sourceRoot":"","sources":["../../src/types/InvalidType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"InvalidType.js","sourceRoot":"","sources":["../../src/types/InvalidType.ts"],"names":[],"mappings":";;;AAAA,uDAAoF;AACpF,uCAAoC;AACpC,+CAA4C;AAE5C,MAAa,WAAY,SAAQ,iBAAO;IACpC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,WAAW,CAAC;IAF/C,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC,CAC3B,CAAC;IACN,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,SAAS,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,UAAmB;QACvB,OAAO,IAAA,0BAAa,EAAC,UAAU,CAAC,CAAC;IACrC,CAAC;;AA7BL,kCA8BC;AArBiB,oBAAQ,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
1
2
|
import { BscType } from './BscType';
|
|
2
3
|
import { BscTypeKind } from './BscTypeKind';
|
|
4
|
+
import { DynamicType } from './DynamicType';
|
|
3
5
|
export declare class LongIntegerType extends BscType {
|
|
4
6
|
typeText?: string;
|
|
5
7
|
constructor(typeText?: string);
|
|
@@ -9,4 +11,5 @@ export declare class LongIntegerType extends BscType {
|
|
|
9
11
|
toString(): string;
|
|
10
12
|
toTypeString(): string;
|
|
11
13
|
isEqual(targetType: BscType): boolean;
|
|
14
|
+
getMemberType(memberName: string, options: GetTypeOptions): DynamicType;
|
|
12
15
|
}
|
|
@@ -4,6 +4,7 @@ exports.LongIntegerType = void 0;
|
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
const BscType_1 = require("./BscType");
|
|
6
6
|
const BscTypeKind_1 = require("./BscTypeKind");
|
|
7
|
+
const DynamicType_1 = require("./DynamicType");
|
|
7
8
|
class LongIntegerType extends BscType_1.BscType {
|
|
8
9
|
constructor(typeText) {
|
|
9
10
|
super();
|
|
@@ -12,6 +13,7 @@ class LongIntegerType extends BscType_1.BscType {
|
|
|
12
13
|
}
|
|
13
14
|
isTypeCompatible(targetType) {
|
|
14
15
|
return ((0, reflection_1.isDynamicType)(targetType) ||
|
|
16
|
+
(0, reflection_1.isObjectType)(targetType) ||
|
|
15
17
|
(0, reflection_1.isIntegerType)(targetType) ||
|
|
16
18
|
(0, reflection_1.isFloatType)(targetType) ||
|
|
17
19
|
(0, reflection_1.isDoubleType)(targetType) ||
|
|
@@ -27,6 +29,10 @@ class LongIntegerType extends BscType_1.BscType {
|
|
|
27
29
|
isEqual(targetType) {
|
|
28
30
|
return (0, reflection_1.isLongIntegerType)(targetType);
|
|
29
31
|
}
|
|
32
|
+
getMemberType(memberName, options) {
|
|
33
|
+
//TODO: this should really add the appropriate interface methods from roku-types
|
|
34
|
+
return DynamicType_1.DynamicType.instance;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
exports.LongIntegerType = LongIntegerType;
|
|
32
38
|
LongIntegerType.instance = new LongIntegerType('longinteger');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LongIntegerType.js","sourceRoot":"","sources":["../../src/types/LongIntegerType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"LongIntegerType.js","sourceRoot":"","sources":["../../src/types/LongIntegerType.ts"],"names":[],"mappings":";;;AAAA,uDAAkI;AAElI,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,eAAgB,SAAQ,iBAAO;IACxC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,eAAe,CAAC;IAFnD,CAAC;IAMM,gBAAgB,CAAC,UAAmB;QACvC,OAAO,CACH,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,0BAAa,EAAC,UAAU,CAAC;YACzB,IAAA,wBAAW,EAAC,UAAU,CAAC;YACvB,IAAA,yBAAY,EAAC,UAAU,CAAC;YACxB,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAChC,CAAC;IACN,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,aAAa,CAAC;IAC1C,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,UAAmB;QACvB,OAAO,IAAA,8BAAiB,EAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,aAAa,CAAC,UAAkB,EAAE,OAAuB;QACrD,gFAAgF;QAChF,OAAO,yBAAW,CAAC,QAAQ,CAAC;IAChC,CAAC;;AArCL,0CAsCC;AA7BiB,wBAAQ,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/types/ObjectType.js
CHANGED
|
@@ -13,15 +13,8 @@ class ObjectType extends BscType_1.BscType {
|
|
|
13
13
|
this.kind = BscTypeKind_1.BscTypeKind.ObjectType;
|
|
14
14
|
}
|
|
15
15
|
isTypeCompatible(targetType) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
else if ((0, reflection_1.isObjectType)(targetType) ||
|
|
20
|
-
(0, reflection_1.isDynamicType)(targetType) ||
|
|
21
|
-
(0, reflection_1.isInheritableType)(targetType)) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
16
|
+
//Brightscript allows anything passed "as object", so as long as a type is provided, this is true
|
|
17
|
+
return !!targetType;
|
|
25
18
|
}
|
|
26
19
|
toString() {
|
|
27
20
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectType.js","sourceRoot":"","sources":["../../src/types/ObjectType.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"ObjectType.js","sourceRoot":"","sources":["../../src/types/ObjectType.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,uDAAsD;AAEtD,uCAAoC;AACpC,+CAA4C;AAC5C,+CAA4C;AAE5C,MAAa,UAAW,SAAQ,iBAAO;IACnC,YACW,QAAiB;QAExB,KAAK,EAAE,CAAC;QAFD,aAAQ,GAAR,QAAQ,CAAS;QAKZ,SAAI,GAAG,yBAAW,CAAC,UAAU,CAAC;IAF9C,CAAC;IAIM,gBAAgB,CAAC,UAAmB;QACvC,iGAAiG;QACjG,OAAO,CAAC,CAAC,UAAU,CAAC;IACxB,CAAC;IAEM,QAAQ;;QACX,OAAO,MAAA,IAAI,CAAC,QAAQ,mCAAI,QAAQ,CAAC;IACrC,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,OAAuB;;QAC/C,gEAAgE;QAChE,mHAAmH;QACnH,OAAO,MAAA,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,mCAAI,yBAAW,CAAC,QAAQ,CAAC;IACtE,CAAC;IAED,OAAO,CAAC,SAAkB;QACtB,OAAO,IAAA,yBAAY,EAAC,SAAS,CAAC,IAAI,IAAI,CAAC,gCAAgC,CAAC,SAAS,EAAE,4BAAc,CAAC,OAAO,CAAC,CAAC;IAC/G,CAAC;CACJ;AA/BD,gCA+BC"}
|