about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-09-20 22:13:51 -0700
committerIrene Knapp <ireneista@irenes.space>2026-09-20 22:13:51 -0700
commitafb038cbe86adfc5c5fe67d3265d73b5ac3172d4 (patch)
treeae946f8781bb99fb4cd6365bea6329231922afb7
parentf7a320e19422bef7021bf03b3362b6c6c05c548f (diff)
no more than sixteen bytes on a line
Force-Push: yes
Change-Id: I7cd583d5a3ee72c316633ceb2efbb51a2fe46452
-rw-r--r--transform.e33
1 files changed, 30 insertions, 3 deletions
diff --git a/transform.e b/transform.e
index 18c7fb4..042f1d9 100644
--- a/transform.e
+++ b/transform.e
@@ -3452,11 +3452,12 @@ allocate-transformation-state s" transformation-state" variable
 : hex-output-metadata-is-fresh-line 5 8 * + ;
 : hex-output-metadata-indentation-depth 6 8 * + ;
 : hex-output-metadata-current-column 7 8 * + ;
-: hex-output-metadata-subitem-entry-stack-depth 8 8 * + ;
-: hex-output-metadata-subitem-entry-stack-zero 9 8 * + ;
+: hex-output-metadata-n-bytes-this-line 8 8 * + ;
+: hex-output-metadata-subitem-entry-stack-depth 9 8 * + ;
+: hex-output-metadata-subitem-entry-stack-zero 10 8 * + ;
 : hex-output-metadata-subitem-entry-stack-capacity 8 ;
 : hex-output-metadata-first-entry
-  9 hex-output-metadata-subitem-entry-stack-capacity + 8 * + ;
+  10 hex-output-metadata-subitem-entry-stack-capacity + 8 * + ;
 : hex-output-metadata-entry-data-start ;
 : hex-output-metadata-entry-data-length 8 + ;
 : hex-output-metadata-entry-type 2 8 * + ;
@@ -3498,6 +3499,7 @@ allocate-transformation-state s" transformation-state" variable
   dup hex-output-metadata-is-fresh-line 1 swap !
   dup hex-output-metadata-indentation-depth 0 swap !
   dup hex-output-metadata-current-column 0 swap !
+  dup hex-output-metadata-n-bytes-this-line 0 swap !
   dup hex-output-metadata-subitem-entry-stack-depth 0 swap !
   dup hex-output-metadata-first-entry 0 swap ! ;
 
@@ -3582,6 +3584,16 @@ allocate-transformation-state s" transformation-state" variable
 
 : advance-current-column current-column@ + current-column! ;
 
+: n-bytes-this-line@
+  transformation-state transformation-state-output-metadata @
+  hex-output-metadata-n-bytes-this-line @ ;
+
+: n-bytes-this-line!
+  transformation-state transformation-state-output-metadata @
+  hex-output-metadata-n-bytes-this-line ! ;
+
+: increment-bytes-this-line n-bytes-this-line@ 1+ n-bytes-this-line! ;
+
 : describe-subitem-entry-stack
   transformation-state transformation-state-output-metadata @
   ."    depth "
@@ -4436,6 +4448,7 @@ allocate-transformation-state s" transformation-state" variable
     newline
     hex-comment-first-tab-stop dup indent current-column!
     1 is-fresh-line!
+    0 n-bytes-this-line!
   } if
 
   ." ~"
@@ -4521,6 +4534,7 @@ allocate-transformation-state s" transformation-state" variable
           newline
 
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4533,6 +4547,7 @@ allocate-transformation-state s" transformation-state" variable
           newline
 
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4540,6 +4555,7 @@ allocate-transformation-state s" transformation-state" variable
         hex-output-metadata-entry-type-fresh-line = {
           fresh-line
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4548,6 +4564,7 @@ allocate-transformation-state s" transformation-state" variable
           fresh-line
           newline
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4570,6 +4587,7 @@ allocate-transformation-state s" transformation-state" variable
 
           newline
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4586,6 +4604,7 @@ allocate-transformation-state s" transformation-state" variable
 
           newline
           1 is-fresh-line!
+          0 n-bytes-this-line!
           0 current-column!
         } if
 
@@ -4703,6 +4722,13 @@ allocate-transformation-state s" transformation-state" variable
     ~ (length remaining, current output address, metadata scan pointer)
 
     2 pick {
+      n-bytes-this-line@ 16 = {
+        newline
+        1 is-fresh-line!
+        0 n-bytes-this-line!
+        0 current-column!
+      } if
+
       is-fresh-line@ {
         indentation-depth@ dup indent advance-current-column
       } {
@@ -4713,6 +4739,7 @@ allocate-transformation-state s" transformation-state" variable
       over 8@ .hex8
 
       2 advance-current-column
+      increment-bytes-this-line
       0 is-fresh-line!
     } if
     ~ (length remaining, current output address, metadata scan pointer)