Skip to content

Commit

Permalink
[lang0] equivalent -- FnRecursive
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Apr 10, 2024
1 parent 8dc05ed commit a2b0b01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

> 支持直接递归函数与相互递归函数,不能判断等价的地方就不判断。
[lang0] `equivalent` -- `FnRecursive`
[lang0] `equivalentNeutral` -- `ApRecursive`

[lang0] test about equivalent between recursive functions
Expand Down
6 changes: 5 additions & 1 deletion src/lang0/equivalent/equivalent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export function equivalent(
}

case "FnRecursive": {
throw new Error()
return (
right["@kind"] === "FnRecursive" &&
left.name === right.name &&
left.mod === right.mod
)
}

case "Lazy": {
Expand Down

0 comments on commit a2b0b01

Please sign in to comment.