summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorJesús Leganés Combarro "Piranna" <piranna@gmail.com>2012-05-18 22:53:52 +0200
committerJesús Leganés Combarro "Piranna" <piranna@gmail.com>2012-05-18 22:53:52 +0200
commite78ff47592f593448b4ca6ef12869dbeba13278b (patch)
tree880c9ad5702b277c9a097c7495cf98f0dda04404 /sqlparse
parenta6d6641e5feb0507f08d9167158d4ca033eb940f (diff)
downloadsqlparse-e78ff47592f593448b4ca6ef12869dbeba13278b.tar.gz
Add comments and docstring for _process_identifierlist()
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/filters.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sqlparse/filters.py b/sqlparse/filters.py
index a6a34e9..e306de4 100644
--- a/sqlparse/filters.py
+++ b/sqlparse/filters.py
@@ -391,12 +391,17 @@ class ReindentFilter:
self.indent -= 1
def _process_identifierlist(self, tlist):
+ """
+ Process an identifier list
+ """
+ # If there are more than an identifier, put each on a line
identifiers = list(tlist.get_identifiers())
-
if len(identifiers) > 1 and not tlist.within(sql.Function):
+ # Get offset size to increase
first = list(identifiers[0].flatten())[0]
num_offset = self._get_offset(first) - len(first.value)
+ # Increase offset and insert new lines
self.offset += num_offset
for token in identifiers[1:]:
tlist.insert_before(token, self.nl())
@@ -405,6 +410,7 @@ class ReindentFilter:
tlist.insert_after(token, self.nl())
self.offset -= num_offset
+ # Process the identifier list as usual
self._process_default(tlist)
def _process_case(self, tlist):