Skip to content

Commit

Permalink
remove deprecated part and build (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcho21 authored Jan 31, 2024
1 parent a1ee8f3 commit b49c6b6
Show file tree
Hide file tree
Showing 31 changed files with 1,516 additions and 5,191 deletions.
2 changes: 1 addition & 1 deletion dist/index.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/evaluator/environment/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Evaluated } from "../evaluated";
import type { Value } from "../value";
import Environment from "./";

describe("set()", () => {
it("set name and value", () => {
const env = new Environment();
const varName = "foo";
const varValue = {} as Evaluated;
const varValue = {} as Value;

expect(() => env.set(varName, varValue)).not.toThrow();
});
Expand All @@ -15,7 +15,7 @@ describe("get()", () => {
it("get value after setting the value", () => {
const env = new Environment();
const varName = "foo";
const varValue = {} as Evaluated;
const varValue = {} as Value;

env.set(varName, varValue);

Expand All @@ -33,7 +33,7 @@ describe("get()", () => {
describe("linked environment", () => {
it("set super environment and get via sub environment", () => {
const varNameInSuper = "foo";
const varValueInSuper = {} as Evaluated;
const varValueInSuper = {} as Value;

const superEnv = new Environment();
superEnv.set(varNameInSuper, varValueInSuper);
Expand Down
10 changes: 5 additions & 5 deletions src/evaluator/environment/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Evaluated } from "../evaluated";
import type { Value } from "../value";

export interface EnvironmentType {
get: (name: string) => Evaluated | null;
set: (name: string, value: Evaluated) => void;
get: (name: string) => Value | null;
set: (name: string, value: Value) => void;
}

export default class Environment implements EnvironmentType {
Expand All @@ -14,7 +14,7 @@ export default class Environment implements EnvironmentType {
this.table = new Map<string, any>;
}

get(name: string): Evaluated | null {
get(name: string): Value | null {
// return if found in current environment
const fetched = this.table.get(name);
if (fetched !== undefined) {
Expand All @@ -28,7 +28,7 @@ export default class Environment implements EnvironmentType {
return this.superEnvironment.get(name);
}

set(name: string, value: Evaluated): void {
set(name: string, value: Value): void {
this.table.set(name, value);
}
}
52 changes: 0 additions & 52 deletions src/evaluator/environment/v2.test.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/evaluator/environment/v2.ts

This file was deleted.

94 changes: 0 additions & 94 deletions src/evaluator/evaluated/index.test.ts

This file was deleted.

106 changes: 0 additions & 106 deletions src/evaluator/evaluated/index.ts

This file was deleted.

Loading

0 comments on commit b49c6b6

Please sign in to comment.