From ada12c5f61af16ae523ee87aa6e679a697843e6e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 9 Jul 2021 19:31:07 +0100 Subject: [PATCH] jstest: lower: from-pieces helper script Signed-off-by: Ian Jackson --- jstest/from-pieces | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jstest/from-pieces b/jstest/from-pieces index 78cf90af..f5507288 100755 --- a/jstest/from-pieces +++ b/jstest/from-pieces @@ -1,5 +1,11 @@ #!/usr/bin/perl -w +# 1. in JS console in browser +# json_report_error(pieces) +# 2. c&p resulting error into a file, strip off front +# 3. run this +# 4. paste into jst-lower.rs + use strict; use JSON; use Data::Dumper; @@ -14,10 +20,12 @@ my @pieces = map { [ $p->{z}, $p->{zg}, - (sprintf " sp!(\"%s\", %s, %s),\n", + (sprintf " sp!(\"%s\", %s, %s),%s\n", $id, $p->{pinned} ? 'true' : 'false', - $p->{moveable} eq 'IfWresting' ? 'No' : $p->{moveable}) + $p->{moveable} eq 'IfWresting' ? 'No' : $p->{moveable}, + $p->{held} ? " // HELD $p->{held}" : '', + ) ] } keys %$data; -- 2.30.2