summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-ccoin
blob: 2f4295824db44db8cd3f9e85bcdbc222661daa9c (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
#!/bin/sh

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

BEGIN {
	CC = toupper(CC)
}

$1 == CC {
	split($0, a, "\t")
	$0 = a[1]

	n = 2
	y = $2

	if (getcls($3) == "error") {
		n = 3
		printf "tr {td .missing {-%s @sup{-%s}}", y, $3
	} else
		printf "tr {td .missing {-%s}", y

	for (i = 1; i <= NF - n; i++)
		printf "td colspan=\"Y\" .%s {-%s}", getcls($(i + n)), a[i + 1]
	print "}"
}

END {
	print "__MARKER__"
}
' data/ccs            \
| scripts/colspan.sed \
| grep -Fv __MARKER__