Skip to content

Commit

Permalink
CSE Machine: Rename to CS1101S terms (#1514)
Browse files Browse the repository at this point in the history
* renamed "cse-machine" to "ec-evaluator"

* rename runECEvaluator to runCSEMachine

* renamed Agenda to Control

* fix snapshot

* rename ECE to CSE

* additional renaming from ec to cse

* rename tests to cse-machine

* implement suggestions
  • Loading branch information
NhatMinh0208 authored Feb 1, 2024
1 parent 1fd06be commit d6553ca
Show file tree
Hide file tree
Showing 20 changed files with 257 additions and 247 deletions.
42 changes: 21 additions & 21 deletions src/__tests__/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ xtest('debugger; statement basic test', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -53,7 +53,7 @@ xtest('debugger; statement in function', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -110,7 +110,7 @@ xtest('debugger; statement test function scope', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -136,7 +136,7 @@ xtest('debugger; statement hoisting', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -160,7 +160,7 @@ xtest('debugger; pauses for', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -185,7 +185,7 @@ xtest('debugger; pauses while', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -216,7 +216,7 @@ xtest('setBreakpointAtLine basic', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -241,7 +241,7 @@ xtest('setBreakpointAtLine function 1', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand All @@ -266,7 +266,7 @@ xtest('setBreakpointAtLine function 2', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -318,7 +318,7 @@ xtest('setBreakpointAtLine function 4', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -349,12 +349,12 @@ xtest('setBreakpointAtLine granularity 1', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj1) as Promise<Result>).then(obj2 => {
return (resume(obj2) as Promise<Result>).then(obj3 => {
expect(flattenEnvironments(obj3)).toMatchSnapshot()
expect(obj3.status).toBe('suspended-ec-eval')
expect(obj3.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -384,7 +384,7 @@ xtest('setBreakpointAtLine granularity 2', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj1) as Promise<Result>).then(obj2 => {
expect(flattenEnvironments(obj2)).toMatchSnapshot()
Expand Down Expand Up @@ -418,11 +418,11 @@ xtest('setBreakpointAtLine granularity 3', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj1) as Promise<Result>).then(obj2 => {
expect(flattenEnvironments(obj2)).toMatchSnapshot()
expect(obj2.status).toBe('suspended-ec-eval')
expect(obj2.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj2) as Promise<Result>).then(obj3 => {
expect(flattenEnvironments(obj3)).toMatchSnapshot()
Expand Down Expand Up @@ -454,19 +454,19 @@ xtest('setBreakpointAtLine for loops', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj1) as Promise<Result>).then(obj2 => {
expect(flattenEnvironments(obj2)).toMatchSnapshot()
expect(obj2.status).toBe('suspended-ec-eval')
expect(obj2.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj2) as Promise<Result>).then(obj3 => {
expect(flattenEnvironments(obj3)).toMatchSnapshot()
expect(obj3.status).toBe('suspended-ec-eval')
expect(obj3.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj3) as Promise<Result>).then(obj4 => {
expect(flattenEnvironments(obj4)).toMatchSnapshot()
expect(obj4.status).toBe('suspended-ec-eval')
expect(obj4.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj4) as Promise<Result>).then(obj5 => {
expect(flattenEnvironments(obj5)).toMatchSnapshot()
Expand Down Expand Up @@ -501,11 +501,11 @@ xtest('setBreakpointAtLine while loops', () => {
id: expect.any(String)
})
})
expect(obj1.status).toBe('suspended-ec-eval')
expect(obj1.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj1) as Promise<Result>).then(obj2 => {
expect(flattenEnvironments(obj2)).toMatchSnapshot()
expect(obj2.status).toBe('suspended-ec-eval')
expect(obj2.status).toBe('suspended-cse-eval')
expect(parseError(context.errors)).toMatchSnapshot()
return (resume(obj2) as Promise<Result>).then(obj5 => {
expect(flattenEnvironments(obj5)).toMatchSnapshot()
Expand Down
2 changes: 1 addition & 1 deletion src/createContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const createEmptyRuntime = () => ({
environments: [],
value: undefined,
nodes: [],
agenda: null,
control: null,
stash: null,
envSteps: -1,
envStepsTotal: 0,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Utility functions for creating the various agenda instructions.
* Utility functions for creating the various control instructions.
*/

import * as es from 'estree'
Expand Down
Loading

0 comments on commit d6553ca

Please sign in to comment.