Don't use GNU extension in sed script.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 12 Oct 2013 20:41:07 +0000 (22:41 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 12 Oct 2013 21:09:34 +0000 (23:09 +0200)
Simplified the rules to match only comments used in the hints scripts.

src/js2h.sh

index 95ff77a..0aa6c04 100755 (executable)
@@ -2,12 +2,10 @@
 
 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 '"'