From 475667da230d78d60e86c460324899a58b555623 Mon Sep 17 00:00:00 2001 From: Xie Yuheng Date: Fri, 17 May 2024 20:29:42 +0800 Subject: [PATCH] remove freshenNames --- TODO.md | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- src/lang0/utils/freshen.ts | 15 --------------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/TODO.md b/TODO.md index 7396d66..f6e90ee 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,7 @@ # lang1 -[lang1] 支持 `(assert-equal)` 与 `(assert-not-equal)` [lang1] fix `freshen` -- be like lang0 with `usedNames` +[lang1] 支持 `(assert-equal)` 与 `(assert-not-equal)` [lang1] 支持直接递归函数与相互递归函数,不能判断等价的地方就不判断。 # lang0 diff --git a/package-lock.json b/package-lock.json index 77ec2ae..538c807 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "clique": "bin/clique.js" }, "devDependencies": { - "@types/node": "^20.12.11", + "@types/node": "^20.12.12", "@xieyuheng/test-runner": "^0.2.10", "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", @@ -107,9 +107,9 @@ } }, "node_modules/@types/node": { - "version": "20.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", - "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dependencies": { "undici-types": "~5.26.4" } diff --git a/package.json b/package.json index 2d9f2d1..4e2d83f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "regexp-match-indices": "^1.0.2" }, "devDependencies": { - "@types/node": "^20.12.11", + "@types/node": "^20.12.12", "@xieyuheng/test-runner": "^0.2.10", "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", diff --git a/src/lang0/utils/freshen.ts b/src/lang0/utils/freshen.ts index 9c5bf5e..578d803 100644 --- a/src/lang0/utils/freshen.ts +++ b/src/lang0/utils/freshen.ts @@ -16,18 +16,3 @@ export function freshen( } } } - -export function freshenNames( - usedNames: Array | Set, - names: Array | Set, -): Map { - usedNames = new Set([...usedNames, ...names]) - const freshNameMap = new Map() - for (const name of names) { - const freshName = freshen(usedNames, name) - freshNameMap.set(name, freshName) - usedNames.add(freshName) - } - - return freshNameMap -}