"; } //line break if ($c[$i]=="\n" OR $c[$i]=="\r") { //is the current line finished ? // ")" and "}" is not OK ! (var x=function a() {}.......var ) $finishers=array(";","{","(",",","\n",":"); if (in_array($last,$finishers)) { $s=false; } } //a space ! can we cut it ? if ($c[$i]==" " OR $c[$i]=="\t") { $cutme=array(" ","\t","}","{",")","(","[","]","<",">","=",";","+","-","/","*","\n",":","&"); if (in_array($c[$i-1],$cutme) OR in_array($c[$i+1],$cutme)) { $s=false; } } //todo : rename vars/functions !! } } //save the character if ($s AND $comment==0) { $o.=$c[$i]; $last=$c[$i]; } } if ($literal) { return "{literal}".$o."{/literal}"; } else { return $o; } } ?>?>