return join (" $tree->[0] ", map {unparse($_)} @{$tree->[1]});
}
else {
- return sprintf "%s %s\n", $tree->[0], unparse ($tree->[1]);
+ return sprintf '%s %s', $tree->[0], unparse ($tree->[1]);
}
}
+sub format { unparse(parse(@_)) }
1;
FROM foo WHERE foo.a =1 and foo.b LIKE 'station'";
print "$sql\n";
- print SQL::Abstract::Tree::unparse(SQL::Abstract::Tree::parse($sql)) . "\n";
+ print SQL::Abstract::Tree::format($sql) . "\n";
}
{
FROM (SELECT * FROM foobar) WHERE foo.a =1 and foo.b LIKE 'station'";
print "$sql\n";
- print SQL::Abstract::Tree::unparse(SQL::Abstract::Tree::parse($sql)) . "\n";
+ print SQL::Abstract::Tree::format($sql) . "\n";
}
# stuff we want: