about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--shell/global.mu24
1 files changed, 13 insertions, 11 deletions
diff --git a/shell/global.mu b/shell/global.mu
index 495332c4..0a9bd791 100644
--- a/shell/global.mu
+++ b/shell/global.mu
@@ -281,6 +281,7 @@ fn refresh-cursor-definition _self: (addr global-table) {
   refresh-definition self, *cursor-index
 }
 
+# HERE: reconcile what happens here
 fn refresh-definition _self: (addr global-table), _index: int {
   var self/esi: (addr global-table) <- copy _self
   var data-ah/eax: (addr handle array global) <- get self, data
@@ -594,6 +595,7 @@ fn is-definition? _expr: (addr cell) -> _/eax: boolean {
   return 0/false
 }
 
+# HERE: ..and this
 fn read-evaluate-and-move-to-globals _in-ah: (addr handle gap-buffer), globals: (addr global-table), definition-name: (addr stream byte) {
   var in-ah/eax: (addr handle gap-buffer) <- copy _in-ah
   var in/eax: (addr gap-buffer) <- lookup *in-ah
@@ -632,19 +634,19 @@ fn read-evaluate-and-move-to-globals _in-ah: (addr handle gap-buffer), globals:
 
 # Accepts an input s-expression, naively checks if it is a definition, and if
 # so saves the gap-buffer to the appropriate global.
-fn move-gap-buffer-to-global _globals: (addr global-table), _definition-ah: (addr handle cell), gap: (addr handle gap-buffer) {
-  # if 'definition' is not a pair, return
-  var definition-ah/eax: (addr handle cell) <- copy _definition-ah
-  var _definition/eax: (addr cell) <- lookup *definition-ah
-  var definition/esi: (addr cell) <- copy _definition
-  var definition-type/eax: (addr int) <- get definition, type
-  compare *definition-type, 0/pair
+fn move-gap-buffer-to-global _globals: (addr global-table), _read-result-ah: (addr handle cell), gap: (addr handle gap-buffer) {
+  # if 'read-result' is not a pair, return
+  var read-result-ah/eax: (addr handle cell) <- copy _read-result-ah
+  var _read-result/eax: (addr cell) <- lookup *read-result-ah
+  var read-result/esi: (addr cell) <- copy _read-result
+  var read-result-type/eax: (addr int) <- get read-result, type
+  compare *read-result-type, 0/pair
   {
     break-if-=
     return
   }
-  # if definition->left is neither "define" nor "set", return
-  var left-ah/eax: (addr handle cell) <- get definition, left
+  # if read-result->left is neither "define" nor "set", return
+  var left-ah/eax: (addr handle cell) <- get read-result, left
   var _left/eax: (addr cell) <- lookup *left-ah
   var left/ecx: (addr cell) <- copy _left
   {
@@ -656,8 +658,8 @@ fn move-gap-buffer-to-global _globals: (addr global-table), _definition-ah: (add
     break-if-!=
     return
   }
-  # locate the global for definition->right->left
-  var right-ah/eax: (addr handle cell) <- get definition, right
+  # locate the global for read-result->right->left
+  var right-ah/eax: (addr handle cell) <- get read-result, right
   var right/eax: (addr cell) <- lookup *right-ah
   var defined-symbol-ah/eax: (addr handle cell) <- get right, left
   var defined-symbol/eax: (addr cell) <- lookup *defined-symbol-ah
akkartik.com> 2020-07-12 16:37:58 -0700 6640' href='/akkartik/mu/commit/subx.md?h=main&id=7817fdb29c46419e22ddcbd9f75a5be6308c9776'>7817fdb2 ^
9a524793 ^









































































16f2bd11 ^

9a524793 ^
16f2bd11 ^
9a524793 ^
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