diff --git a/src/compiler/intermediate.js b/src/compiler/intermediate.js index a7e0eb6a50..9882cefc62 100644 --- a/src/compiler/intermediate.js +++ b/src/compiler/intermediate.js @@ -26,6 +26,12 @@ class IntermediateScript { */ this.isProcedure = false; + /** + * This procedure's variant, if any. + * @type {string} + */ + this.procedureVariant = ''; + /** * This procedure's code, if any. * @type {string} diff --git a/src/compiler/irgen.js b/src/compiler/irgen.js index c3679fb41a..39707ef5c6 100644 --- a/src/compiler/irgen.js +++ b/src/compiler/irgen.js @@ -87,6 +87,7 @@ class ScriptTreeGenerator { setProcedureVariant (procedureVariant) { const procedureCode = parseProcedureCode(procedureVariant); + this.script.procedureVariant = procedureVariant; this.script.procedureCode = procedureCode; this.script.isProcedure = true; this.script.yields = false; diff --git a/test/snapshot/__snapshots__/tw-comparison-matrix-runtime.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-comparison-matrix-runtime.sb3.tw-snapshot index db33cbdc59..f97edfc143 100644 --- a/test/snapshot/__snapshots__/tw-comparison-matrix-runtime.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-comparison-matrix-runtime.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "aZ", n retire(); return; }; }) -// Sprite1 run test +// Sprite1 Wrun test (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["mfV;yS}9e:%h5UZ)QyiY"]; const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -46,7 +46,7 @@ if (hasResumedFromPromise) {hasResumedFromPromise = false;continue;} return ""; }; }) -// Sprite1 setup values +// Sprite1 Wsetup values (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["n^wm8jw#b24sggt.S^tD"]; return function funXYZ_setup_values () { diff --git a/test/snapshot/__snapshots__/tw-custom-report-repeat.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-custom-report-repeat.sb3.tw-snapshot index 69db6e2479..060537d67a 100644 --- a/test/snapshot/__snapshots__/tw-custom-report-repeat.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-custom-report-repeat.sb3.tw-snapshot @@ -19,7 +19,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "l", nu retire(); return; }; }) -// Sprite1 block name +// Sprite1 Zblock name (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_block_name () { return 40; diff --git a/test/snapshot/__snapshots__/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot index 3e18fa82c3..704116bfee 100644 --- a/test/snapshot/__snapshots__/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot @@ -21,7 +21,7 @@ retire(); return; retire(); return; }; }) -// Sprite1 no refresh +// Sprite1 Wno refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("music_restForBeats"); const b1 = runtime.getOpcodeFunction("music_playDrumForBeats"); @@ -41,14 +41,14 @@ runtime.ext_scratch3_motion._moveSteps(0, target); return ""; }; }) -// Sprite1 runs below with no refresh +// Sprite1 Wruns below with no refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_runs_below_with_no_r () { yield* thread.procedures["Whas refresh"](); return ""; }; }) -// Sprite1 has refresh +// Sprite1 Whas refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("music_restForBeats"); const b1 = runtime.getOpcodeFunction("music_playDrumForBeats"); diff --git a/test/snapshot/__snapshots__/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot index 757a905305..07442f3cde 100644 --- a/test/snapshot/__snapshots__/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot @@ -11,14 +11,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "g", nu retire(); return; }; }) -// Sprite1 foo %s +// Sprite1 Zfoo %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_foo_ (p0) { return ""; return ""; }; }) -// Sprite1 no op +// Sprite1 Zno op (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_no_op () { return ""; diff --git a/test/snapshot/__snapshots__/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot index 11339e414f..58b908a70c 100644 --- a/test/snapshot/__snapshots__/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "Q^(MKg retire(); return; }; }) -// Player Set Costume +// Player ZSet Costume (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_Set_Costume () { diff --git a/test/snapshot/__snapshots__/tw-procedure-arguments-with-same-name.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-arguments-with-same-name.sb3.tw-snapshot index dadb8b277f..f2456f2e25 100644 --- a/test/snapshot/__snapshots__/tw-procedure-arguments-with-same-name.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-arguments-with-same-name.sb3.tw-snapshot @@ -12,7 +12,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "$R-1lb retire(); return; }; }) -// Sprite1 number or text %s %s +// Sprite1 Znumber or text %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_number_or_text__ (p0,p1) { @@ -22,7 +22,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass",}, b0, false, false, "HH`yR return ""; }; }) -// Sprite1 boolean %b %b +// Sprite1 Zboolean %b %b (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_boolean__ (p0,p1) { diff --git a/test/snapshot/__snapshots__/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot index 39fef6c8ad..548eb4b32c 100644 --- a/test/snapshot/__snapshots__/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot @@ -16,7 +16,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, ",vD-ZG retire(); return; }; }) -// Sprite1 do something +// Sprite1 Zdo something (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; return function funXYZ_do_something () { diff --git a/test/snapshot/__snapshots__/tw-procedure-return-non-existant.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-return-non-existant.sb3.tw-snapshot index 07ec6f5f64..2aa9b207d2 100644 --- a/test/snapshot/__snapshots__/tw-procedure-return-non-existant.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-return-non-existant.sb3.tw-snapshot @@ -39,14 +39,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "P", nu retire(); return; }; }) -// Sprite1 invalid params - reporter +// Sprite1 Zinvalid params - reporter (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_invalid_params___rep () { return 0; return ""; }; }) -// Sprite1 invalid params - boolean +// Sprite1 Zinvalid params - boolean (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_invalid_params___boo () { return 0; diff --git a/test/snapshot/__snapshots__/tw-procedure-return-recursion.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-return-recursion.sb3.tw-snapshot index 47b729ca98..6251bdac2e 100644 --- a/test/snapshot/__snapshots__/tw-procedure-return-recursion.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-return-recursion.sb3.tw-snapshot @@ -30,7 +30,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "av", n retire(); return; }; }) -// Sprite1 non warp recursion should yield %s +// Sprite1 Znon warp recursion should yield %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_non_warp_recursion_s (p0) { if (compareGreaterThan(p0, 0)) { @@ -39,7 +39,7 @@ return (yield* yieldThenCallGenerator(thread.procedures["Znon warp recursion sho return ""; }; }) -// Sprite1 warp recursion should not yield %s +// Sprite1 Wwarp recursion should not yield %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_warp_recursion_shoul (p0) { if (compareGreaterThan(p0, 0)) { @@ -48,7 +48,7 @@ return thread.procedures["Wwarp recursion should not yield %s"](((+p0 || 0) - 1) return ""; }; }) -// Sprite1 fib %s +// Sprite1 Zfib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_fib_ (p0) { if (compareLessThan(p0, 2)) { @@ -59,7 +59,7 @@ return ((+(yield* yieldThenCallGenerator(thread.procedures["Zfib %s"], ((+p0 || return ""; }; }) -// Sprite1 recursing yields between each %s +// Sprite1 Zrecursing yields between each %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -83,7 +83,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":("fail recursing between calls yie return ""; }; }) -// Sprite1 recursing arguments eval order %s %s %s %s +// Sprite1 Zrecursing arguments eval order %s %s %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["4HH82mPlVMOONdl(Ot*7"]; const b1 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; diff --git a/test/snapshot/__snapshots__/tw-procedure-return-simple.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-return-simple.sb3.tw-snapshot index c5c073c9bb..b0ae54eb5b 100644 --- a/test/snapshot/__snapshots__/tw-procedure-return-simple.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-return-simple.sb3.tw-snapshot @@ -27,14 +27,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "`", nu retire(); return; }; }) -// Sprite1 simplest +// Sprite1 Zsimplest (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_simplest () { return "It works!"; return ""; }; }) -// Sprite1 nesting 1 +// Sprite1 Znesting 1 (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_1 () { thread.procedures["Znesting 2"](); @@ -42,14 +42,14 @@ return (("" + thread.procedures["Znesting 3 %s %s"](6,7)) + ("" + thread.procedu return ""; }; }) -// Sprite1 warp fib %s +// Sprite1 Wwarp fib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_warp_fib_ (p0) { return thread.procedures["Wfib %s"](p0); return ""; }; }) -// Sprite1 factorial %s +// Sprite1 Wfactorial %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_factorial_ (p0) { if (compareGreaterThan(p0, 1)) { @@ -59,7 +59,7 @@ return 1; return ""; }; }) -// Sprite1 no shadowing 1 %s %s +// Sprite1 Zno shadowing 1 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -78,21 +78,21 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass shadow check 3",}, b0, false return ""; }; }) -// Sprite1 nesting 2 +// Sprite1 Znesting 2 (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_2 () { return "discard nesting 2"; return ""; }; }) -// Sprite1 nesting 3 %s %s +// Sprite1 Znesting 3 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_3__ (p0,p1) { return ((+p0 || 0) * (+p1 || 0)); return ""; }; }) -// Sprite1 fib %s +// Sprite1 Wfib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_fib_ (p0) { if (compareLessThan(p0, 2)) { @@ -103,7 +103,7 @@ return ((+thread.procedures["Wfib %s"](((+p0 || 0) - 1)) || 0) + (+thread.proced return ""; }; }) -// Sprite1 no shadowing 2 %s %s +// Sprite1 Zno shadowing 2 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_no_shadowing_2__ (p0,p1) { return "discard shadow 2"; diff --git a/test/snapshot/__snapshots__/tw-procedure-return-stops-scripts.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-return-stops-scripts.sb3.tw-snapshot index 45d745a6a6..29d85a5813 100644 --- a/test/snapshot/__snapshots__/tw-procedure-return-stops-scripts.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-return-stops-scripts.sb3.tw-snapshot @@ -19,7 +19,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "v", nu retire(); return; }; }) -// Sprite1 return stops the script immediately +// Sprite1 Wreturn stops the script immediately (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["PsAI*C{QHI3*4?O8p#TM"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/__snapshots__/tw-procedure-return-warp.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-procedure-return-warp.sb3.tw-snapshot index 878db428b1..fde5f01658 100644 --- a/test/snapshot/__snapshots__/tw-procedure-return-warp.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-procedure-return-warp.sb3.tw-snapshot @@ -32,7 +32,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "N", nu retire(); return; }; }) -// Sprite1 non warp +// Sprite1 Znon warp (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); @@ -73,7 +73,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass non warp 2",}, b1, false, fa return ""; }; }) -// Sprite1 verify runs warp %s +// Sprite1 Wverify runs warp %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); @@ -95,7 +95,7 @@ return ("warp: " + ("" + p0)); return ""; }; }) -// Sprite1 verify runs non warp %s +// Sprite1 Zverify runs non warp %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/__snapshots__/tw-safe-procedure-argument-casting.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-safe-procedure-argument-casting.sb3.tw-snapshot index be17fe1513..88f7ab0b01 100644 --- a/test/snapshot/__snapshots__/tw-safe-procedure-argument-casting.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-safe-procedure-argument-casting.sb3.tw-snapshot @@ -18,7 +18,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "$R-1lb retire(); return; }; }) -// Sprite1 switch %s +// Sprite1 Zswitch %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_switch_ (p0) { runtime.ext_scratch3_looks._setCostume(target, p0); diff --git a/test/snapshot/__snapshots__/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot index 7300855375..bd4bdca843 100644 --- a/test/snapshot/__snapshots__/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "s", nu retire(); return; }; }) -// Sprite1 run without screen refresh +// Sprite1 Wrun without screen refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["F?*}X,`9XBpN_[piGRrz"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/__snapshots__/warp-timer/tw-comparison-matrix-runtime.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-comparison-matrix-runtime.sb3.tw-snapshot index 2a7cb4c099..0808a3a2fa 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-comparison-matrix-runtime.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-comparison-matrix-runtime.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "aZ", n retire(); return; }; }) -// Sprite1 run test +// Sprite1 Wrun test (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["mfV;yS}9e:%h5UZ)QyiY"]; const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -48,7 +48,7 @@ if (isStuck()) yield; return ""; }; }) -// Sprite1 setup values +// Sprite1 Wsetup values (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["n^wm8jw#b24sggt.S^tD"]; return function funXYZ_setup_values () { diff --git a/test/snapshot/__snapshots__/warp-timer/tw-custom-report-repeat.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-custom-report-repeat.sb3.tw-snapshot index 69db6e2479..060537d67a 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-custom-report-repeat.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-custom-report-repeat.sb3.tw-snapshot @@ -19,7 +19,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "l", nu retire(); return; }; }) -// Sprite1 block name +// Sprite1 Zblock name (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_block_name () { return 40; diff --git a/test/snapshot/__snapshots__/warp-timer/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot index 83841a9ab7..a3d9393316 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3.tw-snapshot @@ -21,7 +21,7 @@ retire(); return; retire(); return; }; }) -// Sprite1 no refresh +// Sprite1 Wno refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("music_restForBeats"); const b1 = runtime.getOpcodeFunction("music_playDrumForBeats"); @@ -42,14 +42,14 @@ if (isStuck()) yield; return ""; }; }) -// Sprite1 runs below with no refresh +// Sprite1 Wruns below with no refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_runs_below_with_no_r () { yield* thread.procedures["Whas refresh"](); return ""; }; }) -// Sprite1 has refresh +// Sprite1 Whas refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("music_restForBeats"); const b1 = runtime.getOpcodeFunction("music_playDrumForBeats"); diff --git a/test/snapshot/__snapshots__/warp-timer/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot index 757a905305..07442f3cde 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3.tw-snapshot @@ -11,14 +11,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "g", nu retire(); return; }; }) -// Sprite1 foo %s +// Sprite1 Zfoo %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_foo_ (p0) { return ""; return ""; }; }) -// Sprite1 no op +// Sprite1 Zno op (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_no_op () { return ""; diff --git a/test/snapshot/__snapshots__/warp-timer/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot index 11339e414f..58b908a70c 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-prefers-first-occurence-of-procedure-387608267.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "Q^(MKg retire(); return; }; }) -// Player Set Costume +// Player ZSet Costume (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_Set_Costume () { diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-arguments-with-same-name.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-arguments-with-same-name.sb3.tw-snapshot index dadb8b277f..f2456f2e25 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-arguments-with-same-name.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-arguments-with-same-name.sb3.tw-snapshot @@ -12,7 +12,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "$R-1lb retire(); return; }; }) -// Sprite1 number or text %s %s +// Sprite1 Znumber or text %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_number_or_text__ (p0,p1) { @@ -22,7 +22,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass",}, b0, false, false, "HH`yR return ""; }; }) -// Sprite1 boolean %b %b +// Sprite1 Zboolean %b %b (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); return function* genXYZ_boolean__ (p0,p1) { diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot index 39fef6c8ad..548eb4b32c 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-call-resets-variable-input-types-430811055.sb3.tw-snapshot @@ -16,7 +16,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, ",vD-ZG retire(); return; }; }) -// Sprite1 do something +// Sprite1 Zdo something (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; return function funXYZ_do_something () { diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-non-existant.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-non-existant.sb3.tw-snapshot index 07ec6f5f64..2aa9b207d2 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-non-existant.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-non-existant.sb3.tw-snapshot @@ -39,14 +39,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "P", nu retire(); return; }; }) -// Sprite1 invalid params - reporter +// Sprite1 Zinvalid params - reporter (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_invalid_params___rep () { return 0; return ""; }; }) -// Sprite1 invalid params - boolean +// Sprite1 Zinvalid params - boolean (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_invalid_params___boo () { return 0; diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-recursion.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-recursion.sb3.tw-snapshot index 47b729ca98..6251bdac2e 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-recursion.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-recursion.sb3.tw-snapshot @@ -30,7 +30,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "av", n retire(); return; }; }) -// Sprite1 non warp recursion should yield %s +// Sprite1 Znon warp recursion should yield %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_non_warp_recursion_s (p0) { if (compareGreaterThan(p0, 0)) { @@ -39,7 +39,7 @@ return (yield* yieldThenCallGenerator(thread.procedures["Znon warp recursion sho return ""; }; }) -// Sprite1 warp recursion should not yield %s +// Sprite1 Wwarp recursion should not yield %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_warp_recursion_shoul (p0) { if (compareGreaterThan(p0, 0)) { @@ -48,7 +48,7 @@ return thread.procedures["Wwarp recursion should not yield %s"](((+p0 || 0) - 1) return ""; }; }) -// Sprite1 fib %s +// Sprite1 Zfib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function* genXYZ_fib_ (p0) { if (compareLessThan(p0, 2)) { @@ -59,7 +59,7 @@ return ((+(yield* yieldThenCallGenerator(thread.procedures["Zfib %s"], ((+p0 || return ""; }; }) -// Sprite1 recursing yields between each %s +// Sprite1 Zrecursing yields between each %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -83,7 +83,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":("fail recursing between calls yie return ""; }; }) -// Sprite1 recursing arguments eval order %s %s %s %s +// Sprite1 Zrecursing arguments eval order %s %s %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["4HH82mPlVMOONdl(Ot*7"]; const b1 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-simple.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-simple.sb3.tw-snapshot index c5c073c9bb..b0ae54eb5b 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-simple.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-simple.sb3.tw-snapshot @@ -27,14 +27,14 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "`", nu retire(); return; }; }) -// Sprite1 simplest +// Sprite1 Zsimplest (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_simplest () { return "It works!"; return ""; }; }) -// Sprite1 nesting 1 +// Sprite1 Znesting 1 (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_1 () { thread.procedures["Znesting 2"](); @@ -42,14 +42,14 @@ return (("" + thread.procedures["Znesting 3 %s %s"](6,7)) + ("" + thread.procedu return ""; }; }) -// Sprite1 warp fib %s +// Sprite1 Wwarp fib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_warp_fib_ (p0) { return thread.procedures["Wfib %s"](p0); return ""; }; }) -// Sprite1 factorial %s +// Sprite1 Wfactorial %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_factorial_ (p0) { if (compareGreaterThan(p0, 1)) { @@ -59,7 +59,7 @@ return 1; return ""; }; }) -// Sprite1 no shadowing 1 %s %s +// Sprite1 Zno shadowing 1 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = runtime.getOpcodeFunction("looks_say"); const b1 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; @@ -78,21 +78,21 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass shadow check 3",}, b0, false return ""; }; }) -// Sprite1 nesting 2 +// Sprite1 Znesting 2 (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_2 () { return "discard nesting 2"; return ""; }; }) -// Sprite1 nesting 3 %s %s +// Sprite1 Znesting 3 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_nesting_3__ (p0,p1) { return ((+p0 || 0) * (+p1 || 0)); return ""; }; }) -// Sprite1 fib %s +// Sprite1 Wfib %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_fib_ (p0) { if (compareLessThan(p0, 2)) { @@ -103,7 +103,7 @@ return ((+thread.procedures["Wfib %s"](((+p0 || 0) - 1)) || 0) + (+thread.proced return ""; }; }) -// Sprite1 no shadowing 2 %s %s +// Sprite1 Zno shadowing 2 %s %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_no_shadowing_2__ (p0,p1) { return "discard shadow 2"; diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-stops-scripts.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-stops-scripts.sb3.tw-snapshot index 5def63b29b..c0355f7aa4 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-stops-scripts.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-stops-scripts.sb3.tw-snapshot @@ -19,7 +19,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "v", nu retire(); return; }; }) -// Sprite1 return stops the script immediately +// Sprite1 Wreturn stops the script immediately (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["PsAI*C{QHI3*4?O8p#TM"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-warp.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-warp.sb3.tw-snapshot index 019ba31cb7..d7afc882d2 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-warp.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-procedure-return-warp.sb3.tw-snapshot @@ -32,7 +32,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "N", nu retire(); return; }; }) -// Sprite1 non warp +// Sprite1 Znon warp (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); @@ -73,7 +73,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"pass non warp 2",}, b1, false, fa return ""; }; }) -// Sprite1 verify runs warp %s +// Sprite1 Wverify runs warp %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); @@ -96,7 +96,7 @@ return ("warp: " + ("" + p0)); return ""; }; }) -// Sprite1 verify runs non warp %s +// Sprite1 Zverify runs non warp %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["Go=PJS7BFXYo_qi2S:kQ"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/__snapshots__/warp-timer/tw-safe-procedure-argument-casting.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-safe-procedure-argument-casting.sb3.tw-snapshot index be17fe1513..88f7ab0b01 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-safe-procedure-argument-casting.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-safe-procedure-argument-casting.sb3.tw-snapshot @@ -18,7 +18,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "$R-1lb retire(); return; }; }) -// Sprite1 switch %s +// Sprite1 Zswitch %s (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); return function funXYZ_switch_ (p0) { runtime.ext_scratch3_looks._setCostume(target, p0); diff --git a/test/snapshot/__snapshots__/warp-timer/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot index 7300855375..bd4bdca843 100644 --- a/test/snapshot/__snapshots__/warp-timer/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot +++ b/test/snapshot/__snapshots__/warp-timer/tw-warp-repeat-until-timer-greater-than.sb3.tw-snapshot @@ -11,7 +11,7 @@ yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "s", nu retire(); return; }; }) -// Sprite1 run without screen refresh +// Sprite1 Wrun without screen refresh (function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); const b0 = stage.variables["F?*}X,`9XBpN_[piGRrz"]; const b1 = runtime.getOpcodeFunction("looks_say"); diff --git a/test/snapshot/lib.js b/test/snapshot/lib.js index 3f8b895d12..b49033ffa0 100644 --- a/test/snapshot/lib.js +++ b/test/snapshot/lib.js @@ -96,7 +96,7 @@ const generateActualSnapshot = async testCase => { JSGenerator.testingApparatus = { report: (jsgen, factorySource) => { const targetName = jsgen.target.getName(); - const scriptName = jsgen.script.procedureCode || 'script'; + const scriptName = jsgen.script.procedureVariant || 'script'; const js = normalizeJS(factorySource); generatedJS.push(`// ${targetName} ${scriptName}\n${js}`); }