Enhanced EmbeddedScript error messages

This commit is contained in:
2020-12-10 12:38:21 -07:00
parent 738628595e
commit 2da6e032da
9 changed files with 122 additions and 30 deletions

View File

@@ -80,9 +80,14 @@
// Day 8
(let [example (new BootCodeExample)]
(example.setBreakHandler (lambda [] (assert (= 5 example.accumulator))))
(example.setBreakHandler (lambda [example] (assert (= 5 .accumulator example))))
(example.run))
(let [bootCode (new BootCodeReal)]
(bootCode.setBreakHandler (lambda [] (assert (= 2058 bootCode.accumulator) (assert true))))
(bootCode.run)))
(bootCode.setBreakHandler (lambda [bootCode] (assert (= 2058 bootCode.accumulator) (assert true))))
(bootCode.run))
(let [bootCode (new BootCodeFix)]
(bootCode.setBreakHandler (lambda [:BootCodeFix bootCodeFork] (when (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount)) (print .accumulator (the BootCodeFix bootCodeFork)))))
(bootCode.addBreakPoint (bootCode.instructionCount))
(bootCode.run))
)