File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 7
7
. "github.com/antonmedv/expr/vm"
8
8
"github.com/gdamore/tcell"
9
9
"github.com/rivo/tview"
10
+ "github.com/sanity-io/litter"
10
11
"sort"
11
12
"strconv"
12
13
"strings"
@@ -21,7 +22,6 @@ func debugger() {
21
22
check (err )
22
23
23
24
vm := NewVM (true )
24
- go vm .Run (program , nil )
25
25
26
26
app := tview .NewApplication ()
27
27
table := tview .NewTable ()
@@ -42,6 +42,19 @@ func debugger() {
42
42
AddItem (sub , 0 , 1 , false )
43
43
app .SetRoot (flex , true )
44
44
45
+ go func () {
46
+ out := vm .Run (program , nil )
47
+ app .QueueUpdateDraw (func () {
48
+ sub .RemoveItem (scope )
49
+ result := tview .NewTextView ()
50
+ result .
51
+ SetBorder (true ).
52
+ SetTitle ("Output" )
53
+ result .SetText (litter .Sdump (out ))
54
+ sub .AddItem (result , 0 , 1 , false )
55
+ })
56
+ }()
57
+
45
58
index := make (map [int ]int )
46
59
for row , line := range strings .Split (program .Disassemble (), "\n " ) {
47
60
if line == "" {
You can’t perform that action at this time.
0 commit comments