From a89a7fcc65d949af12ab8b984bee224595d27e42 Mon Sep 17 00:00:00 2001 From: s-kybound Date: Tue, 20 Feb 2024 14:22:03 +0800 Subject: [PATCH 01/16] Switch Scheme languages fully to CSE Machine --- src/commons/application/ApplicationTypes.ts | 10 +- .../__snapshots__/ApplicationTypes.ts.snap | 10 +- .../__snapshots__/EnvVisualizer.tsx.snap | 1012 +++++++++++++++-- 3 files changed, 920 insertions(+), 112 deletions(-) diff --git a/src/commons/application/ApplicationTypes.ts b/src/commons/application/ApplicationTypes.ts index 10a3ab8877..17189b1cba 100644 --- a/src/commons/application/ApplicationTypes.ts +++ b/src/commons/application/ApplicationTypes.ts @@ -186,11 +186,11 @@ export const htmlLanguage: SALanguage = { }; const schemeSubLanguages: Array> = [ - { chapter: Chapter.SCHEME_1, variant: Variant.DEFAULT, displayName: 'Scheme \xa71' }, - { chapter: Chapter.SCHEME_2, variant: Variant.DEFAULT, displayName: 'Scheme \xa72' }, - { chapter: Chapter.SCHEME_3, variant: Variant.DEFAULT, displayName: 'Scheme \xa73' }, - { chapter: Chapter.SCHEME_4, variant: Variant.DEFAULT, displayName: 'Scheme \xa74' }, - { chapter: Chapter.FULL_SCHEME, variant: Variant.DEFAULT, displayName: 'Full Scheme' } + { chapter: Chapter.SCHEME_1, variant: Variant.EXPLICIT_CONTROL, displayName: 'Scheme \xa71' }, + { chapter: Chapter.SCHEME_2, variant: Variant.EXPLICIT_CONTROL, displayName: 'Scheme \xa72' }, + { chapter: Chapter.SCHEME_3, variant: Variant.EXPLICIT_CONTROL, displayName: 'Scheme \xa73' }, + { chapter: Chapter.SCHEME_4, variant: Variant.EXPLICIT_CONTROL, displayName: 'Scheme \xa74' }, + { chapter: Chapter.FULL_SCHEME, variant: Variant.EXPLICIT_CONTROL, displayName: 'Full Scheme' } ]; export const schemeLanguages: SALanguage[] = schemeSubLanguages.map(sublang => { diff --git a/src/commons/application/__tests__/__snapshots__/ApplicationTypes.ts.snap b/src/commons/application/__tests__/__snapshots__/ApplicationTypes.ts.snap index b00c66abc1..b828230566 100644 --- a/src/commons/application/__tests__/__snapshots__/ApplicationTypes.ts.snap +++ b/src/commons/application/__tests__/__snapshots__/ApplicationTypes.ts.snap @@ -23,7 +23,7 @@ Array [ "supports": Object { "repl": true, }, - "variant": "default", + "variant": "explicit-control", }, Object { "chapter": -10, @@ -32,7 +32,7 @@ Array [ "supports": Object { "repl": true, }, - "variant": "default", + "variant": "explicit-control", }, Object { "chapter": -11, @@ -41,7 +41,7 @@ Array [ "supports": Object { "repl": true, }, - "variant": "default", + "variant": "explicit-control", }, Object { "chapter": -12, @@ -50,7 +50,7 @@ Array [ "supports": Object { "repl": true, }, - "variant": "default", + "variant": "explicit-control", }, Object { "chapter": -13, @@ -59,7 +59,7 @@ Array [ "supports": Object { "repl": true, }, - "variant": "default", + "variant": "explicit-control", }, ] `; diff --git a/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap b/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap index 0d39929d31..aae0af12d9 100644 --- a/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap +++ b/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap @@ -7,6 +7,595 @@ exports[`EnvVisualizer Control Stash correctly renders: Control is truncated pro onMouseLeave={[Function]} x={20} y={40} + > + + + + + + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 2`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 3`] = ` + + + + + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 4`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 5`] = ` + + + + + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 6`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 7`] = ` + + + + + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 8`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 9`] = ` + + + + + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 10`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 11`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 12`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 13`] = ` + + `; -exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 2`] = ` +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 14`] = ` + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 15`] = ` + + + + +`; + +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 16`] = ` + + `; -exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 3`] = ` +exports[`EnvVisualizer Control Stash correctly renders: Control is truncated properly 17`] = ` @@ -824,7 +1658,7 @@ exports[`EnvVisualizer Control Stash correctly renders: arrows from the environm @@ -858,19 +1692,19 @@ exports[`EnvVisualizer Control Stash correctly renders: arrows from the environm fontVariant="normal" padding={5} preventDefault={false} - text="Assign new value to array at given index" + text="arr[x] = () => x;" /> `; -exports[`EnvVisualizer Control Stash correctly renders: arrows from the environment instruction to the frame and arrows from the stash to closures 14`] = ` +exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 1`] = ` `; -exports[`EnvVisualizer Control Stash correctly renders: arrows from the environment instruction to the frame and arrows from the stash to closures 15`] = ` +exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 2`] = ` + + + + `; -exports[`EnvVisualizer Control Stash correctly renders: arrows from the environment instruction to the frame and arrows from the stash to closures 16`] = ` +exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 3`] = ` - - - - `; -exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 1`] = ` +exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 4`] = ` `; -exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 2`] = ` +exports[`EnvVisualizer Control Stash correctly renders: global environments are treated correctly 5`] = ` - - - - `; From 93f6df2cc4039eb1d56117c59a6ac3f47b55deb5 Mon Sep 17 00:00:00 2001 From: s-kybound Date: Tue, 20 Feb 2024 23:41:39 +0800 Subject: [PATCH 02/16] Updated tests with windows machine --- .../__snapshots__/EnvVisualizer.tsx.snap | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap b/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap index aae0af12d9..d6ddb2ae77 100644 --- a/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap +++ b/src/features/envVisualizer/__tests__/__snapshots__/EnvVisualizer.tsx.snap @@ -181,7 +181,7 @@ exports[`EnvVisualizer Control Stash correctly renders: Control is truncated pro onMouseLeave={[Function]} >