Skip to content

Commit

Permalink
remove freshenNames
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed May 17, 2024
1 parent 2601985 commit 475667d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 0 additions & 15 deletions src/lang0/utils/freshen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,3 @@ export function freshen(
}
}
}

export function freshenNames(
usedNames: Array<string> | Set<string>,
names: Array<string> | Set<string>,
): Map<string, string> {
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
}

0 comments on commit 475667d

Please sign in to comment.