Combine concatenated strings on script minify.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 28 Oct 2013 21:04:01 +0000 (22:04 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 28 Oct 2013 21:04:01 +0000 (22:04 +0100)
If there are string concatenated like "foo" + "bar", combine them to "foobar".

src/js2h.sh

index 0aa6c04..90ed16a 100755 (executable)
@@ -6,6 +6,7 @@ cat $1 | \
     sed -e 's:/\*[^*]*\*/::g' \
     -e 's|[ ]\{2,\}| |g' \
     -e "s|[ ]\{0,\}\([-!?<>:=(){};+\&\"',\|]\)[ ]\{0,\}|\1|g" \
+    -e 's|"+"||g' \
     -e 's|\\|\\\\|g' \
     -e 's|"|\\"|g'
 echo '"'