Pre-Formatting rules to make parsing easier.

This commit is contained in:
f0o
2015-04-28 13:49:14 +00:00
parent bcf3c5c541
commit a2c1ba27d6

View File

@@ -35,6 +35,9 @@ function GenSQL($rule) {
if( empty($rule) ) {
return false;
}
//Pretty-print rule to dissect easier
$pretty = array('*' => ' * ', '(' => ' ( ', ')' => ' ) ', '/' => ' / ', '&&' => ' && ', '||' => ' || ');
$rule = str_replace(array_keys($pretty),$pretty,$rule);
$tmp = explode(" ",$rule);
$tables = array();
foreach( $tmp as $opt ) {