pxt-core 8.2.13 → 8.2.14
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/built/buildengine.js +3 -3
- package/built/cli.js +5 -5
- package/built/gdb.js +4 -4
- package/built/nodeutil.d.ts +1 -0
- package/built/pxt.js +360 -360
- package/built/pxtblockly.js +35 -35
- package/built/pxtblocks.js +35 -35
- package/built/pxtcompiler.js +156 -156
- package/built/pxteditor.d.ts +15 -3
- package/built/pxteditor.js +6 -6
- package/built/pxtlib.d.ts +2 -1
- package/built/pxtlib.js +162 -161
- package/built/pxtpy.js +34 -35
- package/built/pxtsim.d.ts +5 -5
- package/built/pxtsim.js +3 -3
- package/built/server.js +5 -5
- package/built/storage.js +4 -4
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxteditor.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtpy.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/js/2.960f04a5.chunk.js +2 -0
- package/built/web/skillmap/js/main.44b2383f.chunk.js +1 -0
- package/common-docs/static/logo/social-buttons/google-classroom.png +0 -0
- package/common-docs/static/logo/social-buttons/microsoft-teams.png +0 -0
- package/docfiles/pxtweb/tsconfig.json +2 -1
- package/localtypings/dom.d.ts +3 -0
- package/localtypings/react.d.ts +1 -1
- package/package.json +6 -6
- package/react-common/components/controls/Modal.tsx +2 -2
- package/react-common/components/share/ShareInfo.tsx +1 -1
- package/react-common/tsconfig.json +3 -2
- package/theme/common.less +5 -3
- package/theme/highcontrast.less +3 -0
- package/theme/toolbox.less +25 -0
- package/theme/tutorial-sidebar.less +171 -115
- package/webapp/public/skillmap.html +1 -1
- package/built/web/skillmap/js/2.26325281.chunk.js +0 -2
- package/built/web/skillmap/js/main.d94a2bd9.chunk.js +0 -1
package/built/pxt.js
CHANGED
|
@@ -101488,7 +101488,7 @@ var pxt;
|
|
|
101488
101488
|
definitionNameToParam: {},
|
|
101489
101489
|
handlerArgs: []
|
|
101490
101490
|
};
|
|
101491
|
-
const instance = (fn.kind == 1 /* Method */ || fn.kind == 2 /* Property */) && !fn.attributes.defaultInstance;
|
|
101491
|
+
const instance = (fn.kind == 1 /* ts.pxtc.SymbolKind.Method */ || fn.kind == 2 /* ts.pxtc.SymbolKind.Property */) && !fn.attributes.defaultInstance;
|
|
101492
101492
|
const hasBlockDef = !!fn.attributes._def;
|
|
101493
101493
|
const defParameters = hasBlockDef ? fn.attributes._def.parameters.slice(0) : undefined;
|
|
101494
101494
|
const optionalStart = hasBlockDef ? defParameters.length : (fn.parameters ? fn.parameters.length : 0);
|
|
@@ -102147,6 +102147,7 @@ var pxt;
|
|
|
102147
102147
|
}
|
|
102148
102148
|
})(blocks = pxt.blocks || (pxt.blocks = {}));
|
|
102149
102149
|
})(pxt || (pxt = {}));
|
|
102150
|
+
/// <reference path="../localtypings/dom.d.ts" />
|
|
102150
102151
|
var pxt;
|
|
102151
102152
|
(function (pxt) {
|
|
102152
102153
|
var BrowserUtils;
|
|
@@ -110685,7 +110686,7 @@ var pxt;
|
|
|
110685
110686
|
}
|
|
110686
110687
|
sprite_1.base64EncodeBitmap = base64EncodeBitmap;
|
|
110687
110688
|
function getFixedInstanceDropdownValues(apis, qName) {
|
|
110688
|
-
return pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* Variable */
|
|
110689
|
+
return pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* pxtc.SymbolKind.Variable */
|
|
110689
110690
|
&& sym.attributes.fixedInstance
|
|
110690
110691
|
&& isSubtype(apis, sym.retType, qName));
|
|
110691
110692
|
}
|
|
@@ -113201,7 +113202,7 @@ var ts;
|
|
|
113201
113202
|
ex = m[mkey] = {
|
|
113202
113203
|
attributes: {
|
|
113203
113204
|
blockId: `${isNumberType ? s.namespace : mkey}_blockCombine_${rtp}`,
|
|
113204
|
-
callingConvention: 0 /* Plain */,
|
|
113205
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */,
|
|
113205
113206
|
group: s.attributes.group,
|
|
113206
113207
|
paramDefl: {},
|
|
113207
113208
|
jsDoc: isGet
|
|
@@ -113213,7 +113214,7 @@ var ts;
|
|
|
113213
113214
|
fileName: s.fileName,
|
|
113214
113215
|
qName: `${mkey}.${tp}`,
|
|
113215
113216
|
pkg: s.pkg,
|
|
113216
|
-
kind: 2 /* Property */,
|
|
113217
|
+
kind: 2 /* SymbolKind.Property */,
|
|
113217
113218
|
parameters: [
|
|
113218
113219
|
{
|
|
113219
113220
|
name: "property",
|
|
@@ -113327,15 +113328,15 @@ var ts;
|
|
|
113327
113328
|
}
|
|
113328
113329
|
else if (!!s.attributes.block
|
|
113329
113330
|
&& !s.attributes.fixedInstance
|
|
113330
|
-
&& s.kind != 7 /* EnumMember */
|
|
113331
|
-
&& s.kind != 5 /* Module */
|
|
113332
|
-
&& s.kind != 9 /* Interface */
|
|
113333
|
-
&& s.kind != 8 /* Class */) {
|
|
113331
|
+
&& s.kind != 7 /* pxtc.SymbolKind.EnumMember */
|
|
113332
|
+
&& s.kind != 5 /* pxtc.SymbolKind.Module */
|
|
113333
|
+
&& s.kind != 9 /* pxtc.SymbolKind.Interface */
|
|
113334
|
+
&& s.kind != 8 /* pxtc.SymbolKind.Class */) {
|
|
113334
113335
|
if (!s.attributes.blockId)
|
|
113335
113336
|
s.attributes.blockId = s.qName.replace(/\./g, "_");
|
|
113336
113337
|
if (s.attributes.block == "true") {
|
|
113337
113338
|
let b = pxtc.U.uncapitalize(s.name);
|
|
113338
|
-
if (s.kind == 1 /* Method */ || s.kind == 2 /* Property */) {
|
|
113339
|
+
if (s.kind == 1 /* SymbolKind.Method */ || s.kind == 2 /* SymbolKind.Property */) {
|
|
113339
113340
|
b += " %" + s.namespace.toLowerCase();
|
|
113340
113341
|
}
|
|
113341
113342
|
const params = (_b = (_a = s.parameters) === null || _a === void 0 ? void 0 : _a.filter(pr => !parameterTypeIsArrowFunction(pr))) !== null && _b !== void 0 ? _b : [];
|
|
@@ -113389,7 +113390,7 @@ var ts;
|
|
|
113389
113390
|
if (key) {
|
|
113390
113391
|
return key;
|
|
113391
113392
|
}
|
|
113392
|
-
if ((symbol && symbol.kind == 6 /* Enum */) || (!symbol && param.includes("."))) {
|
|
113393
|
+
if ((symbol && symbol.kind == 6 /* SymbolKind.Enum */) || (!symbol && param.includes("."))) {
|
|
113393
113394
|
// Python enums are all caps
|
|
113394
113395
|
const dotIdx = param.lastIndexOf(".");
|
|
113395
113396
|
const left = param.substr(0, dotIdx);
|
|
@@ -113572,7 +113573,7 @@ var ts;
|
|
|
113572
113573
|
function parseCommentString(cmt) {
|
|
113573
113574
|
let res = {
|
|
113574
113575
|
paramDefl: {},
|
|
113575
|
-
callingConvention: 0 /* Plain */,
|
|
113576
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */,
|
|
113576
113577
|
_source: cmt
|
|
113577
113578
|
};
|
|
113578
113579
|
let didSomething = true;
|
|
@@ -113704,9 +113705,9 @@ var ts;
|
|
|
113704
113705
|
});
|
|
113705
113706
|
res.jsDoc = res.jsDoc.trim();
|
|
113706
113707
|
if (res.async)
|
|
113707
|
-
res.callingConvention = 1 /* Async */;
|
|
113708
|
+
res.callingConvention = 1 /* ir.CallingConvention.Async */;
|
|
113708
113709
|
if (res.promise)
|
|
113709
|
-
res.callingConvention = 2 /* Promise */;
|
|
113710
|
+
res.callingConvention = 2 /* ir.CallingConvention.Promise */;
|
|
113710
113711
|
if (res.jres)
|
|
113711
113712
|
res.whenUsed = true;
|
|
113712
113713
|
if (res.subcategories) {
|
|
@@ -113788,11 +113789,11 @@ var ts;
|
|
|
113788
113789
|
const tk = eatToken(c => c == char);
|
|
113789
113790
|
const offset = char === "_" ? 2 : 0;
|
|
113790
113791
|
if (tk.length === 1)
|
|
113791
|
-
newToken = { kind: 1 /* SingleAsterisk */ << offset, content: tk };
|
|
113792
|
+
newToken = { kind: 1 /* TokenKind.SingleAsterisk */ << offset, content: tk };
|
|
113792
113793
|
else if (tk.length === 2)
|
|
113793
|
-
newToken = { kind: 2 /* DoubleAsterisk */ << offset, content: tk };
|
|
113794
|
+
newToken = { kind: 2 /* TokenKind.DoubleAsterisk */ << offset, content: tk };
|
|
113794
113795
|
else if (tk.length === 3)
|
|
113795
|
-
newToken = { kind: 3 /* TripleAsterisk */ << offset, content: tk };
|
|
113796
|
+
newToken = { kind: 3 /* TokenKind.TripleAsterisk */ << offset, content: tk };
|
|
113796
113797
|
else
|
|
113797
113798
|
strIndex = restoreIndex; // error: no more than three style marks
|
|
113798
113799
|
break;
|
|
@@ -113802,21 +113803,21 @@ var ts;
|
|
|
113802
113803
|
strIndex = restoreIndex; // error: not terminated
|
|
113803
113804
|
break;
|
|
113804
113805
|
}
|
|
113805
|
-
newToken = { kind: 256 /* Image */, content: image };
|
|
113806
|
+
newToken = { kind: 256 /* TokenKind.Image */, content: image };
|
|
113806
113807
|
break;
|
|
113807
113808
|
case "|":
|
|
113808
|
-
newToken = { kind: 32 /* Pipe */ };
|
|
113809
|
+
newToken = { kind: 32 /* TokenKind.Pipe */ };
|
|
113809
113810
|
break;
|
|
113810
113811
|
case "\\":
|
|
113811
113812
|
if (strIndex < (def.length - 1))
|
|
113812
|
-
newToken = { kind: 16 /* Escape */, content: def[1 + (strIndex++)] };
|
|
113813
|
+
newToken = { kind: 16 /* TokenKind.Escape */, content: def[1 + (strIndex++)] };
|
|
113813
113814
|
break;
|
|
113814
113815
|
case "[":
|
|
113815
113816
|
const contentText = eatEnclosure("]");
|
|
113816
113817
|
if (contentText !== undefined && def[strIndex++ + 1] === "(") {
|
|
113817
113818
|
const contentClass = eatEnclosure(")");
|
|
113818
113819
|
if (contentClass !== undefined) {
|
|
113819
|
-
newToken = { kind: 512 /* TaggedText */, content: contentText, type: contentClass };
|
|
113820
|
+
newToken = { kind: 512 /* TokenKind.TaggedText */, content: contentText, type: contentClass };
|
|
113820
113821
|
break;
|
|
113821
113822
|
}
|
|
113822
113823
|
}
|
|
@@ -113837,12 +113838,12 @@ var ts;
|
|
|
113837
113838
|
if (!varName)
|
|
113838
113839
|
strIndex = oldIndex;
|
|
113839
113840
|
}
|
|
113840
|
-
newToken = { kind: (char === "$") ? 1024 /* ParamRef */ : 64 /* Parameter */, content: param[0], type: param[1], name: varName };
|
|
113841
|
+
newToken = { kind: (char === "$") ? 1024 /* TokenKind.ParamRef */ : 64 /* TokenKind.Parameter */, content: param[0], type: param[1], name: varName };
|
|
113841
113842
|
break;
|
|
113842
113843
|
}
|
|
113843
113844
|
if (newToken) {
|
|
113844
113845
|
if (currentWord)
|
|
113845
|
-
tokens.push({ kind: 128 /* Word */, content: currentWord });
|
|
113846
|
+
tokens.push({ kind: 128 /* TokenKind.Word */, content: currentWord });
|
|
113846
113847
|
currentWord = undefined;
|
|
113847
113848
|
tokens.push(newToken);
|
|
113848
113849
|
}
|
|
@@ -113854,7 +113855,7 @@ var ts;
|
|
|
113854
113855
|
}
|
|
113855
113856
|
}
|
|
113856
113857
|
if (currentWord)
|
|
113857
|
-
tokens.push({ kind: 128 /* Word */, content: currentWord });
|
|
113858
|
+
tokens.push({ kind: 128 /* TokenKind.Word */, content: currentWord });
|
|
113858
113859
|
const parts = [];
|
|
113859
113860
|
const parameters = [];
|
|
113860
113861
|
let stack = [];
|
|
@@ -113864,7 +113865,7 @@ var ts;
|
|
|
113864
113865
|
for (let i = 0; i < tokens.length; i++) {
|
|
113865
113866
|
const token = tokens[i].kind;
|
|
113866
113867
|
const top = stack[stack.length - 1];
|
|
113867
|
-
if (token & 15 /* StyleMarks */) {
|
|
113868
|
+
if (token & 15 /* TokenKind.StyleMarks */) {
|
|
113868
113869
|
pushCurrentLabel(tokens[i].content);
|
|
113869
113870
|
if (token & open) {
|
|
113870
113871
|
if (top & token) {
|
|
@@ -113886,35 +113887,35 @@ var ts;
|
|
|
113886
113887
|
stack.push(token);
|
|
113887
113888
|
}
|
|
113888
113889
|
}
|
|
113889
|
-
else if (token & 144 /* Text */) {
|
|
113890
|
+
else if (token & 144 /* TokenKind.Text */) {
|
|
113890
113891
|
currentLabel += tokens[i].content;
|
|
113891
113892
|
}
|
|
113892
|
-
else if (token & 1120 /* Unstylable */) {
|
|
113893
|
+
else if (token & 1120 /* TokenKind.Unstylable */) {
|
|
113893
113894
|
pushLabels();
|
|
113894
113895
|
}
|
|
113895
|
-
if (token == 64 /* Parameter */) {
|
|
113896
|
+
if (token == 64 /* TokenKind.Parameter */) {
|
|
113896
113897
|
const param = { kind: "param", name: tokens[i].content, shadowBlockId: tokens[i].type, ref: false };
|
|
113897
113898
|
if (tokens[i].name)
|
|
113898
113899
|
param.varName = tokens[i].name;
|
|
113899
113900
|
parts.push(param);
|
|
113900
113901
|
parameters.push(param);
|
|
113901
113902
|
}
|
|
113902
|
-
else if (token == 1024 /* ParamRef */) {
|
|
113903
|
+
else if (token == 1024 /* TokenKind.ParamRef */) {
|
|
113903
113904
|
const param = { kind: "param", name: tokens[i].content, shadowBlockId: tokens[i].type, ref: true };
|
|
113904
113905
|
if (tokens[i].name)
|
|
113905
113906
|
param.varName = tokens[i].name;
|
|
113906
113907
|
parts.push(param);
|
|
113907
113908
|
parameters.push(param);
|
|
113908
113909
|
}
|
|
113909
|
-
else if (token == 256 /* Image */) {
|
|
113910
|
+
else if (token == 256 /* TokenKind.Image */) {
|
|
113910
113911
|
pushCurrentLabel();
|
|
113911
113912
|
labelStack.push({ kind: "image", uri: tokens[i].content });
|
|
113912
113913
|
}
|
|
113913
|
-
else if (token == 512 /* TaggedText */) {
|
|
113914
|
+
else if (token == 512 /* TokenKind.TaggedText */) {
|
|
113914
113915
|
pushCurrentLabel();
|
|
113915
113916
|
labelStack.push({ kind: "label", text: tokens[i].content, cssClass: tokens[i].type });
|
|
113916
113917
|
}
|
|
113917
|
-
else if (token == 32 /* Pipe */) {
|
|
113918
|
+
else if (token == 32 /* TokenKind.Pipe */) {
|
|
113918
113919
|
parts.push({ kind: "break" });
|
|
113919
113920
|
}
|
|
113920
113921
|
}
|
|
@@ -113983,9 +113984,9 @@ var ts;
|
|
|
113983
113984
|
if (!label.content)
|
|
113984
113985
|
continue;
|
|
113985
113986
|
const styles = [];
|
|
113986
|
-
if (label.styles & 10 /* Bold */)
|
|
113987
|
+
if (label.styles & 10 /* TokenKind.Bold */)
|
|
113987
113988
|
styles.push("bold");
|
|
113988
|
-
if (label.styles & 5 /* Italics */)
|
|
113989
|
+
if (label.styles & 5 /* TokenKind.Italics */)
|
|
113989
113990
|
styles.push("italics");
|
|
113990
113991
|
parts.push({ kind: "label", text: label.content, style: styles });
|
|
113991
113992
|
}
|
|
@@ -114470,7 +114471,7 @@ var pxt;
|
|
|
114470
114471
|
}
|
|
114471
114472
|
getProjectAsync(headerId) {
|
|
114472
114473
|
return this.db.getAsync(IndexedDBWorkspace.projectTable, headerId)
|
|
114473
|
-
.then(entry =>
|
|
114474
|
+
.then(entry => entry === null || entry === void 0 ? void 0 : entry.project);
|
|
114474
114475
|
}
|
|
114475
114476
|
saveProjectAsync(project) {
|
|
114476
114477
|
return this.db.setAsync(IndexedDBWorkspace.projectTable, {
|
|
@@ -114480,7 +114481,7 @@ var pxt;
|
|
|
114480
114481
|
}
|
|
114481
114482
|
getUserStateAsync() {
|
|
114482
114483
|
return this.db.getAsync(IndexedDBWorkspace.userTable, "local-user")
|
|
114483
|
-
.then(entry =>
|
|
114484
|
+
.then(entry => entry === null || entry === void 0 ? void 0 : entry.user);
|
|
114484
114485
|
}
|
|
114485
114486
|
saveUserStateAsync(user) {
|
|
114486
114487
|
return this.db.setAsync(IndexedDBWorkspace.userTable, {
|
|
@@ -115639,12 +115640,12 @@ var pxt;
|
|
|
115639
115640
|
return this.nextInternalID++;
|
|
115640
115641
|
}
|
|
115641
115642
|
createNewImage(width = 16, height = 16) {
|
|
115642
|
-
const id = this.generateNewID("image" /* Image */);
|
|
115643
|
+
const id = this.generateNewID("image" /* AssetType.Image */);
|
|
115643
115644
|
const bitmap = new pxt.sprite.Bitmap(width, height).data();
|
|
115644
115645
|
const newImage = {
|
|
115645
115646
|
internalID: this.getNewInternalId(),
|
|
115646
115647
|
id,
|
|
115647
|
-
type: "image" /* Image */,
|
|
115648
|
+
type: "image" /* AssetType.Image */,
|
|
115648
115649
|
bitmap: bitmap,
|
|
115649
115650
|
meta: {},
|
|
115650
115651
|
jresData: pxt.sprite.base64EncodeBitmap(bitmap)
|
|
@@ -115652,12 +115653,12 @@ var pxt;
|
|
|
115652
115653
|
return this.state.images.add(newImage);
|
|
115653
115654
|
}
|
|
115654
115655
|
createNewAnimation(width = 16, height = 16) {
|
|
115655
|
-
const id = this.generateNewID("animation" /* Animation */);
|
|
115656
|
+
const id = this.generateNewID("animation" /* AssetType.Animation */);
|
|
115656
115657
|
const bitmap = new pxt.sprite.Bitmap(width, height).data();
|
|
115657
115658
|
const newAnimation = {
|
|
115658
115659
|
internalID: this.getNewInternalId(),
|
|
115659
115660
|
id,
|
|
115660
|
-
type: "animation" /* Animation */,
|
|
115661
|
+
type: "animation" /* AssetType.Animation */,
|
|
115661
115662
|
frames: [bitmap],
|
|
115662
115663
|
interval: 500,
|
|
115663
115664
|
meta: {},
|
|
@@ -115665,11 +115666,11 @@ var pxt;
|
|
|
115665
115666
|
return this.state.animations.add(newAnimation);
|
|
115666
115667
|
}
|
|
115667
115668
|
createNewAnimationFromData(frames, interval = 500, displayName) {
|
|
115668
|
-
const id = this.generateNewID("animation" /* Animation */);
|
|
115669
|
+
const id = this.generateNewID("animation" /* AssetType.Animation */);
|
|
115669
115670
|
const newAnimation = {
|
|
115670
115671
|
internalID: this.getNewInternalId(),
|
|
115671
115672
|
id,
|
|
115672
|
-
type: "animation" /* Animation */,
|
|
115673
|
+
type: "animation" /* AssetType.Animation */,
|
|
115673
115674
|
frames,
|
|
115674
115675
|
interval,
|
|
115675
115676
|
meta: { displayName },
|
|
@@ -115702,13 +115703,13 @@ var pxt;
|
|
|
115702
115703
|
}
|
|
115703
115704
|
createNewTile(data, id, displayName) {
|
|
115704
115705
|
this.onChange();
|
|
115705
|
-
if (!id || this.isNameTaken("tile" /* Tile */, id)) {
|
|
115706
|
-
id = this.generateNewID("tile" /* Tile */);
|
|
115706
|
+
if (!id || this.isNameTaken("tile" /* AssetType.Tile */, id)) {
|
|
115707
|
+
id = this.generateNewID("tile" /* AssetType.Tile */);
|
|
115707
115708
|
}
|
|
115708
115709
|
const newTile = {
|
|
115709
115710
|
internalID: this.getNewInternalId(),
|
|
115710
115711
|
id,
|
|
115711
|
-
type: "tile" /* Tile */,
|
|
115712
|
+
type: "tile" /* AssetType.Tile */,
|
|
115712
115713
|
jresData: pxt.sprite.base64EncodeBitmap(data),
|
|
115713
115714
|
bitmap: data,
|
|
115714
115715
|
meta: {
|
|
@@ -115722,8 +115723,8 @@ var pxt;
|
|
|
115722
115723
|
this.onChange();
|
|
115723
115724
|
const newImage = {
|
|
115724
115725
|
internalID: this.getNewInternalId(),
|
|
115725
|
-
id: this.generateNewID("image" /* Image */),
|
|
115726
|
-
type: "image" /* Image */,
|
|
115726
|
+
id: this.generateNewID("image" /* AssetType.Image */),
|
|
115727
|
+
type: "image" /* AssetType.Image */,
|
|
115727
115728
|
jresData: pxt.sprite.base64EncodeBitmap(data),
|
|
115728
115729
|
meta: {
|
|
115729
115730
|
displayName
|
|
@@ -115738,7 +115739,7 @@ var pxt;
|
|
|
115738
115739
|
if (existing) {
|
|
115739
115740
|
this.state.tiles.update(existing.id, tile);
|
|
115740
115741
|
if (existing.id !== tile.id || !pxt.sprite.bitmapEquals(existing.bitmap, tile.bitmap)) {
|
|
115741
|
-
for (const tm of this.getAssets("tilemap" /* Tilemap */)) {
|
|
115742
|
+
for (const tm of this.getAssets("tilemap" /* AssetType.Tilemap */)) {
|
|
115742
115743
|
if (tm.data.tileset.tiles.some(t => t.internalID === tile.internalID)) {
|
|
115743
115744
|
tm.data.tileset.tiles = tm.data.tileset.tiles.map(t => t.internalID === tile.internalID ? tile : t);
|
|
115744
115745
|
this.updateTilemap(tm.id, tm.data);
|
|
@@ -115801,7 +115802,7 @@ var pxt;
|
|
|
115801
115802
|
return new pxt.sprite.TilemapData(tilemap, tileset, layers.data());
|
|
115802
115803
|
}
|
|
115803
115804
|
resolveTile(id) {
|
|
115804
|
-
return this.lookupAsset("tile" /* Tile */, id);
|
|
115805
|
+
return this.lookupAsset("tile" /* AssetType.Tile */, id);
|
|
115805
115806
|
}
|
|
115806
115807
|
resolveProjectTileByInternalID(id) {
|
|
115807
115808
|
return this.state.tiles.getSnapshot(tile => tile.internalID === id)[0];
|
|
@@ -115818,7 +115819,7 @@ var pxt;
|
|
|
115818
115819
|
tile = {
|
|
115819
115820
|
internalID: this.getNewInternalId(),
|
|
115820
115821
|
id,
|
|
115821
|
-
type: "tile" /* Tile */,
|
|
115822
|
+
type: "tile" /* AssetType.Tile */,
|
|
115822
115823
|
bitmap: bitmap,
|
|
115823
115824
|
jresData: pxt.sprite.base64EncodeBitmap(bitmap),
|
|
115824
115825
|
meta: {},
|
|
@@ -115830,11 +115831,11 @@ var pxt;
|
|
|
115830
115831
|
}
|
|
115831
115832
|
createNewTilemapFromData(data, name) {
|
|
115832
115833
|
this.onChange();
|
|
115833
|
-
const id = this.generateNewIDInternal("tilemap" /* Tilemap */, name || lf("level"));
|
|
115834
|
+
const id = this.generateNewIDInternal("tilemap" /* AssetType.Tilemap */, name || lf("level"));
|
|
115834
115835
|
this.state.tilemaps.add({
|
|
115835
115836
|
internalID: this.getNewInternalId(),
|
|
115836
115837
|
id,
|
|
115837
|
-
type: "tilemap" /* Tilemap */,
|
|
115838
|
+
type: "tilemap" /* AssetType.Tilemap */,
|
|
115838
115839
|
meta: {
|
|
115839
115840
|
displayName: name || id
|
|
115840
115841
|
},
|
|
@@ -115921,13 +115922,13 @@ var pxt;
|
|
|
115921
115922
|
isNameTaken(assetType, name) {
|
|
115922
115923
|
const isTaken = (id) => {
|
|
115923
115924
|
switch (assetType) {
|
|
115924
|
-
case "image" /* Image */:
|
|
115925
|
+
case "image" /* AssetType.Image */:
|
|
115925
115926
|
return this.state.images.isIDTaken(id) || this.gallery.images.isIDTaken(id);
|
|
115926
|
-
case "tile" /* Tile */:
|
|
115927
|
+
case "tile" /* AssetType.Tile */:
|
|
115927
115928
|
return this.state.tiles.isIDTaken(id) || this.gallery.tiles.isIDTaken(id);
|
|
115928
|
-
case "tilemap" /* Tilemap */:
|
|
115929
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
115929
115930
|
return this.state.tilemaps.isIDTaken(id) || this.gallery.tilemaps.isIDTaken(id);
|
|
115930
|
-
case "animation" /* Animation */:
|
|
115931
|
+
case "animation" /* AssetType.Animation */:
|
|
115931
115932
|
return this.state.animations.isIDTaken(id) || this.gallery.animations.isIDTaken(id);
|
|
115932
115933
|
}
|
|
115933
115934
|
};
|
|
@@ -115965,8 +115966,8 @@ var pxt;
|
|
|
115965
115966
|
let blockIds = ((_b = (_a = asset.meta) === null || _a === void 0 ? void 0 : _a.blockIDs) === null || _b === void 0 ? void 0 : _b.filter(id => !skipIDs || (skipIDs === null || skipIDs === void 0 ? void 0 : skipIDs.indexOf(id)) < 0)) || [];
|
|
115966
115967
|
if (blockIds.length > 0)
|
|
115967
115968
|
return true;
|
|
115968
|
-
if (asset.type == "tile" /* Tile */) {
|
|
115969
|
-
for (const tm of this.getAssets("tilemap" /* Tilemap */)) {
|
|
115969
|
+
if (asset.type == "tile" /* pxt.AssetType.Tile */) {
|
|
115970
|
+
for (const tm of this.getAssets("tilemap" /* AssetType.Tilemap */)) {
|
|
115970
115971
|
if ((skipIDs === null || skipIDs === void 0 ? void 0 : skipIDs.indexOf(tm.id)) >= 0) {
|
|
115971
115972
|
continue;
|
|
115972
115973
|
}
|
|
@@ -115980,15 +115981,15 @@ var pxt;
|
|
|
115980
115981
|
const displayName = pxt.Util.escapeForRegex((_c = asset.meta) === null || _c === void 0 ? void 0 : _c.displayName) || "";
|
|
115981
115982
|
let assetTsRefs;
|
|
115982
115983
|
switch (asset.type) {
|
|
115983
|
-
case "tile" /* Tile */:
|
|
115984
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
115984
115985
|
assetTsRefs = `myTiles.${shortId}|assets.tile\`${shortId}\``;
|
|
115985
115986
|
if (displayName)
|
|
115986
115987
|
assetTsRefs += `|assets.tile\`${displayName}\``;
|
|
115987
115988
|
break;
|
|
115988
|
-
case "tilemap" /* Tilemap */:
|
|
115989
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
115989
115990
|
assetTsRefs = `tilemap\`${shortId}\``;
|
|
115990
115991
|
break;
|
|
115991
|
-
case "animation" /* Animation */:
|
|
115992
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
115992
115993
|
assetTsRefs = `assets.animation\`${shortId}\``;
|
|
115993
115994
|
if (displayName)
|
|
115994
115995
|
assetTsRefs += `|assets.animation\`${displayName}\``;
|
|
@@ -116002,15 +116003,15 @@ var pxt;
|
|
|
116002
116003
|
const assetTsRegex = new RegExp(assetTsRefs, "gm");
|
|
116003
116004
|
let assetPyRefs;
|
|
116004
116005
|
switch (asset.type) {
|
|
116005
|
-
case "tile" /* Tile */:
|
|
116006
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
116006
116007
|
assetPyRefs = `myTiles.${shortId}|assets.tile\("""${shortId}"""\)`;
|
|
116007
116008
|
if (displayName)
|
|
116008
116009
|
assetPyRefs += `|assets.tile\("""${displayName}"""\)`;
|
|
116009
116010
|
break;
|
|
116010
|
-
case "tilemap" /* Tilemap */:
|
|
116011
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
116011
116012
|
assetPyRefs = `assets.tilemap\("""${shortId}"""\)`;
|
|
116012
116013
|
break;
|
|
116013
|
-
case "animation" /* Animation */:
|
|
116014
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
116014
116015
|
assetPyRefs = `assets.animation\("""${shortId}"""\)`;
|
|
116015
116016
|
if (displayName)
|
|
116016
116017
|
assetPyRefs += `|assets.animation\("""${displayName}"""\)`;
|
|
@@ -116041,63 +116042,63 @@ var pxt;
|
|
|
116041
116042
|
}
|
|
116042
116043
|
lookupAsset(assetType, name) {
|
|
116043
116044
|
switch (assetType) {
|
|
116044
|
-
case "image" /* Image */:
|
|
116045
|
+
case "image" /* AssetType.Image */:
|
|
116045
116046
|
return this.state.images.getByID(name) || this.gallery.images.getByID(name);
|
|
116046
|
-
case "tile" /* Tile */:
|
|
116047
|
+
case "tile" /* AssetType.Tile */:
|
|
116047
116048
|
return this.state.tiles.getByID(name) || this.gallery.tiles.getByID(name);
|
|
116048
|
-
case "tilemap" /* Tilemap */:
|
|
116049
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116049
116050
|
return this.state.tilemaps.getByID(name) || this.gallery.tilemaps.getByID(name);
|
|
116050
|
-
case "animation" /* Animation */:
|
|
116051
|
+
case "animation" /* AssetType.Animation */:
|
|
116051
116052
|
return this.state.animations.getByID(name) || this.gallery.animations.getByID(name);
|
|
116052
116053
|
}
|
|
116053
116054
|
}
|
|
116054
116055
|
lookupAssetByName(assetType, name) {
|
|
116055
116056
|
switch (assetType) {
|
|
116056
|
-
case "image" /* Image */:
|
|
116057
|
+
case "image" /* AssetType.Image */:
|
|
116057
116058
|
return this.state.images.getByDisplayName(name);
|
|
116058
|
-
case "tile" /* Tile */:
|
|
116059
|
+
case "tile" /* AssetType.Tile */:
|
|
116059
116060
|
return this.state.tiles.getByDisplayName(name);
|
|
116060
|
-
case "tilemap" /* Tilemap */:
|
|
116061
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116061
116062
|
return this.state.tilemaps.getByDisplayName(name);
|
|
116062
|
-
case "animation" /* Animation */:
|
|
116063
|
+
case "animation" /* AssetType.Animation */:
|
|
116063
116064
|
return this.state.animations.getByDisplayName(name);
|
|
116064
116065
|
}
|
|
116065
116066
|
}
|
|
116066
116067
|
getAssets(type) {
|
|
116067
116068
|
switch (type) {
|
|
116068
|
-
case "image" /* Image */: return this.state.images.getSnapshot();
|
|
116069
|
-
case "tile" /* Tile */: return this.state.tiles.getSnapshot();
|
|
116070
|
-
case "tilemap" /* Tilemap */: return this.state.tilemaps.getSnapshot();
|
|
116071
|
-
case "animation" /* Animation */: return this.state.animations.getSnapshot();
|
|
116069
|
+
case "image" /* AssetType.Image */: return this.state.images.getSnapshot();
|
|
116070
|
+
case "tile" /* AssetType.Tile */: return this.state.tiles.getSnapshot();
|
|
116071
|
+
case "tilemap" /* AssetType.Tilemap */: return this.state.tilemaps.getSnapshot();
|
|
116072
|
+
case "animation" /* AssetType.Animation */: return this.state.animations.getSnapshot();
|
|
116072
116073
|
}
|
|
116073
116074
|
}
|
|
116074
116075
|
getGalleryAssets(type) {
|
|
116075
116076
|
switch (type) {
|
|
116076
|
-
case "image" /* Image */: return this.gallery.images.getSnapshot();
|
|
116077
|
-
case "tile" /* Tile */: return this.gallery.tiles.getSnapshot();
|
|
116078
|
-
case "tilemap" /* Tilemap */: return this.gallery.tilemaps.getSnapshot();
|
|
116079
|
-
case "animation" /* Animation */: return this.gallery.animations.getSnapshot();
|
|
116077
|
+
case "image" /* AssetType.Image */: return this.gallery.images.getSnapshot();
|
|
116078
|
+
case "tile" /* AssetType.Tile */: return this.gallery.tiles.getSnapshot();
|
|
116079
|
+
case "tilemap" /* AssetType.Tilemap */: return this.gallery.tilemaps.getSnapshot();
|
|
116080
|
+
case "animation" /* AssetType.Animation */: return this.gallery.animations.getSnapshot();
|
|
116080
116081
|
}
|
|
116081
116082
|
}
|
|
116082
116083
|
lookupBlockAsset(type, blockID) {
|
|
116083
116084
|
let filter = (a) => { var _a, _b; return ((_b = (_a = a.meta) === null || _a === void 0 ? void 0 : _a.blockIDs) === null || _b === void 0 ? void 0 : _b.indexOf(blockID)) !== -1; };
|
|
116084
116085
|
switch (type) {
|
|
116085
|
-
case "image" /* Image */: return this.state.images.getSnapshot(filter)[0];
|
|
116086
|
-
case "tile" /* Tile */: return this.state.tiles.getSnapshot(filter)[0];
|
|
116087
|
-
case "tilemap" /* Tilemap */: return this.state.tilemaps.getSnapshot(filter)[0];
|
|
116088
|
-
case "animation" /* Animation */: return this.state.animations.getSnapshot(filter)[0];
|
|
116086
|
+
case "image" /* AssetType.Image */: return this.state.images.getSnapshot(filter)[0];
|
|
116087
|
+
case "tile" /* AssetType.Tile */: return this.state.tiles.getSnapshot(filter)[0];
|
|
116088
|
+
case "tilemap" /* AssetType.Tilemap */: return this.state.tilemaps.getSnapshot(filter)[0];
|
|
116089
|
+
case "animation" /* AssetType.Animation */: return this.state.animations.getSnapshot(filter)[0];
|
|
116089
116090
|
}
|
|
116090
116091
|
}
|
|
116091
116092
|
updateAsset(asset) {
|
|
116092
116093
|
this.onChange();
|
|
116093
116094
|
switch (asset.type) {
|
|
116094
|
-
case "image" /* Image */:
|
|
116095
|
+
case "image" /* AssetType.Image */:
|
|
116095
116096
|
return this.state.images.update(asset.id, asset);
|
|
116096
|
-
case "tile" /* Tile */:
|
|
116097
|
+
case "tile" /* AssetType.Tile */:
|
|
116097
116098
|
return this.updateTile(asset);
|
|
116098
|
-
case "tilemap" /* Tilemap */:
|
|
116099
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116099
116100
|
return this.state.tilemaps.update(asset.id, asset);
|
|
116100
|
-
case "animation" /* Animation */:
|
|
116101
|
+
case "animation" /* AssetType.Animation */:
|
|
116101
116102
|
return this.state.animations.update(asset.id, asset);
|
|
116102
116103
|
}
|
|
116103
116104
|
}
|
|
@@ -116108,17 +116109,17 @@ var pxt;
|
|
|
116108
116109
|
const name = displayName || ((_a = clone.meta) === null || _a === void 0 ? void 0 : _a.displayName);
|
|
116109
116110
|
let newAsset;
|
|
116110
116111
|
switch (asset.type) {
|
|
116111
|
-
case "image" /* Image */:
|
|
116112
|
+
case "image" /* AssetType.Image */:
|
|
116112
116113
|
newAsset = this.createNewProjectImage(clone.bitmap, name);
|
|
116113
116114
|
break;
|
|
116114
|
-
case "tile" /* Tile */:
|
|
116115
|
+
case "tile" /* AssetType.Tile */:
|
|
116115
116116
|
newAsset = this.createNewTile(clone.bitmap, null, name);
|
|
116116
116117
|
break;
|
|
116117
|
-
case "tilemap" /* Tilemap */:
|
|
116118
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116118
116119
|
const [id, tilemap] = this.createNewTilemapFromData(clone.data, name);
|
|
116119
116120
|
newAsset = this.getTilemap(id);
|
|
116120
116121
|
break;
|
|
116121
|
-
case "animation" /* Animation */:
|
|
116122
|
+
case "animation" /* AssetType.Animation */:
|
|
116122
116123
|
newAsset = this.createNewAnimationFromData(clone.frames, clone.interval, name);
|
|
116123
116124
|
}
|
|
116124
116125
|
return newAsset;
|
|
@@ -116126,44 +116127,44 @@ var pxt;
|
|
|
116126
116127
|
removeAsset(asset) {
|
|
116127
116128
|
this.onChange();
|
|
116128
116129
|
switch (asset.type) {
|
|
116129
|
-
case "image" /* Image */:
|
|
116130
|
+
case "image" /* AssetType.Image */:
|
|
116130
116131
|
return this.state.images.removeByID(asset.id);
|
|
116131
|
-
case "tile" /* Tile */:
|
|
116132
|
+
case "tile" /* AssetType.Tile */:
|
|
116132
116133
|
return this.state.tiles.removeByID(asset.id);
|
|
116133
|
-
case "tilemap" /* Tilemap */:
|
|
116134
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116134
116135
|
return this.state.tilemaps.removeByID(asset.id);
|
|
116135
|
-
case "animation" /* Animation */:
|
|
116136
|
+
case "animation" /* AssetType.Animation */:
|
|
116136
116137
|
return this.state.animations.removeByID(asset.id);
|
|
116137
116138
|
}
|
|
116138
116139
|
}
|
|
116139
116140
|
addChangeListener(asset, listener) {
|
|
116140
116141
|
switch (asset.type) {
|
|
116141
|
-
case "image" /* Image */:
|
|
116142
|
+
case "image" /* AssetType.Image */:
|
|
116142
116143
|
this.state.images.addListener(asset.internalID, listener);
|
|
116143
116144
|
break;
|
|
116144
|
-
case "tile" /* Tile */:
|
|
116145
|
+
case "tile" /* AssetType.Tile */:
|
|
116145
116146
|
this.state.tiles.addListener(asset.internalID, listener);
|
|
116146
116147
|
break;
|
|
116147
|
-
case "tilemap" /* Tilemap */:
|
|
116148
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116148
116149
|
this.state.tilemaps.addListener(asset.internalID, listener);
|
|
116149
116150
|
break;
|
|
116150
|
-
case "animation" /* Animation */:
|
|
116151
|
+
case "animation" /* AssetType.Animation */:
|
|
116151
116152
|
this.state.animations.addListener(asset.internalID, listener);
|
|
116152
116153
|
break;
|
|
116153
116154
|
}
|
|
116154
116155
|
}
|
|
116155
116156
|
removeChangeListener(type, listener) {
|
|
116156
116157
|
switch (type) {
|
|
116157
|
-
case "image" /* Image */:
|
|
116158
|
+
case "image" /* AssetType.Image */:
|
|
116158
116159
|
this.state.images.removeListener(listener);
|
|
116159
116160
|
break;
|
|
116160
|
-
case "tile" /* Tile */:
|
|
116161
|
+
case "tile" /* AssetType.Tile */:
|
|
116161
116162
|
this.state.tiles.removeListener(listener);
|
|
116162
116163
|
break;
|
|
116163
|
-
case "tilemap" /* Tilemap */:
|
|
116164
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116164
116165
|
this.state.tilemaps.removeListener(listener);
|
|
116165
116166
|
break;
|
|
116166
|
-
case "animation" /* Animation */:
|
|
116167
|
+
case "animation" /* AssetType.Animation */:
|
|
116167
116168
|
this.state.animations.removeListener(listener);
|
|
116168
116169
|
break;
|
|
116169
116170
|
}
|
|
@@ -116175,7 +116176,7 @@ var pxt;
|
|
|
116175
116176
|
const isProject = dep.id === "this";
|
|
116176
116177
|
const images = this.readImages(dep.parseJRes(), isProject);
|
|
116177
116178
|
for (const image of images) {
|
|
116178
|
-
if (image.type === "tile" /* Tile */) {
|
|
116179
|
+
if (image.type === "tile" /* AssetType.Tile */) {
|
|
116179
116180
|
if (isProject) {
|
|
116180
116181
|
this.state.tiles.add(image);
|
|
116181
116182
|
}
|
|
@@ -116183,7 +116184,7 @@ var pxt;
|
|
|
116183
116184
|
this.gallery.tiles.add(image);
|
|
116184
116185
|
}
|
|
116185
116186
|
}
|
|
116186
|
-
else if (image.type === "image" /* Image */) {
|
|
116187
|
+
else if (image.type === "image" /* AssetType.Image */) {
|
|
116187
116188
|
if (isProject) {
|
|
116188
116189
|
this.state.images.add(image);
|
|
116189
116190
|
}
|
|
@@ -116204,7 +116205,7 @@ var pxt;
|
|
|
116204
116205
|
for (const tm of getTilemaps(pack.parseJRes())) {
|
|
116205
116206
|
this.state.tilemaps.add({
|
|
116206
116207
|
internalID: this.getNewInternalId(),
|
|
116207
|
-
type: "tilemap" /* Tilemap */,
|
|
116208
|
+
type: "tilemap" /* AssetType.Tilemap */,
|
|
116208
116209
|
id: tm.id,
|
|
116209
116210
|
meta: {
|
|
116210
116211
|
// For tilemaps, use the id as the display name for backwards compat
|
|
@@ -116219,7 +116220,7 @@ var pxt;
|
|
|
116219
116220
|
}
|
|
116220
116221
|
loadTilemapJRes(jres, skipDuplicates = false) {
|
|
116221
116222
|
jres = pxt.inflateJRes(jres);
|
|
116222
|
-
const tiles = this.readImages(jres, true).filter(im => im.type === "tile" /* Tile */);
|
|
116223
|
+
const tiles = this.readImages(jres, true).filter(im => im.type === "tile" /* pxt.AssetType.Tile */);
|
|
116223
116224
|
// If we are loading JRES into an existing project (i.e. in multipart tutorials)
|
|
116224
116225
|
// we need to correct the tile ids because the user may have created new tiles
|
|
116225
116226
|
// and taken some of the ids that were used by the tutorial author
|
|
@@ -116240,7 +116241,7 @@ var pxt;
|
|
|
116240
116241
|
for (const tm of getTilemaps(jres)) {
|
|
116241
116242
|
this.state.tilemaps.add({
|
|
116242
116243
|
internalID: this.getNewInternalId(),
|
|
116243
|
-
type: "tilemap" /* Tilemap */,
|
|
116244
|
+
type: "tilemap" /* AssetType.Tilemap */,
|
|
116244
116245
|
id: tm.id,
|
|
116245
116246
|
meta: {
|
|
116246
116247
|
// For tilemaps, use the id as the display name for backwards compat
|
|
@@ -116261,10 +116262,10 @@ var pxt;
|
|
|
116261
116262
|
for (const key of Object.keys(jres)) {
|
|
116262
116263
|
const entry = jres[key];
|
|
116263
116264
|
if (entry.tilemapTile) {
|
|
116264
|
-
this.state.tiles.add(this.generateImage(entry, "tile" /* Tile */));
|
|
116265
|
+
this.state.tiles.add(this.generateImage(entry, "tile" /* AssetType.Tile */));
|
|
116265
116266
|
}
|
|
116266
116267
|
else if (entry.mimeType === pxt.IMAGE_MIME_TYPE) {
|
|
116267
|
-
this.state.images.add(this.generateImage(entry, "image" /* Image */));
|
|
116268
|
+
this.state.images.add(this.generateImage(entry, "image" /* AssetType.Image */));
|
|
116268
116269
|
}
|
|
116269
116270
|
else if (entry.mimeType === pxt.ANIMATION_MIME_TYPE) {
|
|
116270
116271
|
const [animation, needsInflation] = this.generateAnimation(entry);
|
|
@@ -116325,7 +116326,7 @@ var pxt;
|
|
|
116325
116326
|
}
|
|
116326
116327
|
const anim = {
|
|
116327
116328
|
internalID: this.getNewInternalId(),
|
|
116328
|
-
type: "animation" /* Animation */,
|
|
116329
|
+
type: "animation" /* AssetType.Animation */,
|
|
116329
116330
|
meta: {
|
|
116330
116331
|
displayName: entry.displayName
|
|
116331
116332
|
},
|
|
@@ -116359,14 +116360,14 @@ var pxt;
|
|
|
116359
116360
|
}
|
|
116360
116361
|
generateNewID(type) {
|
|
116361
116362
|
switch (type) {
|
|
116362
|
-
case "animation" /* Animation */:
|
|
116363
|
-
return this.generateNewIDInternal("animation" /* Animation */, pxt.sprite.ANIMATION_PREFIX, pxt.sprite.ANIMATION_NAMESPACE);
|
|
116364
|
-
case "image" /* Image */:
|
|
116365
|
-
return this.generateNewIDInternal("image" /* Image */, pxt.sprite.IMAGE_PREFIX, pxt.sprite.IMAGES_NAMESPACE);
|
|
116366
|
-
case "tile" /* Tile */:
|
|
116367
|
-
return this.generateNewIDInternal("tile" /* Tile */, pxt.sprite.TILE_PREFIX, pxt.sprite.TILE_NAMESPACE);
|
|
116368
|
-
case "tilemap" /* Tilemap */:
|
|
116369
|
-
return this.generateNewIDInternal("tilemap" /* Tilemap */, lf("level"));
|
|
116363
|
+
case "animation" /* AssetType.Animation */:
|
|
116364
|
+
return this.generateNewIDInternal("animation" /* AssetType.Animation */, pxt.sprite.ANIMATION_PREFIX, pxt.sprite.ANIMATION_NAMESPACE);
|
|
116365
|
+
case "image" /* AssetType.Image */:
|
|
116366
|
+
return this.generateNewIDInternal("image" /* AssetType.Image */, pxt.sprite.IMAGE_PREFIX, pxt.sprite.IMAGES_NAMESPACE);
|
|
116367
|
+
case "tile" /* AssetType.Tile */:
|
|
116368
|
+
return this.generateNewIDInternal("tile" /* AssetType.Tile */, pxt.sprite.TILE_PREFIX, pxt.sprite.TILE_NAMESPACE);
|
|
116369
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116370
|
+
return this.generateNewIDInternal("tilemap" /* AssetType.Tilemap */, lf("level"));
|
|
116370
116371
|
}
|
|
116371
116372
|
}
|
|
116372
116373
|
generateNewIDInternal(type, varPrefix, namespaceString) {
|
|
@@ -116388,12 +116389,12 @@ var pxt;
|
|
|
116388
116389
|
for (const key of Object.keys(allJRes)) {
|
|
116389
116390
|
const entry = allJRes[key];
|
|
116390
116391
|
if (entry.tilemapTile) {
|
|
116391
|
-
const tile = this.generateImage(entry, "tile" /* Tile */);
|
|
116392
|
+
const tile = this.generateImage(entry, "tile" /* AssetType.Tile */);
|
|
116392
116393
|
tile.isProjectTile = isProjectFile;
|
|
116393
116394
|
assets.push(tile);
|
|
116394
116395
|
}
|
|
116395
116396
|
else if (entry.mimeType === pxt.IMAGE_MIME_TYPE) {
|
|
116396
|
-
assets.push(this.generateImage(entry, "image" /* Image */));
|
|
116397
|
+
assets.push(this.generateImage(entry, "image" /* AssetType.Image */));
|
|
116397
116398
|
}
|
|
116398
116399
|
else if (entry.mimeType === pxt.ANIMATION_MIME_TYPE) {
|
|
116399
116400
|
const [animation, needsInflation] = this.generateAnimation(entry);
|
|
@@ -116442,11 +116443,11 @@ var pxt;
|
|
|
116442
116443
|
// FIXME: we should get the "image.ofBuffer" and blockIdentity from pxtarget probably
|
|
116443
116444
|
out += `${indent}//% fixedInstance jres blockIdentity=images._tile\n`;
|
|
116444
116445
|
out += `${indent}export const ${key} = image.ofBuffer(hex\`\`);\n`;
|
|
116445
|
-
tileEntries.push({ keys: [entry.displayName, getShortIDCore("tile" /* Tile */, key, true)], expression: key });
|
|
116446
|
+
tileEntries.push({ keys: [entry.displayName, getShortIDCore("tile" /* AssetType.Tile */, key, true)], expression: key });
|
|
116446
116447
|
}
|
|
116447
116448
|
if (entry.mimeType === pxt.TILEMAP_MIME_TYPE) {
|
|
116448
116449
|
const tm = decodeTilemap(entry);
|
|
116449
|
-
tilemapEntries.push({ keys: [entry.displayName, getShortIDCore("tilemap" /* Tilemap */, entry.id)], expression: pxt.sprite.encodeTilemap(tm, "typescript") });
|
|
116450
|
+
tilemapEntries.push({ keys: [entry.displayName, getShortIDCore("tilemap" /* AssetType.Tilemap */, entry.id)], expression: pxt.sprite.encodeTilemap(tm, "typescript") });
|
|
116450
116451
|
}
|
|
116451
116452
|
}
|
|
116452
116453
|
if (tilemapEntries.length) {
|
|
@@ -116470,7 +116471,7 @@ var pxt;
|
|
|
116470
116471
|
const entry = jres[key];
|
|
116471
116472
|
if (typeof entry === "string" || entry.mimeType === pxt.IMAGE_MIME_TYPE) {
|
|
116472
116473
|
let expression;
|
|
116473
|
-
let factoryKeys = [getShortIDCore("image" /* Image */, key, true)];
|
|
116474
|
+
let factoryKeys = [getShortIDCore("image" /* AssetType.Image */, key, true)];
|
|
116474
116475
|
if (typeof entry === "string") {
|
|
116475
116476
|
expression = pxt.sprite.bitmapToImageLiteral(pxt.sprite.getBitmapFromJResURL(entry), "typescript");
|
|
116476
116477
|
}
|
|
@@ -116486,7 +116487,7 @@ var pxt;
|
|
|
116486
116487
|
else if (entry.mimeType === pxt.ANIMATION_MIME_TYPE) {
|
|
116487
116488
|
const animation = decodeAnimation(entry);
|
|
116488
116489
|
animationEntries.push({
|
|
116489
|
-
keys: [entry.displayName, getShortIDCore("animation" /* Animation */, key, true)],
|
|
116490
|
+
keys: [entry.displayName, getShortIDCore("animation" /* AssetType.Animation */, key, true)],
|
|
116490
116491
|
expression: `[${animation.frames.map(f => pxt.sprite.bitmapToImageLiteral(pxt.sprite.Bitmap.fromData(f), "typescript")).join(", ")}]`
|
|
116491
116492
|
});
|
|
116492
116493
|
}
|
|
@@ -116530,12 +116531,12 @@ var pxt;
|
|
|
116530
116531
|
function cloneAsset(asset) {
|
|
116531
116532
|
asset.meta = Object.assign({}, asset.meta);
|
|
116532
116533
|
switch (asset.type) {
|
|
116533
|
-
case "tile" /* Tile */:
|
|
116534
|
-
case "image" /* Image */:
|
|
116534
|
+
case "tile" /* AssetType.Tile */:
|
|
116535
|
+
case "image" /* AssetType.Image */:
|
|
116535
116536
|
return Object.assign(Object.assign({}, asset), { bitmap: cloneBitmap(asset.bitmap) });
|
|
116536
|
-
case "animation" /* Animation */:
|
|
116537
|
+
case "animation" /* AssetType.Animation */:
|
|
116537
116538
|
return Object.assign(Object.assign({}, asset), { frames: asset.frames.map(frame => cloneBitmap(frame)) });
|
|
116538
|
-
case "tilemap" /* Tilemap */:
|
|
116539
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116539
116540
|
return Object.assign(Object.assign({}, asset), { data: asset.data.cloneData() });
|
|
116540
116541
|
}
|
|
116541
116542
|
}
|
|
@@ -116544,7 +116545,7 @@ var pxt;
|
|
|
116544
116545
|
// Get the last part of the fully qualified name
|
|
116545
116546
|
const id = asset.id.substr(asset.id.lastIndexOf(".") + 1);
|
|
116546
116547
|
switch (asset.type) {
|
|
116547
|
-
case "image" /* Image */:
|
|
116548
|
+
case "image" /* AssetType.Image */:
|
|
116548
116549
|
allJRes[id] = asset.jresData;
|
|
116549
116550
|
if (asset.meta.displayName) {
|
|
116550
116551
|
allJRes[id] = {
|
|
@@ -116554,7 +116555,7 @@ var pxt;
|
|
|
116554
116555
|
};
|
|
116555
116556
|
}
|
|
116556
116557
|
break;
|
|
116557
|
-
case "tile" /* Tile */:
|
|
116558
|
+
case "tile" /* AssetType.Tile */:
|
|
116558
116559
|
allJRes[id] = {
|
|
116559
116560
|
data: asset.jresData,
|
|
116560
116561
|
mimeType: pxt.IMAGE_MIME_TYPE,
|
|
@@ -116562,12 +116563,12 @@ var pxt;
|
|
|
116562
116563
|
displayName: asset.meta.displayName
|
|
116563
116564
|
};
|
|
116564
116565
|
break;
|
|
116565
|
-
case "tilemap" /* Tilemap */:
|
|
116566
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116566
116567
|
// we include the full ID for tilemaps
|
|
116567
116568
|
const serialized = serializeTilemap(asset.data, asset.id, asset.meta.displayName);
|
|
116568
116569
|
allJRes[serialized.id] = serialized;
|
|
116569
116570
|
break;
|
|
116570
|
-
case "animation" /* Animation */:
|
|
116571
|
+
case "animation" /* AssetType.Animation */:
|
|
116571
116572
|
allJRes[id] = serializeAnimation(asset);
|
|
116572
116573
|
break;
|
|
116573
116574
|
}
|
|
@@ -116581,13 +116582,13 @@ var pxt;
|
|
|
116581
116582
|
a.meta.displayName !== b.meta.displayName)
|
|
116582
116583
|
return false;
|
|
116583
116584
|
switch (a.type) {
|
|
116584
|
-
case "image" /* Image */:
|
|
116585
|
-
case "tile" /* Tile */:
|
|
116585
|
+
case "image" /* AssetType.Image */:
|
|
116586
|
+
case "tile" /* AssetType.Tile */:
|
|
116586
116587
|
return pxt.sprite.bitmapEquals(a.bitmap, b.bitmap);
|
|
116587
|
-
case "animation" /* Animation */:
|
|
116588
|
+
case "animation" /* AssetType.Animation */:
|
|
116588
116589
|
const bAnimation = b;
|
|
116589
116590
|
return a.interval === bAnimation.interval && pxt.U.arrayEquals(a.frames, bAnimation.frames, pxt.sprite.bitmapEquals);
|
|
116590
|
-
case "tilemap" /* Tilemap */:
|
|
116591
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116591
116592
|
return a.data.equals(b.data);
|
|
116592
116593
|
}
|
|
116593
116594
|
}
|
|
@@ -116611,7 +116612,7 @@ var pxt;
|
|
|
116611
116612
|
shortId = getShortIDForAsset(asset);
|
|
116612
116613
|
}
|
|
116613
116614
|
if (!shortId) {
|
|
116614
|
-
if (asset.type === "image" /* Image */ || asset.type === "tile" /* Tile */) {
|
|
116615
|
+
if (asset.type === "image" /* pxt.AssetType.Image */ || asset.type === "tile" /* pxt.AssetType.Tile */) {
|
|
116615
116616
|
// Use the qualified name
|
|
116616
116617
|
return asset.id;
|
|
116617
116618
|
}
|
|
@@ -116620,13 +116621,13 @@ var pxt;
|
|
|
116620
116621
|
const leftTick = isPython ? `("""` : "`";
|
|
116621
116622
|
const rightTick = isPython ? `""")` : "`";
|
|
116622
116623
|
switch (asset.type) {
|
|
116623
|
-
case "tile" /* Tile */:
|
|
116624
|
+
case "tile" /* AssetType.Tile */:
|
|
116624
116625
|
return `assets.tile${leftTick}${shortId}${rightTick}`;
|
|
116625
|
-
case "image" /* Image */:
|
|
116626
|
+
case "image" /* AssetType.Image */:
|
|
116626
116627
|
return `assets.image${leftTick}${shortId}${rightTick}`;
|
|
116627
|
-
case "animation" /* Animation */:
|
|
116628
|
+
case "animation" /* AssetType.Animation */:
|
|
116628
116629
|
return `assets.animation${leftTick}${shortId}${rightTick}`;
|
|
116629
|
-
case "tilemap" /* Tilemap */:
|
|
116630
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116630
116631
|
return `tilemap${leftTick}${shortId}${rightTick}`;
|
|
116631
116632
|
}
|
|
116632
116633
|
}
|
|
@@ -116649,13 +116650,13 @@ var pxt;
|
|
|
116649
116650
|
const { type, name } = match;
|
|
116650
116651
|
switch (type) {
|
|
116651
116652
|
case "tile":
|
|
116652
|
-
return project.lookupAssetByName("tile" /* Tile */, name);
|
|
116653
|
+
return project.lookupAssetByName("tile" /* AssetType.Tile */, name);
|
|
116653
116654
|
case "image":
|
|
116654
|
-
return project.lookupAssetByName("image" /* Image */, name);
|
|
116655
|
+
return project.lookupAssetByName("image" /* AssetType.Image */, name);
|
|
116655
116656
|
case "tilemap":
|
|
116656
|
-
return project.lookupAssetByName("tilemap" /* Tilemap */, name) || project.lookupAsset("tilemap" /* Tilemap */, name);
|
|
116657
|
+
return project.lookupAssetByName("tilemap" /* AssetType.Tilemap */, name) || project.lookupAsset("tilemap" /* AssetType.Tilemap */, name);
|
|
116657
116658
|
case "animation":
|
|
116658
|
-
return project.lookupAssetByName("animation" /* Animation */, name);
|
|
116659
|
+
return project.lookupAssetByName("animation" /* AssetType.Animation */, name);
|
|
116659
116660
|
}
|
|
116660
116661
|
}
|
|
116661
116662
|
return undefined;
|
|
@@ -116663,13 +116664,13 @@ var pxt;
|
|
|
116663
116664
|
pxt.lookupProjectAssetByTSReference = lookupProjectAssetByTSReference;
|
|
116664
116665
|
function getDefaultAssetDisplayName(type) {
|
|
116665
116666
|
switch (type) {
|
|
116666
|
-
case "image" /* Image */:
|
|
116667
|
+
case "image" /* pxt.AssetType.Image */:
|
|
116667
116668
|
return lf("myImage");
|
|
116668
|
-
case "tile" /* Tile */:
|
|
116669
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
116669
116670
|
return lf("myTile");
|
|
116670
|
-
case "tilemap" /* Tilemap */:
|
|
116671
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
116671
116672
|
return lf("level");
|
|
116672
|
-
case "animation" /* Animation */:
|
|
116673
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
116673
116674
|
return lf("myAnim");
|
|
116674
116675
|
default:
|
|
116675
116676
|
return lf("asset");
|
|
@@ -116683,16 +116684,16 @@ var pxt;
|
|
|
116683
116684
|
function getShortIDCore(assetType, id, allowNoPrefix = false) {
|
|
116684
116685
|
let prefix;
|
|
116685
116686
|
switch (assetType) {
|
|
116686
|
-
case "image" /* Image */:
|
|
116687
|
+
case "image" /* AssetType.Image */:
|
|
116687
116688
|
prefix = pxt.sprite.IMAGES_NAMESPACE + ".";
|
|
116688
116689
|
break;
|
|
116689
|
-
case "tile" /* Tile */:
|
|
116690
|
+
case "tile" /* AssetType.Tile */:
|
|
116690
116691
|
prefix = pxt.sprite.TILE_NAMESPACE + ".";
|
|
116691
116692
|
break;
|
|
116692
|
-
case "tilemap" /* Tilemap */:
|
|
116693
|
+
case "tilemap" /* AssetType.Tilemap */:
|
|
116693
116694
|
prefix = "";
|
|
116694
116695
|
break;
|
|
116695
|
-
case "animation" /* Animation */:
|
|
116696
|
+
case "animation" /* AssetType.Animation */:
|
|
116696
116697
|
prefix = pxt.sprite.ANIMATION_NAMESPACE + ".";
|
|
116697
116698
|
break;
|
|
116698
116699
|
}
|
|
@@ -116762,7 +116763,7 @@ var pxt;
|
|
|
116762
116763
|
id = id.replace(/\.\./g, ".");
|
|
116763
116764
|
}
|
|
116764
116765
|
return {
|
|
116765
|
-
type: "animation" /* Animation */,
|
|
116766
|
+
type: "animation" /* AssetType.Animation */,
|
|
116766
116767
|
internalID: 0,
|
|
116767
116768
|
id: id,
|
|
116768
116769
|
interval,
|
|
@@ -117695,15 +117696,15 @@ var ts;
|
|
|
117695
117696
|
ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest";
|
|
117696
117697
|
})(ScriptTarget = pxtc.ScriptTarget || (pxtc.ScriptTarget = {}));
|
|
117697
117698
|
function isIdentifierStart(ch, languageVersion) {
|
|
117698
|
-
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
117699
|
-
ch === 36 /*
|
|
117700
|
-
ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
|
|
117699
|
+
return ch >= 65 /* CharacterCodes.A */ && ch <= 90 /* CharacterCodes.Z */ || ch >= 97 /* CharacterCodes.a */ && ch <= 122 /* CharacterCodes.z */ ||
|
|
117700
|
+
ch === 36 /* CharacterCodes.$ */ || ch === 95 /* CharacterCodes._ */ ||
|
|
117701
|
+
ch > 127 /* CharacterCodes.maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
|
|
117701
117702
|
}
|
|
117702
117703
|
pxtc.isIdentifierStart = isIdentifierStart;
|
|
117703
117704
|
function isIdentifierPart(ch, languageVersion) {
|
|
117704
|
-
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
117705
|
-
ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /*
|
|
117706
|
-
ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
|
|
117705
|
+
return ch >= 65 /* CharacterCodes.A */ && ch <= 90 /* CharacterCodes.Z */ || ch >= 97 /* CharacterCodes.a */ && ch <= 122 /* CharacterCodes.z */ ||
|
|
117706
|
+
ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */ || ch === 36 /* CharacterCodes.$ */ || ch === 95 /* CharacterCodes._ */ ||
|
|
117707
|
+
ch > 127 /* CharacterCodes.maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
|
|
117707
117708
|
}
|
|
117708
117709
|
pxtc.isIdentifierPart = isIdentifierPart;
|
|
117709
117710
|
pxtc.reservedWords = ["abstract", "any", "as", "break",
|
|
@@ -121718,7 +121719,7 @@ var ts;
|
|
|
121718
121719
|
const decl = getDecl(child);
|
|
121719
121720
|
if (decl && decl.getSourceFile().fileName !== pxt.MAIN_TS && decl.kind == ts.SyntaxKind.VariableDeclaration) {
|
|
121720
121721
|
const info = pxtc.pxtInfo(child);
|
|
121721
|
-
info.flags |= 4 /* IsGlobalIdentifier */;
|
|
121722
|
+
info.flags |= 4 /* PxtNodeFlags.IsGlobalIdentifier */;
|
|
121722
121723
|
if (!info.commentAttrs) {
|
|
121723
121724
|
info.commentAttrs = pxtc.parseComments(decl);
|
|
121724
121725
|
}
|
|
@@ -121834,7 +121835,7 @@ var ts;
|
|
|
121834
121835
|
symbol: { isBogusSymbol: true, name: namedNode.name.getText() },
|
|
121835
121836
|
name: namedNode.name,
|
|
121836
121837
|
};
|
|
121837
|
-
pxtc.pxtInfo(decl).flags |= 2 /* IsBogusFunction */;
|
|
121838
|
+
pxtc.pxtInfo(decl).flags |= 2 /* PxtNodeFlags.IsBogusFunction */;
|
|
121838
121839
|
}
|
|
121839
121840
|
return decl;
|
|
121840
121841
|
}
|
|
@@ -122352,7 +122353,7 @@ ${baseLabel}_nochk:
|
|
|
122352
122353
|
else if (inf.size == 2) {
|
|
122353
122354
|
inf.immLimit = 64;
|
|
122354
122355
|
}
|
|
122355
|
-
if (b == 1 /* Int8 */ || b == 3 /* Int16 */) {
|
|
122356
|
+
if (b == 1 /* BitSize.Int8 */ || b == 3 /* BitSize.Int16 */) {
|
|
122356
122357
|
inf.needsSignExt = true;
|
|
122357
122358
|
}
|
|
122358
122359
|
return inf;
|
|
@@ -123941,7 +123942,7 @@ function ${id}(s) {
|
|
|
123941
123942
|
text = args.length == 2 ? `(${args[0]} ${pxtc.U.lookup(jsOpMap, name)} ${args[1]})` : `(${pxtc.U.lookup(jsOpMap, name)} ${args[0]})`;
|
|
123942
123943
|
else
|
|
123943
123944
|
text = `${shimToJs(name)}(${args.join(", ")})`;
|
|
123944
|
-
if (topExpr.callingConvention == 0 /* Plain */) {
|
|
123945
|
+
if (topExpr.callingConvention == 0 /* ir.CallingConvention.Plain */) {
|
|
123945
123946
|
write(`r0 = ${text};`);
|
|
123946
123947
|
}
|
|
123947
123948
|
else {
|
|
@@ -123950,7 +123951,7 @@ function ${id}(s) {
|
|
|
123950
123951
|
if (name == "String_::stringConv") {
|
|
123951
123952
|
write(`if ((${args[0]}) && (${args[0]}).vtable) {`);
|
|
123952
123953
|
}
|
|
123953
|
-
if (topExpr.callingConvention == 2 /* Promise */) {
|
|
123954
|
+
if (topExpr.callingConvention == 2 /* ir.CallingConvention.Promise */) {
|
|
123954
123955
|
write(`(function(cb) { ${text}.then(cb) })(buildResume(s, ${loc}));`);
|
|
123955
123956
|
}
|
|
123956
123957
|
else {
|
|
@@ -124073,13 +124074,13 @@ function ${id}(s) {
|
|
|
124073
124074
|
}
|
|
124074
124075
|
function bitSizeConverter(b) {
|
|
124075
124076
|
switch (b) {
|
|
124076
|
-
case 0 /* None */: return "";
|
|
124077
|
-
case 1 /* Int8 */: return "pxtrt.toInt8";
|
|
124078
|
-
case 3 /* Int16 */: return "pxtrt.toInt16";
|
|
124079
|
-
case 5 /* Int32 */: return "pxtrt.toInt32";
|
|
124080
|
-
case 2 /* UInt8 */: return "pxtrt.toUInt8";
|
|
124081
|
-
case 4 /* UInt16 */: return "pxtrt.toUInt16";
|
|
124082
|
-
case 6 /* UInt32 */: return "pxtrt.toUInt32";
|
|
124077
|
+
case 0 /* BitSize.None */: return "";
|
|
124078
|
+
case 1 /* BitSize.Int8 */: return "pxtrt.toInt8";
|
|
124079
|
+
case 3 /* BitSize.Int16 */: return "pxtrt.toInt16";
|
|
124080
|
+
case 5 /* BitSize.Int32 */: return "pxtrt.toInt32";
|
|
124081
|
+
case 2 /* BitSize.UInt8 */: return "pxtrt.toUInt8";
|
|
124082
|
+
case 4 /* BitSize.UInt16 */: return "pxtrt.toUInt16";
|
|
124083
|
+
case 6 /* BitSize.UInt32 */: return "pxtrt.toUInt32";
|
|
124083
124084
|
default: throw pxtc.oops();
|
|
124084
124085
|
}
|
|
124085
124086
|
}
|
|
@@ -125228,7 +125229,7 @@ _start_${name}:
|
|
|
125228
125229
|
emitExpr(src);
|
|
125229
125230
|
let cell = trg.data;
|
|
125230
125231
|
let instr = "st" + cellref(cell);
|
|
125231
|
-
if (cell.isGlobal() && (cell.bitSize != 0 /* None */)) {
|
|
125232
|
+
if (cell.isGlobal() && (cell.bitSize != 0 /* BitSize.None */)) {
|
|
125232
125233
|
const enc = pxtc.sizeOfBitSize(cell.bitSize) |
|
|
125233
125234
|
(pxtc.isBitSizeSigned(cell.bitSize) ? 0x10 : 0x00);
|
|
125234
125235
|
write("bitconv " + enc);
|
|
@@ -125640,7 +125641,7 @@ ${output}</xml>`;
|
|
|
125640
125641
|
}
|
|
125641
125642
|
return {
|
|
125642
125643
|
paramDefl: {},
|
|
125643
|
-
callingConvention: 0 /* Plain */
|
|
125644
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */
|
|
125644
125645
|
};
|
|
125645
125646
|
}
|
|
125646
125647
|
function compInfo(callInfo) {
|
|
@@ -128129,7 +128130,7 @@ ${output}</xml>`;
|
|
|
128129
128130
|
const parentInfo = pxtc.pxtInfo(parent).callInfo;
|
|
128130
128131
|
if (parentInfo && parentInfo.args) {
|
|
128131
128132
|
const api = env.blocks.apis.byQName[parentInfo.qName];
|
|
128132
|
-
const instance = api.kind == 1 /* Method */ || api.kind == 2 /* Property */;
|
|
128133
|
+
const instance = api.kind == 1 /* pxtc.SymbolKind.Method */ || api.kind == 2 /* pxtc.SymbolKind.Property */;
|
|
128133
128134
|
if (api) {
|
|
128134
128135
|
parentInfo.args.forEach((arg, i) => {
|
|
128135
128136
|
if (arg === child) {
|
|
@@ -128246,7 +128247,7 @@ ${output}</xml>`;
|
|
|
128246
128247
|
return node && node.kind === SK.Identifier && node.text === "undefined";
|
|
128247
128248
|
}
|
|
128248
128249
|
function isDeclaredElsewhere(node) {
|
|
128249
|
-
return !!(pxtc.pxtInfo(node).flags & 4 /* IsGlobalIdentifier */);
|
|
128250
|
+
return !!(pxtc.pxtInfo(node).flags & 4 /* PxtNodeFlags.IsGlobalIdentifier */);
|
|
128250
128251
|
}
|
|
128251
128252
|
function hasStatementInput(info, attributes) {
|
|
128252
128253
|
if (attributes.blockId === pxtc.PAUSE_UNTIL_TYPE)
|
|
@@ -128619,21 +128620,21 @@ var ts;
|
|
|
128619
128620
|
if (!sym)
|
|
128620
128621
|
return undefined;
|
|
128621
128622
|
switch (sym.kind) {
|
|
128622
|
-
case 3 /* Function */:
|
|
128623
|
-
case 1 /* Method */:
|
|
128623
|
+
case 3 /* SymbolKind.Function */:
|
|
128624
|
+
case 1 /* SymbolKind.Method */:
|
|
128624
128625
|
return displayStringForFunction(sym, python, apiInfo);
|
|
128625
|
-
case 6 /* Enum */:
|
|
128626
|
-
case 7 /* EnumMember */:
|
|
128626
|
+
case 6 /* SymbolKind.Enum */:
|
|
128627
|
+
case 7 /* SymbolKind.EnumMember */:
|
|
128627
128628
|
return displayStringForEnum(sym, python);
|
|
128628
|
-
case 5 /* Module */:
|
|
128629
|
+
case 5 /* SymbolKind.Module */:
|
|
128629
128630
|
return displayStringForNamepsace(sym, python);
|
|
128630
|
-
case 9 /* Interface */:
|
|
128631
|
+
case 9 /* SymbolKind.Interface */:
|
|
128631
128632
|
return displayStringForInterface(sym, python);
|
|
128632
|
-
case 8 /* Class */:
|
|
128633
|
+
case 8 /* SymbolKind.Class */:
|
|
128633
128634
|
return displayStringForClass(sym, python);
|
|
128634
|
-
case 4 /* Variable */:
|
|
128635
|
+
case 4 /* SymbolKind.Variable */:
|
|
128635
128636
|
return displayStringForVariable(sym, python, apiInfo);
|
|
128636
|
-
case 2 /* Property */:
|
|
128637
|
+
case 2 /* SymbolKind.Property */:
|
|
128637
128638
|
return displayStringForProperty(sym, python, apiInfo);
|
|
128638
128639
|
}
|
|
128639
128640
|
return `**${sym.qName}**`;
|
|
@@ -128645,7 +128646,7 @@ var ts;
|
|
|
128645
128646
|
service.displayStringForKeyword = displayStringForKeyword;
|
|
128646
128647
|
function displayStringForFunction(sym, python, apiInfo) {
|
|
128647
128648
|
let prefix = "";
|
|
128648
|
-
if (sym.kind === 3 /* Function */) {
|
|
128649
|
+
if (sym.kind === 3 /* SymbolKind.Function */) {
|
|
128649
128650
|
prefix += python ? "def " : "function ";
|
|
128650
128651
|
}
|
|
128651
128652
|
else {
|
|
@@ -128664,7 +128665,7 @@ var ts;
|
|
|
128664
128665
|
}
|
|
128665
128666
|
function displayStringForEnum(sym, python) {
|
|
128666
128667
|
const qName = python ? sym.pyQName : sym.qName;
|
|
128667
|
-
if (sym.kind === 6 /* Enum */) {
|
|
128668
|
+
if (sym.kind === 6 /* SymbolKind.Enum */) {
|
|
128668
128669
|
return codeBlock(`enum ${qName}`, python);
|
|
128669
128670
|
}
|
|
128670
128671
|
let memberString = `(enum member) ${qName}`;
|
|
@@ -129308,7 +129309,7 @@ var ts;
|
|
|
129308
129309
|
this.exprKind = exprKind;
|
|
129309
129310
|
this.args = args;
|
|
129310
129311
|
this.data = data;
|
|
129311
|
-
this.callingConvention = 0 /* Plain */;
|
|
129312
|
+
this.callingConvention = 0 /* CallingConvention.Plain */;
|
|
129312
129313
|
}
|
|
129313
129314
|
static clone(e) {
|
|
129314
129315
|
let copy = new Expr(e.exprKind, e.args ? e.args.slice(0) : null, e.data);
|
|
@@ -129516,7 +129517,7 @@ var ts;
|
|
|
129516
129517
|
this._isGlobal = false;
|
|
129517
129518
|
this._debugType = "?";
|
|
129518
129519
|
this.isUserVariable = false;
|
|
129519
|
-
this.bitSize = 0 /* None */;
|
|
129520
|
+
this.bitSize = 0 /* BitSize.None */;
|
|
129520
129521
|
if (def) {
|
|
129521
129522
|
if (!pxtc.isInPxtModules(def)) {
|
|
129522
129523
|
this.isUserVariable = true;
|
|
@@ -129557,8 +129558,8 @@ var ts;
|
|
|
129557
129558
|
}
|
|
129558
129559
|
load() {
|
|
129559
129560
|
let r = this.loadCore();
|
|
129560
|
-
if (pxtc.target.isNative && !pxtc.isStackMachine() && this.bitSize != 0 /* None */) {
|
|
129561
|
-
if (this.bitSize == 6 /* UInt32 */)
|
|
129561
|
+
if (pxtc.target.isNative && !pxtc.isStackMachine() && this.bitSize != 0 /* BitSize.None */) {
|
|
129562
|
+
if (this.bitSize == 6 /* BitSize.UInt32 */)
|
|
129562
129563
|
return rtcall("pxt::fromUInt", [r]);
|
|
129563
129564
|
return rtcall("pxt::fromInt", [r]);
|
|
129564
129565
|
}
|
|
@@ -129577,8 +129578,8 @@ var ts;
|
|
|
129577
129578
|
return rtcall("pxtrt::stlocRef", [this.loadCore(), src]);
|
|
129578
129579
|
}
|
|
129579
129580
|
else {
|
|
129580
|
-
if (pxtc.target.isNative && !pxtc.isStackMachine() && this.bitSize != 0 /* None */) {
|
|
129581
|
-
let cnv = this.bitSize == 6 /* UInt32 */ ? "pxt::toUInt" : "pxt::toInt";
|
|
129581
|
+
if (pxtc.target.isNative && !pxtc.isStackMachine() && this.bitSize != 0 /* BitSize.None */) {
|
|
129582
|
+
let cnv = this.bitSize == 6 /* BitSize.UInt32 */ ? "pxt::toUInt" : "pxt::toInt";
|
|
129582
129583
|
return this.storeDirect(rtcall(cnv, [src], 1));
|
|
129583
129584
|
}
|
|
129584
129585
|
return this.storeDirect(src);
|
|
@@ -130143,25 +130144,25 @@ var ts;
|
|
|
130143
130144
|
constructor(wave, id) {
|
|
130144
130145
|
this.wave = wave;
|
|
130145
130146
|
this.id = id;
|
|
130146
|
-
this.flags = 0 /* None */;
|
|
130147
|
+
this.flags = 0 /* PxtNodeFlags.None */;
|
|
130147
130148
|
this.resetAll();
|
|
130148
130149
|
}
|
|
130149
130150
|
refresh() {
|
|
130150
130151
|
// clear IsUsed flag
|
|
130151
|
-
this.flags &= ~8 /* IsUsed */;
|
|
130152
|
+
this.flags &= ~8 /* PxtNodeFlags.IsUsed */;
|
|
130152
130153
|
// this happens for top-level function expression - we just re-emit them
|
|
130153
130154
|
if (this.proc && !this.usedActions && !getEnclosingFunction(this.proc.action))
|
|
130154
130155
|
this.resetEmit();
|
|
130155
130156
|
else if (this.proc && !this.proc.cachedJS)
|
|
130156
130157
|
this.resetEmit();
|
|
130157
130158
|
else if (this.usedNodes)
|
|
130158
|
-
this.flags |= 32 /* FromPreviousCompile */;
|
|
130159
|
+
this.flags |= 32 /* PxtNodeFlags.FromPreviousCompile */;
|
|
130159
130160
|
if (this.classInfo)
|
|
130160
130161
|
this.classInfo.reset();
|
|
130161
130162
|
}
|
|
130162
130163
|
resetEmit() {
|
|
130163
130164
|
// clear IsUsed flag
|
|
130164
|
-
this.flags &= ~(8 /* IsUsed */ | 32 /* FromPreviousCompile */);
|
|
130165
|
+
this.flags &= ~(8 /* PxtNodeFlags.IsUsed */ | 32 /* PxtNodeFlags.FromPreviousCompile */);
|
|
130165
130166
|
if (this.proc && this.proc.classInfo && this.proc.classInfo.ctor == this.proc)
|
|
130166
130167
|
this.proc.classInfo.ctor = null;
|
|
130167
130168
|
this.functionInfo = null;
|
|
@@ -130176,7 +130177,7 @@ var ts;
|
|
|
130176
130177
|
}
|
|
130177
130178
|
resetTSC() {
|
|
130178
130179
|
// clear all flags except for InPxtModules
|
|
130179
|
-
this.flags &= 16 /* InPxtModules */;
|
|
130180
|
+
this.flags &= 16 /* PxtNodeFlags.InPxtModules */;
|
|
130180
130181
|
this.typeCache = null;
|
|
130181
130182
|
this.symbolCache = null;
|
|
130182
130183
|
this.commentAttrs = null;
|
|
@@ -130274,7 +130275,7 @@ var ts;
|
|
|
130274
130275
|
let currNodeWave = 1;
|
|
130275
130276
|
function isInPxtModules(node) {
|
|
130276
130277
|
if (node.pxt)
|
|
130277
|
-
return !!(node.pxt.flags & 16 /* InPxtModules */);
|
|
130278
|
+
return !!(node.pxt.flags & 16 /* PxtNodeFlags.InPxtModules */);
|
|
130278
130279
|
const src = ts.getSourceFileOfNode(node);
|
|
130279
130280
|
return src ? pxtc.isPxtModulesFilename(src.fileName) : false;
|
|
130280
130281
|
}
|
|
@@ -130283,7 +130284,7 @@ var ts;
|
|
|
130283
130284
|
if (!n.pxt) {
|
|
130284
130285
|
const info = new PxtNode(currNodeWave, ++lastNodeId);
|
|
130285
130286
|
if (isInPxtModules(n))
|
|
130286
|
-
info.flags |= 16 /* InPxtModules */;
|
|
130287
|
+
info.flags |= 16 /* PxtNodeFlags.InPxtModules */;
|
|
130287
130288
|
n.pxt = info;
|
|
130288
130289
|
return info;
|
|
130289
130290
|
}
|
|
@@ -130294,7 +130295,7 @@ var ts;
|
|
|
130294
130295
|
if (!pxtc.compileOptions || !pxtc.compileOptions.skipPxtModulesTSC)
|
|
130295
130296
|
info.resetAll();
|
|
130296
130297
|
else {
|
|
130297
|
-
if (info.flags & 16 /* InPxtModules */) {
|
|
130298
|
+
if (info.flags & 16 /* PxtNodeFlags.InPxtModules */) {
|
|
130298
130299
|
if (pxtc.compileOptions.skipPxtModulesEmit)
|
|
130299
130300
|
info.refresh();
|
|
130300
130301
|
else
|
|
@@ -130381,43 +130382,43 @@ var ts;
|
|
|
130381
130382
|
}
|
|
130382
130383
|
function getBitSize(decl) {
|
|
130383
130384
|
if (!decl || !decl.type)
|
|
130384
|
-
return 0 /* None */;
|
|
130385
|
+
return 0 /* BitSize.None */;
|
|
130385
130386
|
if (!(isNumberType(typeOf(decl))))
|
|
130386
|
-
return 0 /* None */;
|
|
130387
|
+
return 0 /* BitSize.None */;
|
|
130387
130388
|
if (decl.type.kind != pxtc.SK.TypeReference)
|
|
130388
|
-
return 0 /* None */;
|
|
130389
|
+
return 0 /* BitSize.None */;
|
|
130389
130390
|
switch (decl.type.typeName.getText()) {
|
|
130390
|
-
case "int8": return 1 /* Int8 */;
|
|
130391
|
-
case "int16": return 3 /* Int16 */;
|
|
130392
|
-
case "int32": return 5 /* Int32 */;
|
|
130393
|
-
case "uint8": return 2 /* UInt8 */;
|
|
130394
|
-
case "uint16": return 4 /* UInt16 */;
|
|
130395
|
-
case "uint32": return 6 /* UInt32 */;
|
|
130396
|
-
default: return 0 /* None */;
|
|
130391
|
+
case "int8": return 1 /* BitSize.Int8 */;
|
|
130392
|
+
case "int16": return 3 /* BitSize.Int16 */;
|
|
130393
|
+
case "int32": return 5 /* BitSize.Int32 */;
|
|
130394
|
+
case "uint8": return 2 /* BitSize.UInt8 */;
|
|
130395
|
+
case "uint16": return 4 /* BitSize.UInt16 */;
|
|
130396
|
+
case "uint32": return 6 /* BitSize.UInt32 */;
|
|
130397
|
+
default: return 0 /* BitSize.None */;
|
|
130397
130398
|
}
|
|
130398
130399
|
}
|
|
130399
130400
|
function sizeOfBitSize(b) {
|
|
130400
130401
|
switch (b) {
|
|
130401
|
-
case 0 /* None */: return pxtc.target.shortPointers ? 2 : 4;
|
|
130402
|
-
case 1 /* Int8 */: return 1;
|
|
130403
|
-
case 3 /* Int16 */: return 2;
|
|
130404
|
-
case 5 /* Int32 */: return 4;
|
|
130405
|
-
case 2 /* UInt8 */: return 1;
|
|
130406
|
-
case 4 /* UInt16 */: return 2;
|
|
130407
|
-
case 6 /* UInt32 */: return 4;
|
|
130402
|
+
case 0 /* BitSize.None */: return pxtc.target.shortPointers ? 2 : 4;
|
|
130403
|
+
case 1 /* BitSize.Int8 */: return 1;
|
|
130404
|
+
case 3 /* BitSize.Int16 */: return 2;
|
|
130405
|
+
case 5 /* BitSize.Int32 */: return 4;
|
|
130406
|
+
case 2 /* BitSize.UInt8 */: return 1;
|
|
130407
|
+
case 4 /* BitSize.UInt16 */: return 2;
|
|
130408
|
+
case 6 /* BitSize.UInt32 */: return 4;
|
|
130408
130409
|
default: throw pxtc.oops();
|
|
130409
130410
|
}
|
|
130410
130411
|
}
|
|
130411
130412
|
pxtc.sizeOfBitSize = sizeOfBitSize;
|
|
130412
130413
|
function isBitSizeSigned(b) {
|
|
130413
130414
|
switch (b) {
|
|
130414
|
-
case 1 /* Int8 */:
|
|
130415
|
-
case 3 /* Int16 */:
|
|
130416
|
-
case 5 /* Int32 */:
|
|
130415
|
+
case 1 /* BitSize.Int8 */:
|
|
130416
|
+
case 3 /* BitSize.Int16 */:
|
|
130417
|
+
case 5 /* BitSize.Int32 */:
|
|
130417
130418
|
return true;
|
|
130418
|
-
case 2 /* UInt8 */:
|
|
130419
|
-
case 4 /* UInt16 */:
|
|
130420
|
-
case 6 /* UInt32 */:
|
|
130419
|
+
case 2 /* BitSize.UInt8 */:
|
|
130420
|
+
case 4 /* BitSize.UInt16 */:
|
|
130421
|
+
case 6 /* BitSize.UInt32 */:
|
|
130421
130422
|
return false;
|
|
130422
130423
|
default: throw pxtc.oops();
|
|
130423
130424
|
}
|
|
@@ -130432,7 +130433,7 @@ var ts;
|
|
|
130432
130433
|
pxtc.oops("void-typed variable, " + l.toString());
|
|
130433
130434
|
}
|
|
130434
130435
|
l.bitSize = getBitSize(l.def);
|
|
130435
|
-
if (l.bitSize != 0 /* None */) {
|
|
130436
|
+
if (l.bitSize != 0 /* BitSize.None */) {
|
|
130436
130437
|
l._debugType = (isBitSizeSigned(l.bitSize) ? "int" : "uint") + (8 * sizeOfBitSize(l.bitSize));
|
|
130437
130438
|
}
|
|
130438
130439
|
else if (isStringType(tp)) {
|
|
@@ -130442,8 +130443,8 @@ var ts;
|
|
|
130442
130443
|
l._debugType = "number";
|
|
130443
130444
|
}
|
|
130444
130445
|
}
|
|
130445
|
-
if (l.isLocal() && l.bitSize != 0 /* None */) {
|
|
130446
|
-
l.bitSize = 0 /* None */;
|
|
130446
|
+
if (l.isLocal() && l.bitSize != 0 /* BitSize.None */) {
|
|
130447
|
+
l.bitSize = 0 /* BitSize.None */;
|
|
130447
130448
|
userError(9256, lf("bit sizes are not supported for locals and parameters"));
|
|
130448
130449
|
}
|
|
130449
130450
|
}
|
|
@@ -130595,7 +130596,7 @@ var ts;
|
|
|
130595
130596
|
this.itable = null;
|
|
130596
130597
|
}
|
|
130597
130598
|
get isUsed() {
|
|
130598
|
-
return !!(pxtInfo(this.decl).flags & 8 /* IsUsed */);
|
|
130599
|
+
return !!(pxtInfo(this.decl).flags & 8 /* PxtNodeFlags.IsUsed */);
|
|
130599
130600
|
}
|
|
130600
130601
|
allMethods() {
|
|
130601
130602
|
const r = [];
|
|
@@ -130610,7 +130611,7 @@ var ts;
|
|
|
130610
130611
|
for (let k of Object.keys(this.methods))
|
|
130611
130612
|
for (let m of this.methods[k]) {
|
|
130612
130613
|
const info = pxtInfo(m);
|
|
130613
|
-
if (info.flags & 8 /* IsUsed */)
|
|
130614
|
+
if (info.flags & 8 /* PxtNodeFlags.IsUsed */)
|
|
130614
130615
|
r.push(m);
|
|
130615
130616
|
}
|
|
130616
130617
|
return r;
|
|
@@ -130661,7 +130662,7 @@ var ts;
|
|
|
130661
130662
|
pxtc.parseCommentsOnSymbol = parseCommentsOnSymbol;
|
|
130662
130663
|
function parseComments(node) {
|
|
130663
130664
|
const pinfo = node ? pxtInfo(node) : null;
|
|
130664
|
-
if (!pinfo || pinfo.flags & 2 /* IsBogusFunction */)
|
|
130665
|
+
if (!pinfo || pinfo.flags & 2 /* PxtNodeFlags.IsBogusFunction */)
|
|
130665
130666
|
return pxtc.parseCommentString("");
|
|
130666
130667
|
if (pinfo.commentAttrs)
|
|
130667
130668
|
return pinfo.commentAttrs;
|
|
@@ -130928,7 +130929,7 @@ var ts;
|
|
|
130928
130929
|
this.capturedVars = [];
|
|
130929
130930
|
}
|
|
130930
130931
|
get isUsed() {
|
|
130931
|
-
return !!(pxtInfo(this.decl).flags & 8 /* IsUsed */);
|
|
130932
|
+
return !!(pxtInfo(this.decl).flags & 8 /* PxtNodeFlags.IsUsed */);
|
|
130932
130933
|
}
|
|
130933
130934
|
}
|
|
130934
130935
|
pxtc.FunctionAddInfo = FunctionAddInfo;
|
|
@@ -131043,7 +131044,7 @@ var ts;
|
|
|
131043
131044
|
};
|
|
131044
131045
|
_rootFunction = rootFunction;
|
|
131045
131046
|
const pinfo = pxtInfo(rootFunction);
|
|
131046
|
-
pinfo.flags |= 1 /* IsRootFunction */ | 2 /* IsBogusFunction */;
|
|
131047
|
+
pinfo.flags |= 1 /* PxtNodeFlags.IsRootFunction */ | 2 /* PxtNodeFlags.IsBogusFunction */;
|
|
131047
131048
|
markUsed(rootFunction);
|
|
131048
131049
|
usedWorkList = [];
|
|
131049
131050
|
reset();
|
|
@@ -131322,7 +131323,7 @@ var ts;
|
|
|
131322
131323
|
for (let m of ci.allMethods()) {
|
|
131323
131324
|
const pinfo = pxtInfo(m);
|
|
131324
131325
|
const info = getFunctionInfo(m);
|
|
131325
|
-
if (pinfo.flags & 8 /* IsUsed */) {
|
|
131326
|
+
if (pinfo.flags & 8 /* PxtNodeFlags.IsUsed */) {
|
|
131326
131327
|
// we need to mark the parent as used, otherwise vtable layout fails, see #3740
|
|
131327
131328
|
if (info.virtualParent)
|
|
131328
131329
|
markFunctionUsed(info.virtualParent.decl);
|
|
@@ -131460,8 +131461,8 @@ var ts;
|
|
|
131460
131461
|
}
|
|
131461
131462
|
}
|
|
131462
131463
|
function needsFullRecompileIfCached(pxtinfo) {
|
|
131463
|
-
if ((pxtinfo.flags & 32 /* FromPreviousCompile */) ||
|
|
131464
|
-
(pxtinfo.flags & 16 /* InPxtModules */ &&
|
|
131464
|
+
if ((pxtinfo.flags & 32 /* PxtNodeFlags.FromPreviousCompile */) ||
|
|
131465
|
+
(pxtinfo.flags & 16 /* PxtNodeFlags.InPxtModules */ &&
|
|
131465
131466
|
pxtc.compileOptions.skipPxtModulesEmit)) {
|
|
131466
131467
|
res.needsFullRecompile = true;
|
|
131467
131468
|
throw userError(9200, lf("full recompile required"));
|
|
@@ -131513,9 +131514,9 @@ var ts;
|
|
|
131513
131514
|
const pfield = pxtc.U.lookup(prevFields, key);
|
|
131514
131515
|
if (pfield) {
|
|
131515
131516
|
const pxtinfo = pxtInfo(pfield);
|
|
131516
|
-
if (!(pxtinfo.flags & 64 /* IsOverridden */)) {
|
|
131517
|
-
pxtinfo.flags |= 64 /* IsOverridden */;
|
|
131518
|
-
if (pxtinfo.flags & 8 /* IsUsed */)
|
|
131517
|
+
if (!(pxtinfo.flags & 64 /* PxtNodeFlags.IsOverridden */)) {
|
|
131518
|
+
pxtinfo.flags |= 64 /* PxtNodeFlags.IsOverridden */;
|
|
131519
|
+
if (pxtinfo.flags & 8 /* PxtNodeFlags.IsUsed */)
|
|
131519
131520
|
getIfaceMemberId(key, true);
|
|
131520
131521
|
needsFullRecompileIfCached(pxtinfo);
|
|
131521
131522
|
}
|
|
@@ -131715,7 +131716,7 @@ ${lbl}: .short 0xffff
|
|
|
131715
131716
|
let expr = emitExpr(e);
|
|
131716
131717
|
if (pxtc.target.isNative || isStringLiteral(e))
|
|
131717
131718
|
return irToNode(expr, isRef);
|
|
131718
|
-
expr = pxtc.ir.rtcallMask("String_::stringConv", 1, 1 /* Async */, [expr]);
|
|
131719
|
+
expr = pxtc.ir.rtcallMask("String_::stringConv", 1, 1 /* ir.CallingConvention.Async */, [expr]);
|
|
131719
131720
|
return irToNode(expr, true);
|
|
131720
131721
|
}
|
|
131721
131722
|
function emitTemplateExpression(node) {
|
|
@@ -131869,14 +131870,14 @@ ${lbl}: .short 0xffff
|
|
|
131869
131870
|
function isSlowField(decl) {
|
|
131870
131871
|
if (decl.kind == pxtc.SK.Parameter || decl.kind == pxtc.SK.PropertyDeclaration) {
|
|
131871
131872
|
const pinfo = pxtInfo(decl);
|
|
131872
|
-
return !!pxtc.target.switches.slowFields || !!(pinfo.flags & 64 /* IsOverridden */);
|
|
131873
|
+
return !!pxtc.target.switches.slowFields || !!(pinfo.flags & 64 /* PxtNodeFlags.IsOverridden */);
|
|
131873
131874
|
}
|
|
131874
131875
|
return false;
|
|
131875
131876
|
}
|
|
131876
131877
|
function emitIndexedAccess(node, assign = null) {
|
|
131877
131878
|
let t = typeOf(node.expression);
|
|
131878
131879
|
let attrs = {
|
|
131879
|
-
callingConvention: 0 /* Plain */,
|
|
131880
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */,
|
|
131880
131881
|
paramDefl: {},
|
|
131881
131882
|
};
|
|
131882
131883
|
let indexer = null;
|
|
@@ -131934,7 +131935,7 @@ ${lbl}: .short 0xffff
|
|
|
131934
131935
|
return true;
|
|
131935
131936
|
const info = pxtInfo(node);
|
|
131936
131937
|
if (bin.finalPass)
|
|
131937
|
-
return !!(info.flags & 8 /* IsUsed */);
|
|
131938
|
+
return !!(info.flags & 8 /* PxtNodeFlags.IsUsed */);
|
|
131938
131939
|
else
|
|
131939
131940
|
return info == currUsingContext;
|
|
131940
131941
|
}
|
|
@@ -131951,8 +131952,8 @@ ${lbl}: .short 0xffff
|
|
|
131951
131952
|
if (isStackMachine() && isClassFunction(decl))
|
|
131952
131953
|
getIfaceMemberId(getName(decl), true);
|
|
131953
131954
|
recordUsage(decl);
|
|
131954
|
-
if (!(pinfo.flags & 8 /* IsUsed */)) {
|
|
131955
|
-
pinfo.flags |= 8 /* IsUsed */;
|
|
131955
|
+
if (!(pinfo.flags & 8 /* PxtNodeFlags.IsUsed */)) {
|
|
131956
|
+
pinfo.flags |= 8 /* PxtNodeFlags.IsUsed */;
|
|
131956
131957
|
if (isOnDemandDecl(decl))
|
|
131957
131958
|
usedWorkList.push(decl);
|
|
131958
131959
|
}
|
|
@@ -132004,7 +132005,7 @@ ${lbl}: .short 0xffff
|
|
|
132004
132005
|
symbol: { isBogusSymbol: true, name: namedNode.name.getText() },
|
|
132005
132006
|
name: namedNode.name,
|
|
132006
132007
|
};
|
|
132007
|
-
pxtInfo(decl).flags |= 2 /* IsBogusFunction */;
|
|
132008
|
+
pxtInfo(decl).flags |= 2 /* PxtNodeFlags.IsBogusFunction */;
|
|
132008
132009
|
}
|
|
132009
132010
|
pinfo.declCache = decl || null;
|
|
132010
132011
|
return decl;
|
|
@@ -132382,17 +132383,17 @@ ${lbl}: .short 0xffff
|
|
|
132382
132383
|
// smaller immediate range than plain "str" (and same for "ldr")
|
|
132383
132384
|
// All the pointers go at the end, for GC
|
|
132384
132385
|
globals.forEach((g, i) => g.index = i);
|
|
132385
|
-
const sz = (b) => b == 0 /* None */ ? 10 : sizeOfBitSize(b);
|
|
132386
|
+
const sz = (b) => b == 0 /* BitSize.None */ ? 10 : sizeOfBitSize(b);
|
|
132386
132387
|
globals.sort((a, b) => sz(a.bitSize) - sz(b.bitSize) ||
|
|
132387
132388
|
a.index - b.index);
|
|
132388
132389
|
let currOff = pxtc.numReservedGlobals * 4;
|
|
132389
132390
|
let firstPointer = 0;
|
|
132390
132391
|
for (let g of globals) {
|
|
132391
|
-
const bitSize = isStackMachine() ? 0 /* None */ : g.bitSize;
|
|
132392
|
+
const bitSize = isStackMachine() ? 0 /* BitSize.None */ : g.bitSize;
|
|
132392
132393
|
let sz = sizeOfBitSize(bitSize);
|
|
132393
132394
|
while (currOff & (sz - 1))
|
|
132394
132395
|
currOff++; // align
|
|
132395
|
-
if (!firstPointer && bitSize == 0 /* None */)
|
|
132396
|
+
if (!firstPointer && bitSize == 0 /* BitSize.None */)
|
|
132396
132397
|
firstPointer = currOff;
|
|
132397
132398
|
g.index = currOff;
|
|
132398
132399
|
currOff += sz;
|
|
@@ -132452,7 +132453,7 @@ ${lbl}: .short 0xffff
|
|
|
132452
132453
|
return;
|
|
132453
132454
|
// U.assert(!bin.finalPass)
|
|
132454
132455
|
const pinfo = pxtInfo(info.decl);
|
|
132455
|
-
pinfo.flags |= 8 /* IsUsed */;
|
|
132456
|
+
pinfo.flags |= 8 /* PxtNodeFlags.IsUsed */;
|
|
132456
132457
|
if (info.baseClassInfo)
|
|
132457
132458
|
markVTableUsed(info.baseClassInfo);
|
|
132458
132459
|
bin.usedClassInfos.push(info);
|
|
@@ -132802,7 +132803,7 @@ ${lbl}: .short 0xffff
|
|
|
132802
132803
|
pxtc.assert(!bin.finalPass, "!bin.finalPass");
|
|
132803
132804
|
const pinfo = pxtInfo(node);
|
|
132804
132805
|
const myProc = new pxtc.ir.Procedure();
|
|
132805
|
-
myProc.isRoot = !!(pinfo.flags & 1 /* IsRootFunction */);
|
|
132806
|
+
myProc.isRoot = !!(pinfo.flags & 1 /* PxtNodeFlags.IsRootFunction */);
|
|
132806
132807
|
myProc.action = node;
|
|
132807
132808
|
myProc.info = info;
|
|
132808
132809
|
pinfo.proc = myProc;
|
|
@@ -132933,7 +132934,7 @@ ${lbl}: .short 0xffff
|
|
|
132933
132934
|
function emitFunctionDeclaration(node) {
|
|
132934
132935
|
if (!shouldEmitNow(node))
|
|
132935
132936
|
return undefined;
|
|
132936
|
-
if (pxtInfo(node).flags & 32 /* FromPreviousCompile */)
|
|
132937
|
+
if (pxtInfo(node).flags & 32 /* PxtNodeFlags.FromPreviousCompile */)
|
|
132937
132938
|
return undefined;
|
|
132938
132939
|
let attrs = parseComments(node);
|
|
132939
132940
|
if (attrs.shim != null) {
|
|
@@ -133526,7 +133527,7 @@ ${lbl}: .short 0xffff
|
|
|
133526
133527
|
return isNumberLikeType(typeOf(e));
|
|
133527
133528
|
}
|
|
133528
133529
|
function rtcallMaskDirect(name, args) {
|
|
133529
|
-
return pxtc.ir.rtcallMask(name, (1 << args.length) - 1, 0 /* Plain */, args);
|
|
133530
|
+
return pxtc.ir.rtcallMask(name, (1 << args.length) - 1, 0 /* ir.CallingConvention.Plain */, args);
|
|
133530
133531
|
}
|
|
133531
133532
|
function rtcallMask(name, args, attrs, append = null) {
|
|
133532
133533
|
let fmt = [];
|
|
@@ -133614,7 +133615,7 @@ ${lbl}: .short 0xffff
|
|
|
133614
133615
|
throw pxtc.U.oops("invalid format specifier: " + f);
|
|
133615
133616
|
}
|
|
133616
133617
|
});
|
|
133617
|
-
let r = pxtc.ir.rtcallMask(name, mask, attrs ? attrs.callingConvention : 0 /* Plain */, args2);
|
|
133618
|
+
let r = pxtc.ir.rtcallMask(name, mask, attrs ? attrs.callingConvention : 0 /* ir.CallingConvention.Plain */, args2);
|
|
133618
133619
|
if (!r.mask)
|
|
133619
133620
|
r.mask = { refMask: 0 };
|
|
133620
133621
|
r.mask.conversions = convInfos;
|
|
@@ -133780,7 +133781,7 @@ ${lbl}: .short 0xffff
|
|
|
133780
133781
|
let shim = (n) => {
|
|
133781
133782
|
n = mapIntOpName(n);
|
|
133782
133783
|
let args = [node.left, node.right];
|
|
133783
|
-
return pxtc.ir.rtcallMask(n, getMask(args), 0 /* Plain */, args.map(x => emitExpr(x)));
|
|
133784
|
+
return pxtc.ir.rtcallMask(n, getMask(args), 0 /* ir.CallingConvention.Plain */, args.map(x => emitExpr(x)));
|
|
133784
133785
|
};
|
|
133785
133786
|
if (node.operatorToken.kind == pxtc.SK.CommaToken) {
|
|
133786
133787
|
if (isNoopExpr(node.left))
|
|
@@ -134113,7 +134114,7 @@ ${lbl}: .short 0xffff
|
|
|
134113
134114
|
// we assume the value we're switching over will stay alive
|
|
134114
134115
|
// so, the mask only applies to the case expression if needed
|
|
134115
134116
|
// switch_eq() will decr(expr) if result is true
|
|
134116
|
-
let cmpCall = pxtc.ir.rtcallMask(mapIntOpName("pxt::switch_eq"), mask, 0 /* Plain */, [cmpExpr, expr]);
|
|
134117
|
+
let cmpCall = pxtc.ir.rtcallMask(mapIntOpName("pxt::switch_eq"), mask, 0 /* ir.CallingConvention.Plain */, [cmpExpr, expr]);
|
|
134117
134118
|
proc.emitJmp(lbl, cmpCall, pxtc.ir.JmpMode.IfNotZero, expr);
|
|
134118
134119
|
}
|
|
134119
134120
|
else if (cl.kind == pxtc.SK.DefaultClause) {
|
|
@@ -135272,13 +135273,13 @@ var pxt;
|
|
|
135272
135273
|
addFileOff++;
|
|
135273
135274
|
let mapEnd = 0;
|
|
135274
135275
|
for (let s of progHeaders) {
|
|
135275
|
-
if (s.type == 1 /* LOAD */)
|
|
135276
|
+
if (s.type == 1 /* PHT.LOAD */)
|
|
135276
135277
|
mapEnd = Math.max(mapEnd, s.vaddr + s.memsz);
|
|
135277
135278
|
}
|
|
135278
135279
|
let addMemOff = ((mapEnd + pageSize - 1) & ~(pageSize - 1)) + (addFileOff & (pageSize - 1));
|
|
135279
135280
|
let phOffset = -1;
|
|
135280
135281
|
for (let s of progHeaders) {
|
|
135281
|
-
if (s.type == 4 /* NOTE */) {
|
|
135282
|
+
if (s.type == 4 /* PHT.NOTE */) {
|
|
135282
135283
|
phOffset = s._filepos;
|
|
135283
135284
|
}
|
|
135284
135285
|
}
|
|
@@ -135308,13 +135309,13 @@ var pxt;
|
|
|
135308
135309
|
pxt.U.memcpy(resBuf, info.imageFileStart, program);
|
|
135309
135310
|
let ph = {
|
|
135310
135311
|
_filepos: info.phOffset,
|
|
135311
|
-
type: 1 /* LOAD */,
|
|
135312
|
+
type: 1 /* PHT.LOAD */,
|
|
135312
135313
|
offset: info.imageFileStart,
|
|
135313
135314
|
vaddr: info.imageMemStart,
|
|
135314
135315
|
paddr: info.imageMemStart,
|
|
135315
135316
|
filesz: program.length,
|
|
135316
135317
|
memsz: program.length,
|
|
135317
|
-
flags: 4 /* R */ | 1 /* X */,
|
|
135318
|
+
flags: 4 /* PHF.R */ | 1 /* PHF.X */,
|
|
135318
135319
|
align: pageSize
|
|
135319
135320
|
};
|
|
135320
135321
|
savePH(resBuf, ph);
|
|
@@ -137778,10 +137779,10 @@ var ts;
|
|
|
137778
137779
|
// special case for enum members and enum members exported as constants,
|
|
137779
137780
|
// which have the return type 'EnumName.MemberName'. we want to match 'EnumName'
|
|
137780
137781
|
if (isEnum) {
|
|
137781
|
-
if (i.symbol.kind == 7 /* EnumMember */) {
|
|
137782
|
+
if (i.symbol.kind == 7 /* SymbolKind.EnumMember */) {
|
|
137782
137783
|
retType = i.symbol.namespace;
|
|
137783
137784
|
}
|
|
137784
|
-
else if (i.symbol.kind == 4 /* Variable */) {
|
|
137785
|
+
else if (i.symbol.kind == 4 /* SymbolKind.Variable */) {
|
|
137785
137786
|
const enumParts = (_b = (_a = i.symbol.attributes) === null || _a === void 0 ? void 0 : _a.enumIdentity) === null || _b === void 0 ? void 0 : _b.split(".");
|
|
137786
137787
|
if ((enumParts === null || enumParts === void 0 ? void 0 : enumParts.length) > 1)
|
|
137787
137788
|
retType = enumParts[0];
|
|
@@ -137819,20 +137820,20 @@ var ts;
|
|
|
137819
137820
|
service.getBasicKindDefault = getBasicKindDefault;
|
|
137820
137821
|
function tsSymbolToPxtSymbolKind(ts) {
|
|
137821
137822
|
if (ts.flags & ts_1.SymbolFlags.Variable)
|
|
137822
|
-
return 4 /* Variable */;
|
|
137823
|
+
return 4 /* SymbolKind.Variable */;
|
|
137823
137824
|
if (ts.flags & ts_1.SymbolFlags.Class)
|
|
137824
|
-
return 8 /* Class */;
|
|
137825
|
+
return 8 /* SymbolKind.Class */;
|
|
137825
137826
|
if (ts.flags & ts_1.SymbolFlags.Enum)
|
|
137826
|
-
return 6 /* Enum */;
|
|
137827
|
+
return 6 /* SymbolKind.Enum */;
|
|
137827
137828
|
if (ts.flags & ts_1.SymbolFlags.EnumMember)
|
|
137828
|
-
return 7 /* EnumMember */;
|
|
137829
|
+
return 7 /* SymbolKind.EnumMember */;
|
|
137829
137830
|
if (ts.flags & ts_1.SymbolFlags.Method)
|
|
137830
|
-
return 1 /* Method */;
|
|
137831
|
+
return 1 /* SymbolKind.Method */;
|
|
137831
137832
|
if (ts.flags & ts_1.SymbolFlags.Module)
|
|
137832
|
-
return 5 /* Module */;
|
|
137833
|
+
return 5 /* SymbolKind.Module */;
|
|
137833
137834
|
if (ts.flags & ts_1.SymbolFlags.Property)
|
|
137834
|
-
return 2 /* Property */;
|
|
137835
|
-
return 0 /* None */;
|
|
137835
|
+
return 2 /* SymbolKind.Property */;
|
|
137836
|
+
return 0 /* SymbolKind.None */;
|
|
137836
137837
|
}
|
|
137837
137838
|
service.tsSymbolToPxtSymbolKind = tsSymbolToPxtSymbolKind;
|
|
137838
137839
|
function makePxtSymbolFromKeyword(keyword) {
|
|
@@ -137840,14 +137841,14 @@ var ts;
|
|
|
137840
137841
|
// type than "SymbolInfo" to carry auto completion information.
|
|
137841
137842
|
// Some progress on this exists here: dazuniga/completionitem_refactor
|
|
137842
137843
|
let sym = {
|
|
137843
|
-
kind: 0 /* None */,
|
|
137844
|
+
kind: 0 /* SymbolKind.None */,
|
|
137844
137845
|
name: keyword,
|
|
137845
137846
|
pyName: keyword,
|
|
137846
137847
|
qName: keyword,
|
|
137847
137848
|
pyQName: keyword,
|
|
137848
137849
|
namespace: "",
|
|
137849
137850
|
attributes: {
|
|
137850
|
-
callingConvention: 0 /* Plain */,
|
|
137851
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */,
|
|
137851
137852
|
paramDefl: {},
|
|
137852
137853
|
},
|
|
137853
137854
|
fileName: pxt.MAIN_TS,
|
|
@@ -137875,7 +137876,7 @@ var ts;
|
|
|
137875
137876
|
pyQName: qname,
|
|
137876
137877
|
namespace: ns,
|
|
137877
137878
|
attributes: {
|
|
137878
|
-
callingConvention: 0 /* Plain */,
|
|
137879
|
+
callingConvention: 0 /* ir.CallingConvention.Plain */,
|
|
137879
137880
|
paramDefl: {},
|
|
137880
137881
|
},
|
|
137881
137882
|
fileName: pxt.MAIN_TS,
|
|
@@ -138257,7 +138258,7 @@ var ts;
|
|
|
138257
138258
|
resultSymbols
|
|
138258
138259
|
.map(sym => {
|
|
138259
138260
|
// skip for enum member completions (eg "AnimalMob."" should have "Chicken", not "CHICKEN")
|
|
138260
|
-
if (sym.symbol.attributes.alias && !(isMemberCompletion && sym.symbol.kind === 7 /* EnumMember */)) {
|
|
138261
|
+
if (sym.symbol.attributes.alias && !(isMemberCompletion && sym.symbol.kind === 7 /* SymbolKind.EnumMember */)) {
|
|
138261
138262
|
return completionSymbol(service.lastApiInfo.apis.byQName[sym.symbol.attributes.alias], sym.weight);
|
|
138262
138263
|
}
|
|
138263
138264
|
else {
|
|
@@ -138526,29 +138527,29 @@ var ts;
|
|
|
138526
138527
|
switch (node.kind) {
|
|
138527
138528
|
case pxtc.SK.MethodDeclaration:
|
|
138528
138529
|
case pxtc.SK.MethodSignature:
|
|
138529
|
-
return 1 /* Method */;
|
|
138530
|
+
return 1 /* SymbolKind.Method */;
|
|
138530
138531
|
case pxtc.SK.PropertyDeclaration:
|
|
138531
138532
|
case pxtc.SK.PropertySignature:
|
|
138532
138533
|
case pxtc.SK.GetAccessor:
|
|
138533
138534
|
case pxtc.SK.SetAccessor:
|
|
138534
|
-
return 2 /* Property */;
|
|
138535
|
+
return 2 /* SymbolKind.Property */;
|
|
138535
138536
|
case pxtc.SK.Constructor:
|
|
138536
138537
|
case pxtc.SK.FunctionDeclaration:
|
|
138537
|
-
return 3 /* Function */;
|
|
138538
|
+
return 3 /* SymbolKind.Function */;
|
|
138538
138539
|
case pxtc.SK.VariableDeclaration:
|
|
138539
|
-
return 4 /* Variable */;
|
|
138540
|
+
return 4 /* SymbolKind.Variable */;
|
|
138540
138541
|
case pxtc.SK.ModuleDeclaration:
|
|
138541
|
-
return 5 /* Module */;
|
|
138542
|
+
return 5 /* SymbolKind.Module */;
|
|
138542
138543
|
case pxtc.SK.EnumDeclaration:
|
|
138543
|
-
return 6 /* Enum */;
|
|
138544
|
+
return 6 /* SymbolKind.Enum */;
|
|
138544
138545
|
case pxtc.SK.EnumMember:
|
|
138545
|
-
return 7 /* EnumMember */;
|
|
138546
|
+
return 7 /* SymbolKind.EnumMember */;
|
|
138546
138547
|
case pxtc.SK.ClassDeclaration:
|
|
138547
|
-
return 8 /* Class */;
|
|
138548
|
+
return 8 /* SymbolKind.Class */;
|
|
138548
138549
|
case pxtc.SK.InterfaceDeclaration:
|
|
138549
|
-
return 9 /* Interface */;
|
|
138550
|
+
return 9 /* SymbolKind.Interface */;
|
|
138550
138551
|
default:
|
|
138551
|
-
return 0 /* None */;
|
|
138552
|
+
return 0 /* SymbolKind.None */;
|
|
138552
138553
|
}
|
|
138553
138554
|
}
|
|
138554
138555
|
function createSymbolInfo(typechecker, qName, stmt) {
|
|
@@ -138572,13 +138573,13 @@ var ts;
|
|
|
138572
138573
|
return readableName;
|
|
138573
138574
|
}
|
|
138574
138575
|
let kind = getSymbolKind(stmt);
|
|
138575
|
-
if (kind != 0 /* None */) {
|
|
138576
|
+
if (kind != 0 /* SymbolKind.None */) {
|
|
138576
138577
|
let decl = stmt;
|
|
138577
138578
|
let attributes = pxtc.parseComments(decl);
|
|
138578
138579
|
if (attributes.weight < 0)
|
|
138579
138580
|
return null;
|
|
138580
138581
|
let m = /^(.*)\.(.*)/.exec(qName);
|
|
138581
|
-
let hasParams = kind == 3 /* Function */ || kind == 1 /* Method */;
|
|
138582
|
+
let hasParams = kind == 3 /* SymbolKind.Function */ || kind == 1 /* SymbolKind.Method */;
|
|
138582
138583
|
let pkg = null;
|
|
138583
138584
|
let pkgs = null;
|
|
138584
138585
|
let src = ts.getSourceFileOfNode(stmt);
|
|
@@ -138588,7 +138589,7 @@ var ts;
|
|
|
138588
138589
|
pkg = m[1];
|
|
138589
138590
|
}
|
|
138590
138591
|
let extendsTypes = undefined;
|
|
138591
|
-
if (kind == 8 /* Class */ || kind == 9 /* Interface */) {
|
|
138592
|
+
if (kind == 8 /* SymbolKind.Class */ || kind == 9 /* SymbolKind.Interface */) {
|
|
138592
138593
|
let cl = stmt;
|
|
138593
138594
|
extendsTypes = [];
|
|
138594
138595
|
if (cl.heritageClauses)
|
|
@@ -138600,7 +138601,7 @@ var ts;
|
|
|
138600
138601
|
}
|
|
138601
138602
|
}
|
|
138602
138603
|
}
|
|
138603
|
-
if (kind == 6 /* Enum */ || kind === 7 /* EnumMember */) {
|
|
138604
|
+
if (kind == 6 /* SymbolKind.Enum */ || kind === 7 /* SymbolKind.EnumMember */) {
|
|
138604
138605
|
(extendsTypes || (extendsTypes = [])).push("Number");
|
|
138605
138606
|
}
|
|
138606
138607
|
let r = {
|
|
@@ -138614,7 +138615,7 @@ var ts;
|
|
|
138614
138615
|
pkgs,
|
|
138615
138616
|
extendsTypes,
|
|
138616
138617
|
retType: stmt.kind == ts.SyntaxKind.Constructor ? "void" :
|
|
138617
|
-
kind == 5 /* Module */ ? "" :
|
|
138618
|
+
kind == 5 /* SymbolKind.Module */ ? "" :
|
|
138618
138619
|
typeOf(decl.type, decl, hasParams),
|
|
138619
138620
|
parameters: !hasParams ? null : pxtc.Util.toArray(decl.parameters).map((p, i) => {
|
|
138620
138621
|
let n = pxtc.getName(p);
|
|
@@ -138681,19 +138682,19 @@ var ts;
|
|
|
138681
138682
|
snippet: ts.isFunctionLike(stmt) ? null : undefined
|
|
138682
138683
|
};
|
|
138683
138684
|
switch (r.kind) {
|
|
138684
|
-
case 7 /* EnumMember */:
|
|
138685
|
+
case 7 /* SymbolKind.EnumMember */:
|
|
138685
138686
|
r.pyName = pxtc.U.snakify(r.name).toUpperCase();
|
|
138686
138687
|
break;
|
|
138687
|
-
case 4 /* Variable */:
|
|
138688
|
-
case 1 /* Method */:
|
|
138689
|
-
case 2 /* Property */:
|
|
138690
|
-
case 3 /* Function */:
|
|
138688
|
+
case 4 /* SymbolKind.Variable */:
|
|
138689
|
+
case 1 /* SymbolKind.Method */:
|
|
138690
|
+
case 2 /* SymbolKind.Property */:
|
|
138691
|
+
case 3 /* SymbolKind.Function */:
|
|
138691
138692
|
r.pyName = pxtc.U.snakify(r.name);
|
|
138692
138693
|
break;
|
|
138693
|
-
case 6 /* Enum */:
|
|
138694
|
-
case 8 /* Class */:
|
|
138695
|
-
case 9 /* Interface */:
|
|
138696
|
-
case 5 /* Module */:
|
|
138694
|
+
case 6 /* SymbolKind.Enum */:
|
|
138695
|
+
case 8 /* SymbolKind.Class */:
|
|
138696
|
+
case 9 /* SymbolKind.Interface */:
|
|
138697
|
+
case 5 /* SymbolKind.Module */:
|
|
138697
138698
|
default:
|
|
138698
138699
|
r.pyName = r.name;
|
|
138699
138700
|
break;
|
|
@@ -138711,7 +138712,7 @@ var ts;
|
|
|
138711
138712
|
pxt.debug(JSON.stringify(Object.keys(apiInfo.byQName), null, 2));
|
|
138712
138713
|
const files = {};
|
|
138713
138714
|
const infos = pxtc.Util.values(apiInfo.byQName);
|
|
138714
|
-
const enumMembers = infos.filter(si => si.kind == 7 /* EnumMember */)
|
|
138715
|
+
const enumMembers = infos.filter(si => si.kind == 7 /* SymbolKind.EnumMember */)
|
|
138715
138716
|
.sort(compareSymbols);
|
|
138716
138717
|
const snippetStrings = {};
|
|
138717
138718
|
const locStrings = {};
|
|
@@ -138724,7 +138725,7 @@ var ts;
|
|
|
138724
138725
|
return; // skip functions starting with __
|
|
138725
138726
|
pxt.debug(`loc: ${si.qName}`);
|
|
138726
138727
|
// must match blockly loader
|
|
138727
|
-
if (si.kind != 7 /* EnumMember */) {
|
|
138728
|
+
if (si.kind != 7 /* SymbolKind.EnumMember */) {
|
|
138728
138729
|
const ns = ts.pxtc.blocksCategory(si);
|
|
138729
138730
|
if (ns)
|
|
138730
138731
|
locStrings[`{id:category}${ns}`] = ns;
|
|
@@ -138750,7 +138751,7 @@ var ts;
|
|
|
138750
138751
|
files[pkg + name + "-strings.json"] = JSON.stringify(locs, null, 2);
|
|
138751
138752
|
};
|
|
138752
138753
|
for (const info of infos) {
|
|
138753
|
-
const isNamespace = info.kind == 5 /* Module */;
|
|
138754
|
+
const isNamespace = info.kind == 5 /* SymbolKind.Module */;
|
|
138754
138755
|
if (isNamespace) {
|
|
138755
138756
|
if (!infos.filter(si => si.namespace == info.name && !!si.attributes.jsDoc)[0])
|
|
138756
138757
|
continue; // nothing in namespace
|
|
@@ -138808,14 +138809,14 @@ var ts;
|
|
|
138808
138809
|
// sort by symbol kind
|
|
138809
138810
|
if (!symbolKindWeight) {
|
|
138810
138811
|
symbolKindWeight = {};
|
|
138811
|
-
symbolKindWeight[4 /* Variable */] = 100;
|
|
138812
|
-
symbolKindWeight[5 /* Module */] = 101;
|
|
138813
|
-
symbolKindWeight[3 /* Function */] = 99;
|
|
138814
|
-
symbolKindWeight[2 /* Property */] = 98;
|
|
138815
|
-
symbolKindWeight[1 /* Method */] = 97;
|
|
138816
|
-
symbolKindWeight[8 /* Class */] = 89;
|
|
138817
|
-
symbolKindWeight[6 /* Enum */] = 81;
|
|
138818
|
-
symbolKindWeight[7 /* EnumMember */] = 80;
|
|
138812
|
+
symbolKindWeight[4 /* SymbolKind.Variable */] = 100;
|
|
138813
|
+
symbolKindWeight[5 /* SymbolKind.Module */] = 101;
|
|
138814
|
+
symbolKindWeight[3 /* SymbolKind.Function */] = 99;
|
|
138815
|
+
symbolKindWeight[2 /* SymbolKind.Property */] = 98;
|
|
138816
|
+
symbolKindWeight[1 /* SymbolKind.Method */] = 97;
|
|
138817
|
+
symbolKindWeight[8 /* SymbolKind.Class */] = 89;
|
|
138818
|
+
symbolKindWeight[6 /* SymbolKind.Enum */] = 81;
|
|
138819
|
+
symbolKindWeight[7 /* SymbolKind.EnumMember */] = 80;
|
|
138819
138820
|
}
|
|
138820
138821
|
c = cmpr(s => symbolKindWeight[s.kind] || 0);
|
|
138821
138822
|
if (c)
|
|
@@ -138859,11 +138860,11 @@ var ts;
|
|
|
138859
138860
|
let existing = pxtc.U.lookup(res.byQName, qName);
|
|
138860
138861
|
if (existing) {
|
|
138861
138862
|
// we can have a function and an interface of the same name
|
|
138862
|
-
if (existing.kind == 9 /* Interface */ && si.kind != 9 /* Interface */) {
|
|
138863
|
+
if (existing.kind == 9 /* SymbolKind.Interface */ && si.kind != 9 /* SymbolKind.Interface */) {
|
|
138863
138864
|
// save existing entry
|
|
138864
138865
|
res.byQName[qName + "@type"] = existing;
|
|
138865
138866
|
}
|
|
138866
|
-
else if (existing.kind != 9 /* Interface */ && si.kind == 9 /* Interface */) {
|
|
138867
|
+
else if (existing.kind != 9 /* SymbolKind.Interface */ && si.kind == 9 /* SymbolKind.Interface */) {
|
|
138867
138868
|
res.byQName[qName + "@type"] = si;
|
|
138868
138869
|
si = existing;
|
|
138869
138870
|
}
|
|
@@ -138882,7 +138883,7 @@ var ts;
|
|
|
138882
138883
|
// Check if the colliding symbols are namespace definitions. The same namespace can be
|
|
138883
138884
|
// defined in different packages/extensions, so we want to keep track of that information.
|
|
138884
138885
|
// That way, we can make sure each cached extension has a copy of the namespace
|
|
138885
|
-
if (existing.kind === 5 /* Module */) {
|
|
138886
|
+
if (existing.kind === 5 /* SymbolKind.Module */) {
|
|
138886
138887
|
// Reference the existing array of packages where this namespace has been defined
|
|
138887
138888
|
si.pkgs = existing.pkgs || [];
|
|
138888
138889
|
if (existing.pkg !== si.pkg) {
|
|
@@ -139782,7 +139783,7 @@ var ts;
|
|
|
139782
139783
|
.reduce((x, y) => x.concat(y.extendsTypes), []);
|
|
139783
139784
|
};
|
|
139784
139785
|
// all fixed instances for this namespace
|
|
139785
|
-
let fixedInstances = instances.filter(value => value.kind === 4 /* Variable */ &&
|
|
139786
|
+
let fixedInstances = instances.filter(value => value.kind === 4 /* pxtc.SymbolKind.Variable */ &&
|
|
139786
139787
|
value.attributes.fixedInstance);
|
|
139787
139788
|
let instanceToUse;
|
|
139788
139789
|
// first try to get fixed instances whose retType matches nsInfo.name
|
|
@@ -139810,7 +139811,7 @@ var ts;
|
|
|
139810
139811
|
addNamespace = true;
|
|
139811
139812
|
}
|
|
139812
139813
|
}
|
|
139813
|
-
else if (element.kind == 1 /* Method */ || element.kind == 2 /* Property */) {
|
|
139814
|
+
else if (element.kind == 1 /* pxtc.SymbolKind.Method */ || element.kind == 2 /* pxtc.SymbolKind.Property */) {
|
|
139814
139815
|
if (params.thisParameter) {
|
|
139815
139816
|
let varName = undefined;
|
|
139816
139817
|
if (params.thisParameter.definitionName) {
|
|
@@ -139823,7 +139824,7 @@ var ts;
|
|
|
139823
139824
|
snippetPrefix = pxtc.U.snakify(snippetPrefix);
|
|
139824
139825
|
}
|
|
139825
139826
|
}
|
|
139826
|
-
else if (nsInfo.kind === 8 /* Class */) {
|
|
139827
|
+
else if (nsInfo.kind === 8 /* pxtc.SymbolKind.Class */) {
|
|
139827
139828
|
return undefined;
|
|
139828
139829
|
}
|
|
139829
139830
|
}
|
|
@@ -139836,7 +139837,7 @@ var ts;
|
|
|
139836
139837
|
}
|
|
139837
139838
|
else {
|
|
139838
139839
|
snippet = [fnName];
|
|
139839
|
-
if ((args === null || args === void 0 ? void 0 : args.length) || element.kind == 1 /* Method */ || element.kind == 3 /* Function */ || element.kind == 8 /* Class */) {
|
|
139840
|
+
if ((args === null || args === void 0 ? void 0 : args.length) || element.kind == 1 /* pxtc.SymbolKind.Method */ || element.kind == 3 /* pxtc.SymbolKind.Function */ || element.kind == 8 /* pxtc.SymbolKind.Class */) {
|
|
139840
139841
|
const argsWithCommas = args.reduce((p, n) => [...p, p.length ? ", " : "", n], []);
|
|
139841
139842
|
snippet = snippet.concat(["(", ...argsWithCommas, ")"]);
|
|
139842
139843
|
}
|
|
@@ -140002,7 +140003,7 @@ var ts;
|
|
|
140002
140003
|
return undefined;
|
|
140003
140004
|
}
|
|
140004
140005
|
function getFixedInstancesOf(type) {
|
|
140005
|
-
return pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* Variable */
|
|
140006
|
+
return pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* pxtc.SymbolKind.Variable */
|
|
140006
140007
|
&& sym.attributes.fixedInstance
|
|
140007
140008
|
&& isSubtype(apis, sym.retType, type.qName));
|
|
140008
140009
|
}
|
|
@@ -140762,12 +140763,12 @@ var pxt;
|
|
|
140762
140763
|
error(null, 9501, pxt.U.lf("unknown type '{0}' near '{1}'", tp, currErrorCtx || "???"));
|
|
140763
140764
|
return mkType({ primType: tp });
|
|
140764
140765
|
}
|
|
140765
|
-
if (sym.kind == 7 /* EnumMember */)
|
|
140766
|
+
if (sym.kind == 7 /* SK.EnumMember */)
|
|
140766
140767
|
return tpNumber;
|
|
140767
140768
|
// sym.pyInstanceType might not be initialized yet and we don't want to call symbolType() here to avoid infinite recursion
|
|
140768
|
-
if (sym.kind == 8 /* Class */ || sym.kind == 9 /* Interface */)
|
|
140769
|
+
if (sym.kind == 8 /* SK.Class */ || sym.kind == 9 /* SK.Interface */)
|
|
140769
140770
|
return sym.pyInstanceType || mkType({ classType: sym });
|
|
140770
|
-
if (sym.kind == 6 /* Enum */)
|
|
140771
|
+
if (sym.kind == 6 /* SK.Enum */)
|
|
140771
140772
|
return tpNumber;
|
|
140772
140773
|
error(null, 9502, pxt.U.lf("'{0}' is not a type near '{1}'", tp, currErrorCtx || "???"));
|
|
140773
140774
|
return mkType({ primType: tp });
|
|
@@ -140824,7 +140825,7 @@ var pxt;
|
|
|
140824
140825
|
if (prevRetType) {
|
|
140825
140826
|
unify(sym.pyAST, prevRetType, sym.pyRetType);
|
|
140826
140827
|
}
|
|
140827
|
-
if (sym.kind == 3 /* Function */ || sym.kind == 1 /* Method */) {
|
|
140828
|
+
if (sym.kind == 3 /* SK.Function */ || sym.kind == 1 /* SK.Method */) {
|
|
140828
140829
|
let paramTypes = sym.parameters.map(p => p.pyType);
|
|
140829
140830
|
if (paramTypes.some(isFalsy)) {
|
|
140830
140831
|
error(null, 9526, pxt.U.lf("function symbol is missing parameter types near '{1}'", currErrorCtx || "???"));
|
|
@@ -140834,7 +140835,7 @@ var pxt;
|
|
|
140834
140835
|
}
|
|
140835
140836
|
else
|
|
140836
140837
|
sym.pySymbolType = sym.pyRetType;
|
|
140837
|
-
if (sym.kind == 8 /* Class */ || sym.kind == 9 /* Interface */) {
|
|
140838
|
+
if (sym.kind == 8 /* SK.Class */ || sym.kind == 9 /* SK.Interface */) {
|
|
140838
140839
|
sym.pyInstanceType = mkType({ classType: sym });
|
|
140839
140840
|
}
|
|
140840
140841
|
currErrorCtx = undefined;
|
|
@@ -140854,7 +140855,7 @@ var pxt;
|
|
|
140854
140855
|
else if (name.indexOf(".") && !name.endsWith(".__constructor")) {
|
|
140855
140856
|
const base = name.substring(0, name.lastIndexOf("."));
|
|
140856
140857
|
const baseSymbol = lookupGlobalSymbol(base);
|
|
140857
|
-
if ((baseSymbol === null || baseSymbol === void 0 ? void 0 : baseSymbol.kind) === 8 /* Class */ && ((_a = baseSymbol.extendsTypes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
140858
|
+
if ((baseSymbol === null || baseSymbol === void 0 ? void 0 : baseSymbol.kind) === 8 /* SK.Class */ && ((_a = baseSymbol.extendsTypes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
140858
140859
|
return lookupGlobalSymbol(baseSymbol.extendsTypes[0] + name.substring(base.length));
|
|
140859
140860
|
}
|
|
140860
140861
|
}
|
|
@@ -140948,17 +140949,17 @@ var pxt;
|
|
|
140948
140949
|
}
|
|
140949
140950
|
let qualifiedName = pref + name;
|
|
140950
140951
|
if (scope.kind === "ClassDef") {
|
|
140951
|
-
varSym = addSymbol(2 /* Property */, qualifiedName);
|
|
140952
|
+
varSym = addSymbol(2 /* SK.Property */, qualifiedName);
|
|
140952
140953
|
}
|
|
140953
140954
|
else if (isLocalScope(scope)
|
|
140954
140955
|
&& (modifier === py_1.VarModifier.Global
|
|
140955
140956
|
|| modifier === py_1.VarModifier.NonLocal)) {
|
|
140956
|
-
varSym = addSymbol(4 /* Variable */, name);
|
|
140957
|
+
varSym = addSymbol(4 /* SK.Variable */, name);
|
|
140957
140958
|
}
|
|
140958
140959
|
else if (isLocalScope(scope))
|
|
140959
|
-
varSym = mkSymbol(4 /* Variable */, name);
|
|
140960
|
+
varSym = mkSymbol(4 /* SK.Variable */, name);
|
|
140960
140961
|
else
|
|
140961
|
-
varSym = addSymbol(4 /* Variable */, qualifiedName);
|
|
140962
|
+
varSym = addSymbol(4 /* SK.Variable */, qualifiedName);
|
|
140962
140963
|
varScopeSym = {
|
|
140963
140964
|
symbol: varSym,
|
|
140964
140965
|
modifier,
|
|
@@ -141211,8 +141212,7 @@ var pxt;
|
|
|
141211
141212
|
}
|
|
141212
141213
|
}
|
|
141213
141214
|
function isSymbol(c) {
|
|
141214
|
-
|
|
141215
|
-
return !!((_a = c) === null || _a === void 0 ? void 0 : _a.name);
|
|
141215
|
+
return !!(c === null || c === void 0 ? void 0 : c.name);
|
|
141216
141216
|
}
|
|
141217
141217
|
function isGenericType(t) {
|
|
141218
141218
|
var _a;
|
|
@@ -141277,7 +141277,7 @@ var pxt;
|
|
|
141277
141277
|
// TODO optimize ?
|
|
141278
141278
|
function listClassFields(cd) {
|
|
141279
141279
|
let qn = cd.symInfo.qName;
|
|
141280
|
-
return pxt.U.values(internalApis).filter(e => e.namespace == qn && e.kind == 2 /* Property */);
|
|
141280
|
+
return pxt.U.values(internalApis).filter(e => e.namespace == qn && e.kind == 2 /* SK.Property */);
|
|
141281
141281
|
}
|
|
141282
141282
|
function getClassField(ct, n, isStatic, checkOnly = false, skipBases = false) {
|
|
141283
141283
|
let qid;
|
|
@@ -141308,7 +141308,7 @@ var pxt;
|
|
|
141308
141308
|
}
|
|
141309
141309
|
}
|
|
141310
141310
|
if (!checkOnly && ct.pyAST && ct.pyAST.kind == "ClassDef") {
|
|
141311
|
-
let sym = addSymbol(2 /* Property */, qid);
|
|
141311
|
+
let sym = addSymbol(2 /* SK.Property */, qid);
|
|
141312
141312
|
sym.isInstance = !isStatic;
|
|
141313
141313
|
return sym;
|
|
141314
141314
|
}
|
|
@@ -141444,10 +141444,10 @@ var pxt;
|
|
|
141444
141444
|
if (!s)
|
|
141445
141445
|
return false;
|
|
141446
141446
|
switch (s.kind) {
|
|
141447
|
-
case 5 /* Module */:
|
|
141448
|
-
case 9 /* Interface */:
|
|
141449
|
-
case 8 /* Class */:
|
|
141450
|
-
case 6 /* Enum */:
|
|
141447
|
+
case 5 /* SK.Module */:
|
|
141448
|
+
case 9 /* SK.Interface */:
|
|
141449
|
+
case 8 /* SK.Class */:
|
|
141450
|
+
case 6 /* SK.Enum */:
|
|
141451
141451
|
return true;
|
|
141452
141452
|
default:
|
|
141453
141453
|
return false;
|
|
@@ -141489,7 +141489,7 @@ var pxt;
|
|
|
141489
141489
|
let sym = lookupApi(tpName + "@type") || lookupApi(tpName);
|
|
141490
141490
|
if (sym) {
|
|
141491
141491
|
getOrSetSymbolType(sym);
|
|
141492
|
-
if (sym.kind == 6 /* Enum */)
|
|
141492
|
+
if (sym.kind == 6 /* SK.Enum */)
|
|
141493
141493
|
return tpNumber;
|
|
141494
141494
|
if (sym.pyInstanceType)
|
|
141495
141495
|
return sym.pyInstanceType;
|
|
@@ -141694,7 +141694,7 @@ var pxt;
|
|
|
141694
141694
|
const nested = !!ctx.currFun;
|
|
141695
141695
|
setupScope(n);
|
|
141696
141696
|
const existing = lookupSymbol(getFullName(n));
|
|
141697
|
-
const sym = addSymbolFor(isMethod ? 1 /* Method */ : 3 /* Function */, n);
|
|
141697
|
+
const sym = addSymbolFor(isMethod ? 1 /* SK.Method */ : 3 /* SK.Function */, n);
|
|
141698
141698
|
if (!inline) {
|
|
141699
141699
|
if (existing && existing.declared === currIteration) {
|
|
141700
141700
|
error(n, 9520, lf("Duplicate function declaration"));
|
|
@@ -141799,7 +141799,7 @@ var pxt;
|
|
|
141799
141799
|
FunctionDef: (n) => emitFunctionDef(n),
|
|
141800
141800
|
ClassDef: (n) => guardedScope(n, () => {
|
|
141801
141801
|
setupScope(n);
|
|
141802
|
-
const sym = addSymbolFor(8 /* Class */, n);
|
|
141802
|
+
const sym = addSymbolFor(8 /* SK.Class */, n);
|
|
141803
141803
|
pxt.U.assert(!ctx.currClass);
|
|
141804
141804
|
let topLev = isTopLevel();
|
|
141805
141805
|
ctx.currClass = n;
|
|
@@ -142248,7 +142248,7 @@ var pxt;
|
|
|
142248
142248
|
const scopeSym = currentScope().vars[nm];
|
|
142249
142249
|
const sym = scopeSym === null || scopeSym === void 0 ? void 0 : scopeSym.symbol;
|
|
142250
142250
|
// Mark the assignment only if the variable is declared in this scope
|
|
142251
|
-
if (sym && sym.kind === 4 /* Variable */ && scopeSym.modifier === undefined) {
|
|
142251
|
+
if (sym && sym.kind === 4 /* SK.Variable */ && scopeSym.modifier === undefined) {
|
|
142252
142252
|
if (scopeSym.firstAssignPos === undefined
|
|
142253
142253
|
|| scopeSym.firstAssignPos > target.startPos) {
|
|
142254
142254
|
scopeSym.firstAssignPos = target.startPos;
|
|
@@ -142315,7 +142315,7 @@ var pxt;
|
|
|
142315
142315
|
let localScopeVar = currentScope().vars[id];
|
|
142316
142316
|
let local = localScopeVar === null || localScopeVar === void 0 ? void 0 : localScopeVar.symbol;
|
|
142317
142317
|
if (n.isdef === undefined) {
|
|
142318
|
-
if (!curr || (curr.kind === 4 /* Variable */ && curr !== local)) {
|
|
142318
|
+
if (!curr || (curr.kind === 4 /* SK.Variable */ && curr !== local)) {
|
|
142319
142319
|
if (ctx.currClass && !ctx.currFun) {
|
|
142320
142320
|
n.isdef = false; // field
|
|
142321
142321
|
currScopeVar = defvar(id, {});
|
|
@@ -142593,7 +142593,7 @@ var pxt;
|
|
|
142593
142593
|
n.func.inCalledPosition = true;
|
|
142594
142594
|
let nm = tryGetName(n.func);
|
|
142595
142595
|
let namedSymbol = lookupSymbol(nm);
|
|
142596
|
-
let isClass = namedSymbol && namedSymbol.kind == 8 /* Class */;
|
|
142596
|
+
let isClass = namedSymbol && namedSymbol.kind == 8 /* SK.Class */;
|
|
142597
142597
|
let fun = namedSymbol;
|
|
142598
142598
|
let recvTp = undefined;
|
|
142599
142599
|
let recv = undefined;
|
|
@@ -142601,7 +142601,7 @@ var pxt;
|
|
|
142601
142601
|
if (isClass) {
|
|
142602
142602
|
fun = lookupSymbol(namedSymbol.pyQName + ".__constructor");
|
|
142603
142603
|
if (!fun) {
|
|
142604
|
-
fun = addSymbolFor(3 /* Function */, createDummyConstructorSymbol(namedSymbol === null || namedSymbol === void 0 ? void 0 : namedSymbol.pyAST));
|
|
142604
|
+
fun = addSymbolFor(3 /* SK.Function */, createDummyConstructorSymbol(namedSymbol === null || namedSymbol === void 0 ? void 0 : namedSymbol.pyAST));
|
|
142605
142605
|
}
|
|
142606
142606
|
}
|
|
142607
142607
|
else {
|
|
@@ -142669,7 +142669,7 @@ var pxt;
|
|
|
142669
142669
|
recvTp = typeOf(recv);
|
|
142670
142670
|
methName = over.n.slice(1);
|
|
142671
142671
|
fun = getTypeField(recv, methName);
|
|
142672
|
-
if (fun && fun.kind == 2 /* Property */)
|
|
142672
|
+
if (fun && fun.kind == 2 /* SK.Property */)
|
|
142673
142673
|
return B.mkInfix(expr(recv), ".", B.mkText(methName));
|
|
142674
142674
|
}
|
|
142675
142675
|
else {
|
|
@@ -143094,7 +143094,7 @@ var pxt;
|
|
|
143094
143094
|
return hoisted;
|
|
143095
143095
|
}
|
|
143096
143096
|
function shouldHoist(sym, scope) {
|
|
143097
|
-
let result = sym.symbol.kind === 4 /* Variable */
|
|
143097
|
+
let result = sym.symbol.kind === 4 /* SK.Variable */
|
|
143098
143098
|
&& !sym.symbol.isParam
|
|
143099
143099
|
&& sym.modifier === undefined
|
|
143100
143100
|
&& (sym.lastRefPos > sym.forVariableEndPos
|
|
@@ -143251,14 +143251,14 @@ var pxt;
|
|
|
143251
143251
|
diagnostics = parseDiags.concat(diagnostics);
|
|
143252
143252
|
const isGlobalSymbol = (si) => {
|
|
143253
143253
|
switch (si.kind) {
|
|
143254
|
-
case 6 /* Enum */:
|
|
143255
|
-
case 7 /* EnumMember */:
|
|
143256
|
-
case 4 /* Variable */:
|
|
143257
|
-
case 3 /* Function */:
|
|
143258
|
-
case 5 /* Module */:
|
|
143254
|
+
case 6 /* SK.Enum */:
|
|
143255
|
+
case 7 /* SK.EnumMember */:
|
|
143256
|
+
case 4 /* SK.Variable */:
|
|
143257
|
+
case 3 /* SK.Function */:
|
|
143258
|
+
case 5 /* SK.Module */:
|
|
143259
143259
|
return true;
|
|
143260
|
-
case 2 /* Property */:
|
|
143261
|
-
case 1 /* Method */:
|
|
143260
|
+
case 2 /* SK.Property */:
|
|
143261
|
+
case 1 /* SK.Method */:
|
|
143262
143262
|
return !si.isInstance;
|
|
143263
143263
|
default:
|
|
143264
143264
|
return false;
|
|
@@ -143495,7 +143495,7 @@ var pxt;
|
|
|
143495
143495
|
},
|
|
143496
143496
|
decorator_list: [],
|
|
143497
143497
|
vars: {},
|
|
143498
|
-
symInfo: mkSymbol(3 /* Function */, def.symInfo.qName + ".__constructor")
|
|
143498
|
+
symInfo: mkSymbol(3 /* SK.Function */, def.symInfo.qName + ".__constructor")
|
|
143499
143499
|
};
|
|
143500
143500
|
result.symInfo.parameters = [];
|
|
143501
143501
|
result.symInfo.pyRetType = mkType({ classType: def.symInfo });
|
|
@@ -153563,13 +153563,13 @@ var pxsim;
|
|
|
153563
153563
|
}
|
|
153564
153564
|
}
|
|
153565
153565
|
postMessageCore(frame, msg) {
|
|
153566
|
-
var _a, _b
|
|
153566
|
+
var _a, _b;
|
|
153567
153567
|
frame.contentWindow.postMessage(msg, frame.dataset['origin']);
|
|
153568
|
-
if (pxsim.U.isLocalHostDev() && ((
|
|
153568
|
+
if (pxsim.U.isLocalHostDev() && ((_a = pxt === null || pxt === void 0 ? void 0 : pxt.appTarget) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
153569
153569
|
// If using the production simulator on local serve, the domain might have been
|
|
153570
153570
|
// redirected by the CLI server. Also send to the production domain just in case
|
|
153571
153571
|
try {
|
|
153572
|
-
frame.contentWindow.postMessage(msg, `https://trg-${(
|
|
153572
|
+
frame.contentWindow.postMessage(msg, `https://trg-${(_b = pxt === null || pxt === void 0 ? void 0 : pxt.appTarget) === null || _b === void 0 ? void 0 : _b.id}.userpxt.io/---simulator`);
|
|
153573
153573
|
}
|
|
153574
153574
|
catch (e) {
|
|
153575
153575
|
// Ignore exceptions if the target origin doesn't match
|
|
@@ -160322,11 +160322,11 @@ function serveAsync(parsed) {
|
|
|
160322
160322
|
}));
|
|
160323
160323
|
}
|
|
160324
160324
|
exports.serveAsync = serveAsync;
|
|
160325
|
-
const readFileAsync = util_1.promisify(fs.readFile);
|
|
160326
|
-
const writeFileAsync = util_1.promisify(fs.writeFile);
|
|
160327
|
-
const readDirAsync = util_1.promisify(fs.readdir);
|
|
160328
|
-
const statAsync = util_1.promisify(fs.stat);
|
|
160329
|
-
const rimrafAsync = util_1.promisify(rimraf);
|
|
160325
|
+
const readFileAsync = (0, util_1.promisify)(fs.readFile);
|
|
160326
|
+
const writeFileAsync = (0, util_1.promisify)(fs.writeFile);
|
|
160327
|
+
const readDirAsync = (0, util_1.promisify)(fs.readdir);
|
|
160328
|
+
const statAsync = (0, util_1.promisify)(fs.stat);
|
|
160329
|
+
const rimrafAsync = (0, util_1.promisify)(rimraf);
|
|
160330
160330
|
let commonfiles = {};
|
|
160331
160331
|
class SnippetHost {
|
|
160332
160332
|
constructor(name, packageFiles, extraDependencies, includeCommon = false) {
|