Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/compiler/irgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class ScriptTreeGenerator {
index: this.descendInputOfBlock(block, 'INDEX')
});
case 'data_lengthoflist':
return new IntermediateInput(InputOpcode.LIST_LENGTH, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO, {
return new IntermediateInput(InputOpcode.LIST_LENGTH, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO, {
list: this.descendVariable(block, 'LIST', LIST_TYPE)
});
case 'data_listcontainsitem':
Expand All @@ -271,7 +271,7 @@ class ScriptTreeGenerator {
item: this.descendInputOfBlock(block, 'ITEM')
});
case 'data_itemnumoflist':
return new IntermediateInput(InputOpcode.LIST_INDEX_OF, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO, {
return new IntermediateInput(InputOpcode.LIST_INDEX_OF, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO, {
list: this.descendVariable(block, 'LIST', LIST_TYPE),
item: this.descendInputOfBlock(block, 'ITEM')
});
Expand All @@ -290,12 +290,12 @@ class ScriptTreeGenerator {

case 'looks_backdropnumbername':
if (block.fields.NUMBER_NAME.value === 'number') {
return new IntermediateInput(InputOpcode.LOOKS_BACKDROP_NUMBER, InputType.NUMBER_POS_REAL);
return new IntermediateInput(InputOpcode.LOOKS_BACKDROP_NUMBER, InputType.NUMBER_POS_INT);
}
return new IntermediateInput(InputOpcode.LOOKS_BACKDROP_NAME, InputType.STRING);
case 'looks_costumenumbername':
if (block.fields.NUMBER_NAME.value === 'number') {
return new IntermediateInput(InputOpcode.LOOKS_COSTUME_NUMBER, InputType.NUMBER_POS_REAL);
return new IntermediateInput(InputOpcode.LOOKS_COSTUME_NUMBER, InputType.NUMBER_POS_INT);
}
return new IntermediateInput(InputOpcode.LOOKS_COSTUME_NAME, InputType.STRING);
case 'looks_size':
Expand Down Expand Up @@ -482,13 +482,13 @@ class ScriptTreeGenerator {
});
case 'sensing_current':
switch (block.fields.CURRENTMENU.value.toLowerCase()) {
case 'year': return new IntermediateInput(InputOpcode.SENSING_TIME_YEAR, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO);
case 'month': return new IntermediateInput(InputOpcode.SENSING_TIME_MONTH, InputType.NUMBER_POS_REAL);
case 'date': return new IntermediateInput(InputOpcode.SENSING_TIME_DATE, InputType.NUMBER_POS_REAL);
case 'dayofweek': return new IntermediateInput(InputOpcode.SENSING_TIME_WEEKDAY, InputType.NUMBER_POS_REAL);
case 'hour': return new IntermediateInput(InputOpcode.SENSING_TIME_HOUR, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO);
case 'minute': return new IntermediateInput(InputOpcode.SENSING_TIME_MINUTE, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO);
case 'second': return new IntermediateInput(InputOpcode.SENSING_TIME_SECOND, InputType.NUMBER_POS_REAL | InputType.NUMBER_ZERO);
case 'year': return new IntermediateInput(InputOpcode.SENSING_TIME_YEAR, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO);
case 'month': return new IntermediateInput(InputOpcode.SENSING_TIME_MONTH, InputType.NUMBER_POS_INT);
case 'date': return new IntermediateInput(InputOpcode.SENSING_TIME_DATE, InputType.NUMBER_POS_INT);
case 'dayofweek': return new IntermediateInput(InputOpcode.SENSING_TIME_WEEKDAY, InputType.NUMBER_POS_INT);
case 'hour': return new IntermediateInput(InputOpcode.SENSING_TIME_HOUR, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO);
case 'minute': return new IntermediateInput(InputOpcode.SENSING_TIME_MINUTE, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO);
case 'second': return new IntermediateInput(InputOpcode.SENSING_TIME_SECOND, InputType.NUMBER_POS_INT | InputType.NUMBER_ZERO);
default: return this.createConstantInput(0);
}
case 'sensing_dayssince2000':
Expand Down Expand Up @@ -523,7 +523,7 @@ class ScriptTreeGenerator {
switch (property) {
case 'background #': // fallthrough for scratch 1.0 compatibility
case 'backdrop #':
return new IntermediateInput(InputOpcode.SENSING_OF_BACKDROP_NUMBER, InputType.NUMBER_POS_REAL);
return new IntermediateInput(InputOpcode.SENSING_OF_BACKDROP_NUMBER, InputType.NUMBER_POS_INT);
case 'backdrop name':
return new IntermediateInput(InputOpcode.SENSING_OF_BACKDROP_NAME, InputType.STRING);
}
Expand All @@ -536,7 +536,7 @@ class ScriptTreeGenerator {
case 'direction':
return new IntermediateInput(InputOpcode.SENSING_OF_DIRECTION, InputType.NUMBER_REAL, {object});
case 'costume #':
return new IntermediateInput(InputOpcode.SENSING_OF_COSTUME_NUMBER, InputType.NUMBER_POS_REAL, {object});
return new IntermediateInput(InputOpcode.SENSING_OF_COSTUME_NUMBER, InputType.NUMBER_POS_INT, {object});
case 'costume name':
return new IntermediateInput(InputOpcode.SENSING_OF_COSTUME_NAME, InputType.STRING, {object});
case 'size':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const b1 = stage.variables["rQq!wAuU2T9DV9,S[/s."];
return function funXYZ_run () {
b0.value = [];
for (var a0 = 100; a0 >= 0.5; a0--) {
b0.value.push((b1.value[((b0.value.length + 1) | 0) - 1] ?? ""));
b0.value.push((b1.value[(b0.value.length + 1) - 1] ?? ""));
b0._monitorUpToDate = false;
}
thread.procedures["Wqsort %s %s"](1,b0.value.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const b1 = stage.variables["rQq!wAuU2T9DV9,S[/s."];
return function* genXYZ_run () {
b0.value = [];
for (var a0 = 100; a0 >= 0.5; a0--) {
b0.value.push((b1.value[((b0.value.length + 1) | 0) - 1] ?? ""));
b0.value.push((b1.value[(b0.value.length + 1) - 1] ?? ""));
b0._monitorUpToDate = false;
if (isStuck()) yield;
}
Expand Down