Skip to content

Commit 65ac67c

Browse files
committed
Merge branch 'source' into csep-machine
2 parents 28c43f5 + 883ffe7 commit 65ac67c

File tree

18 files changed

+4081
-3076
lines changed

18 files changed

+4081
-3076
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ cd dist
4848
$ npm link
4949
```
5050

51-
If you do not wish to add \"js-slang\" to your PATH, replace \"js-slang\" with \"node dist/repl/repl.js\" in the following examples.
51+
If you do not wish to add \"js-slang\" to your PATH, replace \"js-slang\" with \"node dist/repl\" in the following examples.
5252

5353
To try out _Source_ in a REPL, run
5454

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-slang",
3-
"version": "1.0.74",
3+
"version": "1.0.76",
44
"license": "Apache-2.0",
55
"description": "Javascript-based implementations of Source, written in Typescript",
66
"keywords": [

src/__tests__/mode.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ test('constants are not correctly loaded', () => {
7979
})
8080

8181
test('operator syntax type error', () => {
82-
const code = 'const num = 3; \nnum++; \nnum--; \nnum += 1;'
82+
const code = 'const num = 3; \nnum++; \nnum--; \nnum += 1; \n5 + num |2;'
8383

8484
setSession(Chapter.SOURCE_1, defaultVariant, defaultExternal, code)
8585

@@ -91,6 +91,15 @@ test('operator syntax type error', () => {
9191

9292
const token3 = session.getTokenAt(3, 5)
9393
expect(expectedBool(token3, CATEGORY.forbidden)).toBe(true)
94+
95+
const token4 = session.getTokenAt(4, 1)
96+
expect(expectedBool(token4, CATEGORY.number)).toBe(true)
97+
98+
const token5 = session.getTokenAt(4, 9)
99+
expect(expectedBool(token5, CATEGORY.forbidden)).toBe(true)
100+
101+
const token6 = session.getTokenAt(4, 10)
102+
expect(expectedBool(token6, CATEGORY.number)).toBe(true)
94103
})
95104

96105
test('forbidden keywords', () => {

src/cse-machine/__tests__/__snapshots__/cse-machine-heap.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7467,7 +7467,7 @@ EnvTree {
74677467
"type": "Literal",
74687468
"value": [Function],
74697469
},
7470-
"isEnvDependent": true,
7470+
"isEnvDependent": false,
74717471
"loc": undefined,
74727472
"optional": false,
74737473
"type": "CallExpression",
@@ -8313,7 +8313,7 @@ EnvTree {
83138313
"type": "Literal",
83148314
"value": [Function],
83158315
},
8316-
"isEnvDependent": true,
8316+
"isEnvDependent": false,
83178317
"loc": undefined,
83188318
"optional": false,
83198319
"type": "CallExpression",
@@ -9258,7 +9258,7 @@ EnvTree {
92589258
"type": "Literal",
92599259
"value": [Function],
92609260
},
9261-
"isEnvDependent": true,
9261+
"isEnvDependent": false,
92629262
"loc": undefined,
92639263
"optional": false,
92649264
"type": "CallExpression",
@@ -10222,7 +10222,7 @@ EnvTree {
1022210222
"type": "Literal",
1022310223
"value": [Function],
1022410224
},
10225-
"isEnvDependent": true,
10225+
"isEnvDependent": false,
1022610226
"loc": undefined,
1022710227
"optional": false,
1022810228
"type": "CallExpression",
@@ -10976,7 +10976,7 @@ EnvTree {
1097610976
"type": "Literal",
1097710977
"value": [Function],
1097810978
},
10979-
"isEnvDependent": true,
10979+
"isEnvDependent": false,
1098010980
"loc": undefined,
1098110981
"optional": false,
1098210982
"type": "CallExpression",
@@ -11229,7 +11229,7 @@ EnvTree {
1122911229
"type": "Literal",
1123011230
"value": [Function],
1123111231
},
11232-
"isEnvDependent": true,
11232+
"isEnvDependent": false,
1123311233
"loc": undefined,
1123411234
"optional": false,
1123511235
"type": "CallExpression",

0 commit comments

Comments
 (0)