Skip to content

Commit a7937c8

Browse files
committed
cosmetics
1 parent 924072b commit a7937c8

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

.vitepress/theme/custom.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:root.dark img[src$=".svg"] {
1+
:root.dark img {
22
filter: invert(1);
33
}
44

5-
:root:not(.dark) img[src$=".svg"] {
5+
:root:not(.dark) img {
66
filter: invert(0);
77
}

bats/setup

+15-16
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ slexe() {
3030
set +e
3131
[ -r bin/slexfe ] || {
3232
_err "Error: bin/slexfe not found." | tee -a $TMP/err
33-
exit 1
34-
}
33+
exit 1 }
3534
command -v slangroom-exec > /dev/null || {
3635
_err "Error: slangroom-exec not found." | tee -a $TMP/err
37-
exit 1
38-
}
36+
exit 1 }
3937
[ -r "${1}.slang" ] || {
4038
_err "Error: script not found: $1" | tee -a $TMP/err
41-
exit 1
42-
}
43-
# run bats_pipe bash bin/slexfe -F $1 \| slangroom-exec
39+
exit 1 }
40+
# EXECUTION (timed)
4441
>&3 echo " 🔥 `basename ${1}.slang`"
4542
local start_time_s=$(date +%s)
4643
local start_time_ns=$(date +%N)
@@ -51,20 +48,20 @@ slexe() {
5148
local end_time_s=$(date +%s)
5249
local end_time_ns=$(date +%N)
5350
export output=`cat $TMP/out`
51+
# analyze and print logs in case of error
5452
[ "$res" != 0 ] && {
5553
>&2 echo "TRACE:"
5654
awk '/J64 TRACE/ {print $3}' $TMP/err | \
5755
cut -d\" -f1 | base64 -d | jq .
5856
>&2 echo "HEAP:"
5957
awk '/J64 HEAP/ {print $3}' $TMP/err | \
6058
cut -d\" -f1 | base64 -d | jq .
61-
exit 1
62-
}
59+
exit 1 }
6360
[ "$output" == "" ] && {
6461
_err "Output is missing, no result from previous computation" | tee -a $TMP/err
65-
exit 1
66-
}
67-
# Avoid leading zero issues by normalizing inputs
62+
exit 1 }
63+
# Calculate execution timing:
64+
# avoid leading zero issues in shell by normalizing inputs
6865
start_time_s=$((10#$start_time_s))
6966
start_time_ns=$((10#$start_time_ns))
7067
end_time_s=$((10#$end_time_s))
@@ -73,26 +70,27 @@ slexe() {
7370
local start_time_ms=$((start_time_s * 1000 + start_time_ns / 1000000))
7471
local end_time_ms=$((end_time_s * 1000 + end_time_ns / 1000000))
7572
local execution_time_ms=$((end_time_ms - start_time_ms))
73+
# Write the output
7674
rm -f "${1}.out.json"
7775
echo "$output" > "${1}.out.json"
7876
>&3 echo " 💾 `basename ${1}.out.json`"
7977
>&3 echo ""
80-
set -e
78+
set -e # relax
79+
# Generate execution graph
8180
if [ -L $1.data.json ]; then
8281
idata=`readlink $1.data.json`
8382
local size=$(stat --format="%s" "$idata") # Get file size in bytes
84-
idata="`basename $idata`\n\n$size bytes"
83+
idata="`basename $idata|cut -d. -f1`\n\n$size bytes"
8584
else
8685
idata="null\n\n0 bytes"
8786
fi
8887
if [ -L $1.keys.json ]; then
8988
ikeys=`readlink $1.keys.json`
9089
local size=$(stat --format="%s" "$ikeys") # Get file size in bytes
91-
ikeys="`basename $ikeys`\n\n$size bytes"
90+
ikeys="`basename $ikeys|cut -d. -f1`\n\n$size bytes"
9291
else
9392
ikeys="null\n\n0 bytes"
9493
fi
95-
# size_kilobytes=$(echo "scale=2; $size / 1024" | bc)
9694
iout="`basename $1`\n\n$(stat --format="%s" "$1.out.json") bytes"
9795
cat <<EOF | dot -Tsvg -o ${1}.svg
9896
digraph G {
@@ -110,6 +108,7 @@ digraph G {
110108
edge [color=black, arrowsize=0.7];
111109
}
112110
EOF
111+
# add entry to execution log
113112
}
114113

115114
save_output() {

src/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ hero:
1111
alt: Hands-on, Dyne.org style
1212
actions:
1313
- theme: brand
14-
text: MLDSA (Post-Quantum)
14+
text: ML-DSA (Post-Quantum)
1515
link: /mldsa-w3c-vc
1616
- theme: alt
1717
text: ECDSA (P256)

0 commit comments

Comments
 (0)