Skip to content

Commit

Permalink
evaluate -- Var -- call findDefinitionOrFail
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Nov 16, 2023
1 parent e4de74d commit 509b847
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
evaluate -- Var -- call findDefinitionOrFail

evaluateBlockStmt -- Connect
evaluateBlockStmt -- LetPlace

Expand Down
12 changes: 5 additions & 7 deletions src/lang/evaluate/evaluate.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Env } from "../env"
import { appendReport } from "../errors"
import { Exp, formatExp } from "../exp"
import { Mod } from "../mod"
// import { findDefinitionOrFail } from "../mod"
import { Mod, findDefinitionOrFail } from "../mod"
import { Value } from "../value"
import { evaluateBlock } from "./evaluateBlock"
// import { evaluateDefinition } from "./evaluateDefinition"
import { evaluateDefinition } from "./evaluateDefinition"

export interface EvaluateOptions {
//
Expand All @@ -25,10 +24,9 @@ export function evaluate(
env.locals.delete(exp.name)
return [found]
} else {
throw new Error("TODO")
// const definition = findDefinitionOrFail(mod, exp.name)
// const value = evaluateDefinition(env, definition, options)
// return [value]
const definition = findDefinitionOrFail(mod, exp.name)
const value = evaluateDefinition(env, definition, options)
return [value]
}
}

Expand Down

0 comments on commit 509b847

Please sign in to comment.