diff options
Diffstat (limited to 'dynamic.e')
| -rw-r--r-- | dynamic.e | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/dynamic.e b/dynamic.e index f99f0ec..a02eec0 100644 --- a/dynamic.e +++ b/dynamic.e @@ -150,14 +150,33 @@ { dup word-heading next-newer-entry } while drop ; +~ (byte -- boolean) +: is-printable + dup 0x20 <= swap 0x7F > && ; + + ~ (content end, content start, label start --) : hexdump-row 2 indent dup .hex32 dup 4 unroll - 0 { dup 16 > } - { dup 7 & 0 = { space } if space + ~ (label start, content end, content start, label start) + 0 { dup 16 > } { + ~ (label start, content end, content start, label start, offset within row) + dup 7 & 0 = { space } if space 2dup + dup 4 pick <= swap 5 pick > && { 2dup + 8@ .hex8 } { space space } if-else 1+ } while + drop + 2 indent s" |" emitstring + 0 { dup 16 > } { + ~ (label start, content end, content start, label start, offset within row) + 2dup + dup 4 pick <= swap 5 pick > && + { 2dup + 8@ + dup is-printable + { value@ emitstring } { s" ." emitstring } if-else + drop } + { space } if-else + 1+ } while + s" |" emitstring newline 5 ndrop ; |