Skip to content

Commit 0be74e7

Browse files
authored
Remove Interpreter and Testing Refactor (#1745)
* Relocate svmc repl prompt * Run format * Remove interpreter * Remove interpreter and refactor tests * Update tsconfig and certain test files * Further remove references to concurrent * updated snapshots to use unix-style paths * Add tests for parser rules * Revert "Add tests for parser rules" This reverts commit ed8eb2c. * Move rule type into parser * Move parser rules to RuleError * Updating tests * Update ast helpers * Refactor runners to include execution method tests * Run format * Simplify determineExecutionMethod * Fix broken cse-machine tests * Update parser tests to use simpler snapshots * Rename test functions and assertions * Run format * Add a script that makes running jest on windows easier * Update previously broken tests relating to display * Add tests for testing utils * Fix test utils not correctly handling snapshot names * Add some missing tests to modules preprocessor * Fix some potentially misleading tests that were passing * Remove deprecated code * Miscellanous changes * Convert more scripts to js * Remove depcreated sicp-prepare code * Update benchmark testing script * Fix the broken benchmark tests * Update tests * Add devEngines to package json * Refactor typed modules tests
1 parent fea2b4c commit 0be74e7

File tree

199 files changed

+14758
-29603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+14758
-29603
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ You can set additional options:
6464
Usage: js-slang [PROGRAM_STRING] [OPTION]
6565
6666
-c, --chapter=CHAPTER set the Source chapter number (i.e., 1-4) (default: 1)
67-
-v, --variant=VARIANT set the Source variant (i.e., default, interpreter, substituter, typed, concurrent, wasm) (default: default)
67+
-v, --variant=VARIANT set the Source variant (i.e., default, interpreter, substituter, typed, wasm) (default: default)
6868
-h, --help display this help
6969
-e, --eval don't show REPL, only display output of evaluation
7070
```
@@ -81,7 +81,6 @@ Currently, valid CHAPTER/VARIANT combinations are:
8181
- `--chapter=2 --variant=interpreter`
8282
- `--chapter=2 --variant=typed`
8383
- `--chapter=3 --variant=default`
84-
- `--chapter=3 --variant=concurrent`
8584
- `--chapter=3 --variant=interpreter`
8685
- `--chapter=3 --variant=typed`
8786
- `--chapter=4 --variant=default`

docs/lib/concurrency.js

-32
This file was deleted.

docs/md/README_3_CONCURRENT.md

-62
This file was deleted.

docs/md/README_CONCURRENCY.md

-10
This file was deleted.

docs/md/README_top.md

-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ the members of our learning community.
3131

3232
#### <a href="source_2_typed/">Source §2 Typed</a>
3333

34-
#### <a href="source_3_concurrent/">Source §3 Concurrent</a>
35-
3634
#### <a href="source_3_typed/">Source §3 Typed</a>
3735

3836
#### <a href="source_4_typed/">Source §4 Typed</a>
@@ -58,8 +56,6 @@ the Source Academy.
5856

5957
#### <a href="source_2_typed.pdf">Specification of Source §2 Typed</a>
6058

61-
#### <a href="source_3_concurrent.pdf">Specification of Source §3 Concurrent</a>
62-
6359
#### <a href="source_3_typed.pdf">Specification of Source §3 Typed</a>
6460

6561
#### <a href="source_4_typed.pdf">Specification of Source §4 Typed</a>

docs/specs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PDFLATEX = latexmk -pdf
22

3-
SPECSNUMS = 1 1_wasm 1_type_inference 1_infinite_loop_detection 1_typed 2 2_typed 3_type_inference 3 3_concurrent 3_typed 4 4_explicitcontrol 4_typed styleguide 2_stepper studio_2 python_1
3+
SPECSNUMS = 1 1_wasm 1_type_inference 1_infinite_loop_detection 1_typed 2 2_typed 3_type_inference 3 3_typed 4 4_explicitcontrol 4_typed styleguide 2_stepper studio_2 python_1
44

55
SPECS = $(SPECSNUMS:%=source_%)
66

docs/specs/source_3_concurrent.tex

-106
This file was deleted.

docs/specs/source_concurrency.tex

-9
This file was deleted.

eslint.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default tseslint.config(
1111
},
1212
...tseslint.configs.recommended,
1313
{
14-
files: ['**/*.ts*'],
14+
files: ['**/*.ts*', 'scripts/*.mjs'],
1515
languageOptions: {
1616
globals: {
1717
...globals.node,
@@ -32,6 +32,7 @@ export default tseslint.config(
3232
'import/order': 'warn',
3333
'@typescript-eslint/no-base-to-string': 'off', // TODO: Remove
3434
'prefer-const': 'off', // TODO: Remove
35+
'no-constant-condition': ['warn', { checkLoops: false }],
3536
'no-var': 'off', // TODO: Remove
3637
'@typescript-eslint/ban-ts-comment': 'warn',
3738
'@typescript-eslint/ban-types': 'off',

package.json

+15-7
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
"eslint": "eslint src",
5151
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
5252
"format:ci": "prettier --list-different \"src/**/*.{ts,tsx}\"",
53-
"test": "jest",
54-
"test-coverage": "jest --coverage",
53+
"test": "node ./scripts/run_jest.mjs",
54+
"test-coverage": "yarn test --coverage",
5555
"docs": "node ./scripts/docs.mjs docs",
5656
"jsdoc": "node ./scripts/docs.mjs",
5757
"autocomplete": "node ./scripts/docs.mjs autocomplete",
58-
"build_sicp_package": "./scripts/build_sicp_package.sh",
58+
"build_sicp_package": "yarn build && node ./scripts/build_sicp_package.mjs",
5959
"publish_sicp_package": "./scripts/publish_sicp_package.sh",
60-
"benchmark": "jest --runInBand --testPathPattern='.*benchmark.*' --testPathIgnorePatterns='/dist/'",
60+
"benchmark": "node ./scripts/run_jest.mjs --runInBand --testPathPattern='.*benchmark.*' --testPathIgnorePatterns='/dist/'",
6161
"prepare": "husky install"
6262
},
6363
"devDependencies": {
@@ -85,6 +85,14 @@
8585
"typescript": "^4.0.3",
8686
"typescript-eslint": "^8.8.1"
8787
},
88+
"devEngines": {
89+
"packageManager": {
90+
"name": "yarn",
91+
"version": "^4.6.0",
92+
"onFail": "error"
93+
}
94+
},
95+
"packageManager": "[email protected]",
8896
"jest": {
8997
"snapshotFormat": {
9098
"escapeString": true,
@@ -124,7 +132,7 @@
124132
"includeConsoleLog": true
125133
}
126134
]
127-
]
128-
},
129-
"packageManager": "[email protected]"
135+
],
136+
"prettierPath": null
137+
}
130138
}

scripts/autocomplete.mjs

+11-12
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ const SRC_FILENAME = 'global.html'
1212
const OUT_DIR = 'src/editors/ace/docTooltip'
1313

1414
const TARGETS = [
15-
'source_1',
16-
'source_1_wasm',
17-
'source_1_typed',
18-
'source_2',
19-
'source_2_typed',
20-
'source_3',
21-
'source_3_concurrent',
22-
'source_3_typed',
23-
'source_4',
24-
'source_4_typed',
25-
'source_4_explicit-control',
26-
'External libraries'
15+
"source_1",
16+
"source_1_wasm",
17+
"source_1_typed",
18+
"source_2",
19+
"source_2_typed",
20+
"source_3",
21+
"source_3_typed",
22+
"source_4",
23+
"source_4_typed",
24+
"source_4_explicit-control",
25+
"External libraries"
2726
]
2827

2928
function newTitleNode(title, document) {

0 commit comments

Comments
 (0)