stud/IV/vars.awk
Motiejus Jakštys 98af154526 test harness
2021-05-15 00:31:41 +03:00

27 lines
565 B
Awk

#!/usr/bin/awk -f
BEGIN { FS="[(); ]" }
/small_angle constant real default radians/ {
x1 += 1;
d1 = sprintf("\\newcommand{\\smallAngle}{$%d^\\circ$}",$8);
}
/isolation_threshold constant real default / {
x2 += 1;
d2 = sprintf("\\newcommand{\\isolationThreshold}{%.1f}",$7);
}
/scale2 constant float default / {
x3 += 1;
d3 = sprintf("\\newcommand{\\exaggerationEnthusiasm}{%.1f}",$7);
}
END{
if(x1 == 1 && x2 == 1 && x3 == 1) {
print d1 > "vars.inc.tex"
print d2 >> "vars.inc.tex"
print d3 >> "vars.inc.tex"
} else {
exit 1
}
}