Simplified the rules to match only comments used in the hints scripts.
echo -n '#define HINTS_JS "'
cat $1 | \
- sed -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" | \
tr '\n\r\t' ' ' | \
- sed -e "s| \+| |g" \
- -e "s|^//.*$||" \
- -e "s| \([-!?<>:=(){};+\&\"',\|]\)|\1|g" \
- -e "s|\([-!?<>:=(){};+\&\"',\|]\) |\1|g" \
+ sed -e 's:/\*[^*]*\*/::g' \
+ -e 's|[ ]\{2,\}| |g' \
+ -e "s|[ ]\{0,\}\([-!?<>:=(){};+\&\"',\|]\)[ ]\{0,\}|\1|g" \
-e 's|\\|\\\\|g' \
-e 's|"|\\"|g'
echo '"'