ref: 1c65e9795d3a51c26a87296d53b0ebe9efdc7719
dir: /tools/gencode.awk/
#!/bin/awk -f
BEGIN{
printf "#line 0 \"tools/%s\"\n", ENVIRON["file"]
}
$1 == "%%json" {
convert = 1
next
}
$1 == "%/json" {
convert = 0
next
}
{
if (!convert) {
print
next
}
gsub(/"/, "\\\"")
gsub(/^/, "\"")
gsub(/$/, "\"")
print
}