From e1f5c4e72830cc9ce900e1884d3338f1c82060fd Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Tue, 15 Sep 2026 18:00:31 -0700 Subject: redo the hex dump comments for alignment to use the regular magic commands previously, alignment had been a special-cased type of metadata entry, with a special trap on packalign. now it uses the same programmable setup everything else does. much simpler, and prettier output. this CL also contains some modest reformatting of section headers in the hex dump Force-Push: yes Change-Id: I21554e92f6af6ddefa937dad8073b89657f85d64 --- transform.e | 104 ++++++++---------------------------------------------------- 1 file changed, 13 insertions(+), 91 deletions(-) (limited to 'transform.e') diff --git a/transform.e b/transform.e index e6c4af5..6d12ea1 100644 --- a/transform.e +++ b/transform.e @@ -1471,9 +1471,9 @@ allocate-transformation-state s" transformation-state" variable : label-transform ~ : blank-line ~ : blank-line - ~ : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ : ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ~ : ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ~ : ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ : blank-line ~ : This is the start of a long block of code which has been processed by @@ -3275,17 +3275,16 @@ allocate-transformation-state s" transformation-state" variable : hex-output-metadata-entry-type-indent 4 ; : hex-output-metadata-entry-type-string-literal 5 ; : hex-output-metadata-entry-type-raw-string-literal 6 ; -: hex-output-metadata-entry-type-alignment 7 ; -: hex-output-metadata-entry-type-push-subitem-decimal 8 ; -: hex-output-metadata-entry-type-push-subitem-hex 9 ; -: hex-output-metadata-entry-type-push-subitem-hex8 10 ; -: hex-output-metadata-entry-type-push-subitem-hex16 11 ; -: hex-output-metadata-entry-type-push-subitem-hex32 12 ; -: hex-output-metadata-entry-type-push-subitem-hex64 13 ; -: hex-output-metadata-entry-type-push-subitem-string 14 ; -: hex-output-metadata-entry-type-drop-subitem 15 ; -: hex-output-metadata-entry-type-swap-subitems 16 ; -: hex-output-metadata-entry-type-roll-subitems 17 ; +: hex-output-metadata-entry-type-push-subitem-decimal 7 ; +: hex-output-metadata-entry-type-push-subitem-hex 8 ; +: hex-output-metadata-entry-type-push-subitem-hex8 9 ; +: hex-output-metadata-entry-type-push-subitem-hex16 10 ; +: hex-output-metadata-entry-type-push-subitem-hex32 11 ; +: hex-output-metadata-entry-type-push-subitem-hex64 12 ; +: hex-output-metadata-entry-type-push-subitem-string 13 ; +: hex-output-metadata-entry-type-drop-subitem 14 ; +: hex-output-metadata-entry-type-swap-subitems 15 ; +: hex-output-metadata-entry-type-roll-subitems 16 ; ~ Initialize the contents of the output metadata to all zeroes. This is ~ called from hex-transform at its top level, at the very start, to make sure @@ -4124,19 +4123,6 @@ allocate-transformation-state s" transformation-state" variable 0 current-column! } if - dup hex-output-metadata-entry-type @ - hex-output-metadata-entry-type-alignment = { - fresh-line - indentation-depth@ dup indent advance-current-column - - ." ~ Alignment padding to width " - dup hex-output-metadata-entry-content @ . - - newline - 1 is-fresh-line! - 0 current-column! - } if - dup is-push-subitem-entry { dup push-subitem-entry-stack } if @@ -4629,70 +4615,6 @@ allocate-transformation-state s" transformation-state" variable exit } if - dup s" packalign" stringcmp 0 = { - create dropstring - s" docol" find entry-to-execution-token execute , - make-hidden - - ~ (output point, alignment byte width) - s" 2dup" find entry-to-execution-token , - - ~ We can't use unpackalign because this patch happens at the time - ~ packalign is being defined, and it would be a forward reference. We do - ~ the equivalent by hand. - s" dup" find entry-to-execution-token , - s" 3unroll" find entry-to-execution-token , - s" dup" find entry-to-execution-token , - s" 3unroll" find entry-to-execution-token , - s" 1-" find entry-to-execution-token , - s" +" find entry-to-execution-token , - s" swap" find entry-to-execution-token , - s" /%" find entry-to-execution-token , - s" swap" find entry-to-execution-token , - s" drop" find entry-to-execution-token , - s" *" find entry-to-execution-token , - ~ (output point, alignment byte width, padding end) - - ~ We can't use pick, either. - s" 3roll" find entry-to-execution-token , - s" dup" find entry-to-execution-token , - s" dup" find entry-to-execution-token , - s" lit" find entry-to-execution-token , - 5 , - s" unroll" find entry-to-execution-token , - ~ (output point, alignment byte width, padding end, output point, - ~ output point) - - s" 3unroll" find entry-to-execution-token , - s" -" find entry-to-execution-token , - ~ (output point, alignment byte width, padding start, padding length) - - ~ This would be the place to put a call to hex-pack-trace, but packalign - ~ is implemented using pack8, so it's not necessary. - - ' hex-output-metadata-entry-type-alignment entry-to-execution-token , - ~ (output point, alignment byte width, padding start, padding length,, - ~ entry type) - - ~ Again, no pick. - s" lit" find entry-to-execution-token , - 4 , - s" roll" find entry-to-execution-token , - s" dup" find entry-to-execution-token , - s" lit" find entry-to-execution-token , - 5 , - s" unroll" find entry-to-execution-token , - - ~ (output point, alignment byte width, padding start, padding length, - ~ entry type, alignment byte width) - ' add-hex-output-metadata-entry entry-to-execution-token , - ~ (output point, alignment byte width) - ~ Fall through to the inner implementation. - - ' ] entry-to-execution-token execute - exit - } if - ~ If no special case matches, we fall back to just being a regular colon. ~ We already read the word name above, so we have to do the rest of the ~ steps ourselves as well. -- cgit 1.4.1