fix EmbeddedScript breakpoint problems

This commit is contained in:
2021-11-29 17:51:34 -07:00
parent 5706dcaa6b
commit ac9c4fb076

View File

@@ -82,15 +82,15 @@
(day 8 (day 8
(let [example (new BootCodeExample)] (let [example (new BootCodeExample)]
(example.setBreakHandler (lambda [example] (assert (= 5 .accumulator example)))) (example.setBreakHandler (lambda :Void [example] (assert (= 5 .accumulator example))))
(example.run)) (example.run))
(let [bootCode (new BootCodeReal)] (let [bootCode (new BootCodeReal)]
(bootCode.setBreakHandler (lambda [bootCode] (assert (= 2058 bootCode.accumulator)))) (bootCode.setBreakHandler (lambda :Void [bootCode] (assert (= 2058 bootCode.accumulator))))
(bootCode.run)) (bootCode.run))
/* (print "BootCodeFixExample") /* (print "BootCodeFixExample")
(let [bootCode (new BootCodeFixExample)] (let [bootCode (new BootCodeFixExample)]
(bootCode.setBreakHandler (bootCode.setBreakHandler
(lambda [bootCodeFork] (lambda :Void [bootCodeFork]
(if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount)) (if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount))
(print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string bootCodeFork.forkedAt))) (print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string bootCodeFork.forkedAt)))
(print "hit an infinite loop")))) (print "hit an infinite loop"))))
@@ -99,7 +99,7 @@
(print "BootCodeFixReal") (print "BootCodeFixReal")
(let [bootCode (new BootCodeFix)] (let [bootCode (new BootCodeFix)]
(bootCode.setBreakHandler (bootCode.setBreakHandler
(lambda [bootCodeFork] (lambda :Void [bootCodeFork]
(if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount)) (if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount))
(print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string (+ 1 bootCodeFork.forkedAt)))) (print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string (+ 1 bootCodeFork.forkedAt))))
(print "hit an infinite loop")))) (print "hit an infinite loop"))))