about summary refs log tree commit diff stats
path: root/apps/tile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tile')
-rw-r--r--apps/tile/environment.mu38
1 files changed, 24 insertions, 14 deletions
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu
index 64af0c3a..93fe2196 100644
--- a/apps/tile/environment.mu
+++ b/apps/tile/environment.mu
@@ -1515,33 +1515,43 @@ fn clear-canvas _env: (addr environment) {
   reset-formatting screen
   print-string screen, " define function  "
   # primitives
-  var start-col/ecx: int <- copy repl-col
-  start-col <- subtract 0x28
-  move-cursor screen, 1, start-col
+  render-primitives screen, repl-col
+  # currently defined functions
+  render-functions screen, repl-col, env
+}
+
+fn render-primitives screen: (addr screen), right-col: int {
+  var left-col/ecx: int <- copy right-col
+  left-col <- subtract 0x28
+  move-cursor screen, 1, left-col
   print-string screen, "primitives:"
-  start-col <- add 2
-  move-cursor screen, 2, start-col
+  left-col <- add 2
+  move-cursor screen, 2, left-col
   print-string screen, "+ - * len"
-  move-cursor screen, 3, start-col
+  move-cursor screen, 3, left-col
   print-string screen, "open read slurp lines"
-  move-cursor screen, 4, start-col
+  move-cursor screen, 4, left-col
   print-string screen, "fake-screen print move"
-  move-cursor screen, 5, start-col
+  move-cursor screen, 5, left-col
   print-string screen, "up down left right"
-  move-cursor screen, 6, start-col
+  move-cursor screen, 6, left-col
   print-string screen, "dup swap"
-  # currently defined functions
-  start-col <- subtract 2
-  move-cursor screen, 8, start-col
+}
+
+fn render-functions screen: (addr screen), right-col: int, _env: (addr environment) {
+  var left-col/ecx: int <- copy right-col
+  left-col <- subtract 0x28
+  move-cursor screen, 8, left-col
   print-string screen, "functions:"
-  start-col <- add 2
+  left-col <- add 2
   var row/ebx: int <- copy 9
+  var env/esi: (addr environment) <- copy _env
   var functions/esi: (addr handle function) <- get env, functions
   {
     var curr/eax: (addr function) <- lookup *functions
     compare curr, 0
     break-if-=
-    row <- render-function screen, row, start-col, curr
+    row <- render-function screen, row, left-col, curr
     functions <- get curr, next
     row <- increment
     loop
previous revision' href='/akkartik/mu/blame/054dilated_reagent.cc?h=hlt&id=7b8319f4b8b7b0c80d1e194fa586bfe1f8042fef'>^
d18d1d3d ^




a796831f ^



a796831f ^

b24eb476 ^
a796831f ^
1f7e3c05 ^
79eef536 ^
21c27706 ^
79eef536 ^
a796831f ^



780b2ce1 ^
a796831f ^




a796831f ^

2d713167 ^



a796831f ^




2d713167 ^



a796831f ^



2d713167 ^



a796831f ^




d5f89e0f ^
a796831f ^



555d95c1 ^
4ad0f652 ^
a796831f ^


c4e143d6 ^

9dcbec39 ^
c4e143d6 ^


9dcbec39 ^
c4e143d6 ^


66abe7c1 ^






ce2e604e ^


c4e143d6 ^
08cf048f ^
79eef536 ^
b74443e5 ^
eb4eecea ^
66abe7c1 ^






ce2e604e ^
a17f9186 ^
a796831f ^
a796831f ^



79eef536 ^
a796831f ^
66abe7c1 ^




a072f674 ^
eb4eecea ^
a072f674 ^

a796831f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166