about summary refs log tree commit diff stats
path: root/apps/browse/main.mu
diff options
context:
space:
mode:
Diffstat (limited to 'apps/browse/main.mu')
-rw-r--r--apps/browse/main.mu82
1 files changed, 41 insertions, 41 deletions
diff --git a/apps/browse/main.mu b/apps/browse/main.mu
index 91eb46e0..5b4f2e06 100644
--- a/apps/browse/main.mu
+++ b/apps/browse/main.mu
@@ -50,7 +50,7 @@ fn interactive fs: (addr buffered-file) {
   {
     render paginated-screen, fs
     var key/eax: grapheme <- read-key-from-real-keyboard
-    compare key, 0x71  # 'q'
+    compare key, 0x71/'q'
     loop-if-!=
   }
   enable-keyboard-type-mode
@@ -71,7 +71,7 @@ fn test-render-multicolumn-text {
   # output screen
   var pg: paginated-screen
   var pg-addr/ecx: (addr paginated-screen) <- address pg
-  initialize-fake-paginated-screen pg-addr, 3, 6, 2, 1, 1  # 3 rows, 6 columns, 2 pages * 2 columns each
+  initialize-fake-paginated-screen pg-addr, 3/rows, 6/cols, 2/page-width, 1/top-margin, 1/left-margin
   #
   render pg-addr, in
   var screen-ah/eax: (addr handle screen) <- get pg, screen
@@ -90,7 +90,7 @@ fn test-render-heading-text {
   # output screen
   var pg: paginated-screen
   var pg-addr/ecx: (addr paginated-screen) <- address pg
-  initialize-fake-paginated-screen pg-addr, 8, 6, 5, 1, 1  # 6 columns, single page
+  initialize-fake-paginated-screen pg-addr, 8/rows, 6/cols, 5/page-width, 1/top-margin, 1/left-margin
   #
   render pg-addr, in
   var screen-ah/eax: (addr handle screen) <- get pg, screen
@@ -110,7 +110,7 @@ fn test-render-bold-text {
   # output screen
   var pg: paginated-screen
   var pg-addr/ecx: (addr paginated-screen) <- address pg
-  initialize-fake-paginated-screen pg-addr, 8, 6, 5, 1, 1  # 6 columns, single page
+  initialize-fake-paginated-screen pg-addr, 8/rows, 6/cols, 5/page-width, 1/top-margin, 1/left-margin
   #
   render pg-addr, in
   var screen-ah/eax: (addr handle screen) <- get pg, screen
@@ -130,7 +130,7 @@ fn test-render-pseudoitalic-text {
   # output screen
   var pg: paginated-screen
   var pg-addr/ecx: (addr paginated-screen) <- address pg
-  initialize-fake-paginated-screen pg-addr, 8, 6, 5, 1, 1  # 6 columns, single page
+  initialize-fake-paginated-screen pg-addr, 8/rows, 6/cols, 5/page-width, 1/top-margin, 1/left-margin
   #
   render pg-addr, in
   var screen-ah/eax: (addr handle screen) <- get pg, screen
@@ -148,7 +148,7 @@ fn test-render-asterisk-in-text {
   # output screen
   var pg: paginated-screen
   var pg-addr/ecx: (addr paginated-screen) <- address pg
-  initialize-fake-paginated-screen pg-addr, 8, 6, 5, 1, 1  # 6 columns, single page
+  initialize-fake-paginated-screen pg-addr, 8/nrows, 6/cols, 5/page-width, 1/top-margin, 1/left-margin
   #
   render pg-addr, in
   var screen-ah/eax: (addr handle screen) <- get pg, screen
@@ -158,38 +158,38 @@ fn test-render-asterisk-in-text {
 }
 
 fn render-normal screen: (addr paginated-screen), fs: (addr buffered-file) {
-  var newline-seen?/esi: boolean <- copy 0  # false
-  var start-of-paragraph?/edi: boolean <- copy 1  # true
+  var newline-seen?/esi: boolean <- copy 0/false
+  var start-of-paragraph?/edi: boolean <- copy 1/true
   var previous-grapheme/ebx: grapheme <- copy 0
 $render-normal:loop: {
     # if done-drawing?(screen) break
     var done?/eax: boolean <- done-drawing? screen
-    compare done?, 0  # false
+    compare done?, 0/false
     break-if-!=
     var c/eax: grapheme <- read-grapheme-buffered fs
 $render-normal:loop-body: {
       # if (c == EOF) break
-      compare c, 0xffffffff  # EOF marker
+      compare c, 0xffffffff/end-of-file
       break-if-= $render-normal:loop
 
       ## if (c == newline) perform some fairly sophisticated parsing for soft newlines
-      compare c, 0xa  # newline
+      compare c, 0xa/newline
       {
         break-if-!=
         # if it's the first newline, buffer it
         compare newline-seen?, 0
         {
           break-if-!=
-          newline-seen? <- copy 1  # true
+          newline-seen? <- copy 1/true
           break $render-normal:loop-body
         }
         # otherwise render two newlines
         {
           break-if-=
-          add-grapheme screen, 0xa  # newline
-          add-grapheme screen, 0xa  # newline
-          newline-seen? <- copy 0  # false
-          start-of-paragraph? <- copy 1  # true
+          add-grapheme screen, 0xa/newline
+          add-grapheme screen, 0xa/newline
+          newline-seen? <- copy 0/false
+          start-of-paragraph? <- copy 1/true
           break $render-normal:loop-body
         }
       }
@@ -197,16 +197,16 @@ $render-normal:loop-body: {
       compare start-of-paragraph?, 0
       {
         break-if-=
-        compare c, 0x23  # '#'
+        compare c, 0x23/'#'
         {
           break-if-!=
           render-header-line screen, fs
-          newline-seen? <- copy 1  # true
+          newline-seen? <- copy 1/true
           break $render-normal:loop-body
         }
       }
       # c is not a newline
-      start-of-paragraph? <- copy 0  # false
+      start-of-paragraph? <- copy 0/false
       # if c is unprintable (particularly a '\r' CR), skip it
       compare c, 0x20
       loop-if-< $render-normal:loop
@@ -214,17 +214,17 @@ $render-normal:loop-body: {
       # newline (hard newline).
       # If there's a newline buffered and c is not a newline or space, print a
       # space (soft newline).
-      compare newline-seen?, 0  # false
+      compare newline-seen?, 0/false
 $render-normal:flush-buffered-newline: {
         break-if-=
-        newline-seen? <- copy 0  # false
+        newline-seen? <- copy 0/false
         {
           compare c, 0x20
           break-if-!=
-          add-grapheme screen, 0xa  # newline
+          add-grapheme screen, 0xa/newline
           break $render-normal:flush-buffered-newline
         }
-        add-grapheme screen, 0x20  # space
+        add-grapheme screen, 0x20/space
         # fall through to print c
       }
       ## end soft newline support
@@ -232,27 +232,27 @@ $render-normal:flush-buffered-newline: {
 $render-normal:whitespace-separated-regions: {
         # if previous-grapheme wasn't whitespace, skip this block
         {
-          compare previous-grapheme, 0x20  # space
+          compare previous-grapheme, 0x20/space
           break-if-=
-          compare previous-grapheme, 0xa  # newline
+          compare previous-grapheme, 0xa/newline
           break-if-=
           break $render-normal:whitespace-separated-regions
         }
         # if (c == '*') switch to bold
-        compare c, 0x2a  # '*'
+        compare c, 0x2a/*
         {
           break-if-!=
-          start-color-on-paginated-screen screen, 0xec, 7  # 236 = darkish gray
+          start-color-on-paginated-screen screen, 0xec/fg=darkish-grey, 7/bg=white
           start-bold-on-paginated-screen screen
             render-until-asterisk screen, fs
           normal-text screen
           break $render-normal:loop-body
         }
         # if (c == '_') switch to bold
-        compare c, 0x5f  # '_'
+        compare c, 0x5f/_
         {
           break-if-!=
-          start-color-on-paginated-screen screen, 0xec, 7  # 236 = darkish gray
+          start-color-on-paginated-screen screen, 0xec/fg=darkish-grey, 7/bg=white
           start-bold-on-paginated-screen screen
             render-until-underscore screen, fs
           normal-text screen
@@ -276,13 +276,13 @@ $render-header-line:body: {
     # if done-drawing?(screen) return
     {
       var done?/eax: boolean <- done-drawing? screen
-      compare done?, 0  # false
+      compare done?, 0/false
       break-if-!= $render-header-line:body
     }
     #
     c <- read-grapheme-buffered fs
     # if (c != '#') break
-    compare c, 0x23  # '#'
+    compare c, 0x23/'#'
     break-if-!=
     #
     header-level <- increment
@@ -294,16 +294,16 @@ $render-header-line:body: {
     # if done-drawing?(screen) break
     {
       var done?/eax: boolean <- done-drawing? screen
-      compare done?, 0  # false
+      compare done?, 0/false
       break-if-!=
     }
     #
     c <- read-grapheme-buffered fs
     # if (c == EOF) break
-    compare c, 0xffffffff  # EOF marker
+    compare c, 0xffffffff/end-of-file
     break-if-=
     # if (c == newline) break
-    compare c, 0xa  # newline
+    compare c, 0xa/newline
     break-if-=
     #
     add-grapheme screen, c
@@ -350,15 +350,15 @@ fn render-until-asterisk screen: (addr paginated-screen), fs: (addr buffered-fil
   {
     # if done-drawing?(screen) break
     var done?/eax: boolean <- done-drawing? screen
-    compare done?, 0  # false
+    compare done?, 0/false
     break-if-!=
     #
     var c/eax: grapheme <- read-grapheme-buffered fs
     # if (c == EOF) break
-    compare c, 0xffffffff  # EOF marker
+    compare c, 0xffffffff/end-of-file
     break-if-=
     # if (c == '*') break
-    compare c, 0x2a  # '*'
+    compare c, 0x2a/'*'
     break-if-=
     #
     add-grapheme screen, c
@@ -371,15 +371,15 @@ fn render-until-underscore screen: (addr paginated-screen), fs: (addr buffered-f
   {
     # if done-drawing?(screen) break
     var done?/eax: boolean <- done-drawing? screen
-    compare done?, 0  # false
+    compare done?, 0/false
     break-if-!=
     #
     var c/eax: grapheme <- read-grapheme-buffered fs
     # if (c == EOF) break
-    compare c, 0xffffffff  # EOF marker
+    compare c, 0xffffffff/end-of-file
     break-if-=
     # if (c == '_') break
-    compare c, 0x5f  # '_'
+    compare c, 0x5f/'_'
     break-if-=
     #
     add-grapheme screen, c
@@ -390,5 +390,5 @@ fn render-until-underscore screen: (addr paginated-screen), fs: (addr buffered-f
 
 fn normal-text screen: (addr paginated-screen) {
   reset-formatting-on-paginated-screen screen
-  start-color-on-paginated-screen screen, 0xec, 7  # 236 = darkish gray
+  start-color-on-paginated-screen screen, 0xec/fg=darkish-grey, 7/bg=white
 }
d=c4412d299ee983da5bfca64f33cf6f3eb478d232'>^
33352536 ^
ce2c1efc ^
33352536 ^








6070c23e ^
ce2c1efc ^

33352536 ^
6070c23e ^
ce2c1efc ^


33352536 ^

2104d1a7 ^
33352536 ^
2104d1a7 ^
33352536 ^
2104d1a7 ^
33352536 ^

ce2c1efc ^
33352536 ^



6070c23e ^
ce2c1efc ^
33352536 ^
6070c23e ^
ce2c1efc ^

33352536 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^


33352536 ^
ce2c1efc ^

33352536 ^




b1635a5c ^
33352536 ^

ce2c1efc ^







fa786ea7 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^
33352536 ^

ce2c1efc ^











33352536 ^
ce2c1efc ^


0af2ea07 ^

4a4a392d ^
0af2ea07 ^
33352536 ^
ce2c1efc ^
0af2ea07 ^
ce2c1efc ^



8aeb85f0 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^











33352536 ^
ce2c1efc ^


0af2ea07 ^

4a4a392d ^
0af2ea07 ^
33352536 ^
ce2c1efc ^
0af2ea07 ^
ce2c1efc ^



8aeb85f0 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^











33352536 ^
ce2c1efc ^


0af2ea07 ^

4a4a392d ^
0af2ea07 ^
33352536 ^
ce2c1efc ^
0af2ea07 ^
ce2c1efc ^



8aeb85f0 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^











33352536 ^
ce2c1efc ^


52daf072 ^

4a4a392d ^
52daf072 ^
33352536 ^
a844bd05 ^
ce2c1efc ^





8aeb85f0 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^











33352536 ^
ce2c1efc ^


52daf072 ^

4a4a392d ^
52daf072 ^
33352536 ^
ce2c1efc ^
52daf072 ^
ce2c1efc ^



8aeb85f0 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^


2104d1a7 ^
1b050736 ^








6070c23e ^
1b050736 ^

6070c23e ^
1b050736 ^























































































0af2ea07 ^



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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448