summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--examples/plugin_ipc.py1
-rw-r--r--examples/plugin_linemode.py1
-rw-r--r--ranger/api/commands.py2
-rw-r--r--ranger/colorschemes/jungle.py1
-rwxr-xr-xranger/config/commands.py6
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/core/fm.py1
-rw-r--r--ranger/core/loader.py3
-rw-r--r--ranger/core/main.py1
-rw-r--r--ranger/ext/cached_function.py1
-rw-r--r--ranger/ext/signals.py2
-rw-r--r--ranger/gui/widgets/pager.py1
-rw-r--r--tests/ranger/container/test_bookmarks.py2
13 files changed, 27 insertions, 0 deletions
diff --git a/examples/plugin_ipc.py b/examples/plugin_ipc.py
index a9e79205..cfb546fa 100644
--- a/examples/plugin_ipc.py
+++ b/examples/plugin_ipc.py
@@ -22,6 +22,7 @@ def hook_init(fm):
             import thread
         except ImportError:
             import _thread as thread
+
         def ipc_reader(filepath):
             while True:
                 with open(filepath, 'r') as fifo:
diff --git a/examples/plugin_linemode.py b/examples/plugin_linemode.py
index 8a92552e..be34e6c5 100644
--- a/examples/plugin_linemode.py
+++ b/examples/plugin_linemode.py
@@ -12,5 +12,6 @@ from ranger.core.linemode import LinemodeBase
 @ranger.api.register_linemode
 class MyLinemode(LinemodeBase):
     name = "rot13"
+
     def filetitle(self, file, metadata):
         return codecs.encode(file.relative_path, "rot_13")
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index c3e0a59a..b463a776 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -377,6 +377,7 @@ class FunctionCommand(Command):
     _based_function = None
     _object_name = ""
     _function_name = "unknown"
+
     def execute(self):
         if not self._based_function:
             return
@@ -431,6 +432,7 @@ class AliasCommand(Command):
     _object_name = ""
     _function_name = "unknown"
     _line = ""
+    
     def execute(self):
         return self._make_cmd().execute()
 
diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py
index 6a9c3c52..a142cd4f 100644
--- a/ranger/colorschemes/jungle.py
+++ b/ranger/colorschemes/jungle.py
@@ -6,6 +6,7 @@ from ranger.colorschemes.default import Default
 
 class Scheme(Default):
     progress_bar_color = green
+
     def use(self, context):
         fg, bg, attr = Default.use(self, context)
 
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index e09e1f10..e98a32a3 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -340,6 +340,7 @@ class set_(Command):
     Use `:set <option>!` to toggle or cycle it, e.g. `:set flush_input!`
     """
     name = 'set'  # don't override the builtin set class
+
     def execute(self):
         name = self.arg(1)
         name, value, _, toggle = self.parse_setting_line_v2()
@@ -380,6 +381,7 @@ class setlocal(set_):
     Gives an option a new value.
     """
     PATH_RE = re.compile(r'^\s*path="?(.*?)"?\s*$')
+
     def execute(self):
         import os.path
         match = self.PATH_RE.match(self.arg(1))
@@ -605,6 +607,7 @@ class load_copy_buffer(Command):
     Load the copy buffer from confdir/copy_buffer
     """
     copy_buffer_filename = 'copy_buffer'
+
     def execute(self):
         from ranger.container.file import File
         from os.path import exists
@@ -626,6 +629,7 @@ class save_copy_buffer(Command):
     Save the copy buffer to confdir/copy_buffer
     """
     copy_buffer_filename = 'copy_buffer'
+
     def execute(self):
         fname = None
         try:
@@ -964,6 +968,7 @@ class help_(Command):
     Display ranger's manual page.
     """
     name = 'help'
+
     def execute(self):
         def callback(answer):
             if answer == "q":
@@ -1400,6 +1405,7 @@ class prompt_metadata(Command):
 
     _command_name = "meta"
     _console_chain = None
+
     def execute(self):
         prompt_metadata._console_chain = self.args[1:]
         self._process_command_stack()
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index a39cef21..c7e0909e 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -967,6 +967,7 @@ class Actions(FileManagerAware, SettingsAware):
                     path, str(width), str(height), cacheimg,
                     str(self.settings.preview_images)], read=True,
                     silent=True, descr="Getting preview of %s" % path)
+        
                 def on_after(signal):
                     exit = signal.process.poll()
                     content = signal.loader.stdout_buffer
@@ -1012,6 +1013,7 @@ class Actions(FileManagerAware, SettingsAware):
                         else:
                             pager.set_source(self.thisfile.get_preview_source(
                                 pager.wid, pager.hei))
+
                 def on_destroy(signal):
                     try:
                         del self.previews[path]
@@ -1164,6 +1166,7 @@ class Actions(FileManagerAware, SettingsAware):
             contexts = 'browser', 'console', 'pager', 'taskview'
 
         temporary_file = tempfile.NamedTemporaryFile()
+        
         def write(string):
             temporary_file.write(string.encode('utf-8'))
 
@@ -1189,6 +1192,7 @@ class Actions(FileManagerAware, SettingsAware):
 
     def dump_commands(self):
         temporary_file = tempfile.NamedTemporaryFile()
+        
         def write(string):
             temporary_file.write(string.encode('utf-8'))
 
@@ -1214,6 +1218,7 @@ class Actions(FileManagerAware, SettingsAware):
 
     def dump_settings(self):
         temporary_file = tempfile.NamedTemporaryFile()
+        
         def write(string):
             temporary_file.write(string.encode('utf-8'))
 
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 052584a6..c6736485 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -235,6 +235,7 @@ class FM(Actions, SignalDispatcher):
             return
         import shutil
         from errno import EEXIST
+
         def copy(_from, to):
             if os.path.exists(self.confpath(to)):
                 sys.stderr.write("already exists: %s\n" % self.confpath(to))
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index b1aabb53..9cdd9ea2 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -20,6 +20,7 @@ except:
 class Loadable(object):
     paused = False
     progressbar_supported = False
+
     def __init__(self, gen, descr):
         self.load_generator = gen
         self.description = descr
@@ -43,6 +44,7 @@ class Loadable(object):
 
 class CopyLoader(Loadable, FileManagerAware):
     progressbar_supported = True
+
     def __init__(self, copy_buffer, do_cut=False, overwrite=False):
         self.copy_buffer = tuple(copy_buffer)
         self.do_cut = do_cut
@@ -137,6 +139,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware):
     """
     finished = False
     process = None
+
     def __init__(self, args, descr, silent=False, read=False, input=None,
             kill_on_pause=False, popenArgs=None):
         SignalDispatcher.__init__(self)
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 2972a1eb..8bfd33b8 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -72,6 +72,7 @@ def main():
             sys.stderr.write("Warning: Using ranger as a file launcher is "
                    "deprecated.\nPlease use the standalone file launcher "
                    "'rifle' instead.\n")
+
             def print_function(string):
                 print(string)
             from ranger.ext.rifle import Rifle
diff --git a/ranger/ext/cached_function.py b/ranger/ext/cached_function.py
index bce2b5ca..31f49271 100644
--- a/ranger/ext/cached_function.py
+++ b/ranger/ext/cached_function.py
@@ -3,6 +3,7 @@
 
 def cached_function(fnc):
     cache = {}
+
     def inner_cached_function(*args):
         try:
             return cache[args]
diff --git a/ranger/ext/signals.py b/ranger/ext/signals.py
index bcac66fe..a361e8ac 100644
--- a/ranger/ext/signals.py
+++ b/ranger/ext/signals.py
@@ -71,6 +71,7 @@ class Signal(dict):
     To delete a signal handler from inside a signal, raise a ReferenceError.
     """
     stopped = False
+
     def __init__(self, **keywords):
         dict.__init__(self, keywords)
         self.__dict__ = self
@@ -90,6 +91,7 @@ class SignalHandler:
     "active" to False.
     """
     active = True
+
     def __init__(self, signal_name, function, priority, pass_signal):
         self._priority = max(0, min(1, priority))
         self._signal_name = signal_name
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 0d185f98..9b9cb74b 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -20,6 +20,7 @@ class Pager(Widget):
     need_clear_image = False
     need_redraw_image = False
     max_width = None
+
     def __init__(self, win, embedded=False):
         Widget.__init__(self, win)
         self.embedded = embedded
diff --git a/tests/ranger/container/test_bookmarks.py b/tests/ranger/container/test_bookmarks.py
index 46c615c6..af8aab23 100644
--- a/tests/ranger/container/test_bookmarks.py
+++ b/tests/ranger/container/test_bookmarks.py
@@ -36,8 +36,10 @@ def testbookmarks(tmpdir):
 
     # We don't uneccesary update when the file on disk does not change
     origupdate = secondstore.update
+    
     class OutOfDateException(Exception):
         pass
+    
     def crash():
         raise OutOfDateException("Don't access me")
     secondstore.update = crash
2019-10-15 19:35:19 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-10-15 19:35:19 -0700 5698' href='/akkartik/mu/commit/079emit.subx?h=hlt&id=7a5832204a80ff43d23c3a384c26e2217ef5908b'>7a583220 ^
fd91f7f6 ^









686a52bd ^
fd91f7f6 ^
686a52bd ^
fd91f7f6 ^








71eb22a5 ^
fd91f7f6 ^



























7a583220 ^
fd91f7f6 ^




7a583220 ^
fd91f7f6 ^









686a52bd ^
fd91f7f6 ^
686a52bd ^
fd91f7f6 ^








71eb22a5 ^
fd91f7f6 ^



























7a583220 ^
fd91f7f6 ^




7a583220 ^
fd91f7f6 ^









686a52bd ^
fd91f7f6 ^
686a52bd ^
fd91f7f6 ^








71eb22a5 ^
fd91f7f6 ^





















































7a583220 ^
fd91f7f6 ^


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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473








                                                                                                                                                 
                                                                  
                







                                                                                                                                                                             
                          




















                                                                                                                                                                       

                                     
                                     


















                                                                                                                                                                     
                                                                     
                                                                               



                                                                            
              
                                                            


                   
                                            

















                                                                                                                                                                      
                




                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       



























                                                                                                                                                                       
                





                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       



























                                                                                                                                                                       
                




                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       




























                                                                                                                                                                       
                




                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       



























                                                                                                                                                                       
                




                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       



























                                                                                                                                                                       
                




                                                                                                                                                                       
                









                                                                                                                                                                       
                                                         
                   
                                                      








                                                                                                                                                                             
                                       





















































                                                                                                                                                                       
                


                                                                                                                                                                       
== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

# If datum of 'word' is not a valid name, it must be a hex int. Parse and print
# it in 'width' bytes of hex, least significant first.
# Otherwise just print the entire word including metadata.
# Always print a trailing space.
emit:  # out: (addr buffered-file), word: (addr slice), width: int
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # . save registers
    50/push-eax
    56/push-esi
    57/push-edi
    # esi = word
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           6/r32/esi   0xc/disp8       .                 # copy *(ebp+12) to esi
    # var datum/edi: slice
    68/push  0/imm32/end
    68/push  0/imm32/start
    89/copy                         3/mod/direct    7/rm32/edi    .           .             .           4/r32/esp   .               .                 # copy esp to edi
    # datum = next-token-from-slice(word->start, word->end, '/')
    # . . push args
    57/push-edi
    68/push  0x2f/imm32/slash
    ff          6/subop/push        1/mod/*+disp8   6/rm32/esi    .           .             .           .           4/disp8         .                 # push *(esi+4)
    ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
    # . . call
    e8/call  next-token-from-slice/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
    # if (is-valid-name?(datum)) write-slice-buffered(out, word) and return
    # . eax = is-valid-name?(name)
    # . . push args
    57/push-edi
    # . . call
    e8/call  is-valid-name?/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . if (eax != false)
    3d/compare-eax-and  0/imm32/false
    74/jump-if-=  $emit:hex-int/disp8
$emit:name:
    # . write-slice-buffered(out, word)
    # . . push args
    56/push-esi
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
    # . . call
    e8/call  write-slice-buffered/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # . write-buffered(out, " ")
    # . . push args
    68/push  Space/imm32
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
    # . . call
    e8/call  write-buffered/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # . return
    eb/jump  $emit:end/disp8
    # otherwise emit-hex(out, parse-hex-int-from-slice(datum), width)
    #   (Weird shit can happen here if the datum of 'word' isn't either a valid
    #   name or a hex number. `emit` is mostly used by translate_subx, which
    #   is currently designed to only receive legal SubX programs. We just
    #   want to make sure that valid names aren't treated as (valid) hex
    #   numbers.)
$emit:hex-int:
    # . var value/eax: int = parse-hex-int-from-slice(datum)
    # . . push args
    57/push-edi
    # . . call
    e8/call  parse-hex-int-from-slice/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . emit-hex(out, value, width)
    # . . push args
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
    50/push-eax
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
    # . . call
    e8/call  emit-hex/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
$emit:end:
    # . reclaim locals
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # . restore registers
    5f/pop-to-edi
    5e/pop-to-esi
    58/pop-to-eax
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-number:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "30"
    b8/copy-to-eax  "30"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 1)
    # . . push args
    68/push  1/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # check-stream-equal(_test-output-stream, "30 ", msg)
    # . . push args
    68/push  "F - test-emit-number/1"/imm32
    68/push  "30 "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-negative-number:
    # test support for sign-extending negative numbers
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "-2"
    b8/copy-to-eax  "-2"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 2)
    # . . push args
    68/push  2/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # check-stream-equal(_test-output-stream, "fe ff ", msg)
    # . . push args
    68/push  "F - test-emit-number/1"/imm32
    68/push  "fe ff "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-number-with-metadata:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "-2/foo"
    b8/copy-to-eax  "-2/foo"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 2)
    # . . push args
    68/push  2/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # the '/foo' will have no impact on the output
    # check-stream-equal(_test-output-stream, "fe ff ", msg)
    # . . push args
    68/push  "F - test-emit-number-with-metadata"/imm32
    68/push  "fe ff "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-non-number:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "xyz"
    b8/copy-to-eax  "xyz"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 2)
    # . . push args
    68/push  2/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # check-stream-equal(_test-output-stream, "xyz", msg)
    # . . push args
    68/push  "F - test-emit-non-number"/imm32
    68/push  "xyz "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-non-number-with-metadata:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "xyz/"
    b8/copy-to-eax  "xyz/"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 2)
    # . . push args
    68/push  2/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # check-stream-equal(_test-output-stream, "xyz/", msg)
    # . . push args
    68/push  "F - test-emit-non-number-with-metadata"/imm32
    68/push  "xyz/ "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

test-emit-non-number-with-all-hex-digits-and-metadata:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # setup
    # . clear-stream(_test-output-stream)
    # . . push args
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # . clear-stream($_test-output-buffered-file->buffer)
    # . . push args
    68/push  $_test-output-buffered-file->buffer/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # (eax..ecx) = "abcd/xyz"
    b8/copy-to-eax  "abcd/xyz"/imm32
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # copy *eax to ecx
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    0/base/eax  1/index/ecx   .           1/r32/ecx   4/disp8         .                 # copy eax+ecx+4 to ecx
    05/add-to-eax  4/imm32
    # var slice/ecx: slice = {eax, ecx}
    51/push-ecx
    50/push-eax
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # emit(_test-output-buffered-file, slice, 2)
    # . . push args
    68/push  2/imm32
    51/push-ecx
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  emit/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # flush(_test-output-buffered-file)
    # . . push args
    68/push  _test-output-buffered-file/imm32
    # . . call
    e8/call  flush/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
#?     # dump output {{{
#?     # . write(2/stderr, "^")
#?     # . . push args
#?     68/push  "^"/imm32
#?     68/push  2/imm32/stderr
#?     # . . call
#?     e8/call  write/disp32
#?     # . . discard args
#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
#?     # . write-stream(2/stderr, _test-output-stream)
#?     # . . push args
#?     68/push  _test-output-stream/imm32
#?     68/push  2/imm32/stderr
#?     # . . call
#?     e8/call  write-stream/disp32
#?     # . . discard args
#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
#?     # . write(2/stderr, "$\n")
#?     # . . push args
#?     68/push  "$\n"/imm32
#?     68/push  2/imm32/stderr
#?     # . . call
#?     e8/call  write/disp32
#?     # . . discard args
#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
#?     # }}}
    # check-stream-equal(_test-output-stream, "abcd/xyz")
    # . . push args
    68/push  "F - test-emit-non-number-with-all-hex-digits"/imm32
    68/push  "abcd/xyz "/imm32
    68/push  _test-output-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return