summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-scoin
blob: e7e7982348a4f15d682cf3e01fc54dc3650211dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

gawk -v CC=$1 '
@include "scripts/getcls.awk"

BEGIN {
	CC = toupper(CC)
}

$1 == CC && /.. start/ {
	sub(/^.. start/, "");
	sub(/^ /, "")
	printf "tr .new-design {th colspan=\"8\" {-%s}}\n", $0
	next
}

$1 == CC {
	y = $10
	if ($11 != "") {
		y_ = $11
		for (i = 12; i <= NF; i++)
			y_ = y_ " " $i
	}
	printf "trX {"
	for (i = 2; i <= 9; i++) {
		# Greece 2002 needs special handling
		if (CC == "GR" && $10 == 2002 && $11 == "MM") {
			if (i <= 5)
				y_ = "F"
			else if (i <= 7)
				y_ = "E"
			else
				y_ = "S"
		}

		if ($11 != "")
			printf "td .%s {-%s @sup{-%s}}", getcls($i), y, y_
		else
			printf "td .%s {-%s}", getcls($i), y
	}
	print "}"
}

END {
	print "__MARKER__"
}
' data/coins \
| scripts/last-of-design.sed