1111 String , Whitespace )
1212
1313
14- class TokenFilter :
15-
16- def process (self , stack , stream ):
17- raise NotImplementedError
18-
19-
2014# --------------------------
2115# token process
2216
23- class _CaseFilter ( TokenFilter ) :
17+ class _CaseFilter :
2418
2519 ttype = None
2620
@@ -51,15 +45,15 @@ def process(self, stack, stream):
5145 yield ttype , value
5246
5347
54- class GetComments ( TokenFilter ) :
48+ class GetComments :
5549 """Get the comments from a stack"""
5650 def process (self , stack , stream ):
5751 for token_type , value in stream :
5852 if token_type in Comment :
5953 yield token_type , value
6054
6155
62- class StripComments ( TokenFilter ) :
56+ class StripComments :
6357 """Strip the comments from a stack"""
6458 def process (self , stack , stream ):
6559 for token_type , value in stream :
@@ -95,7 +89,7 @@ def StripWhitespace(stream):
9589 last_type = token_type
9690
9791
98- class IncludeStatement ( TokenFilter ) :
92+ class IncludeStatement :
9993 """Filter that enable a INCLUDE statement"""
10094
10195 def __init__ (self , dirpath = "." , maxRecursive = 10 ):
@@ -157,7 +151,7 @@ def process(self, stack, stream):
157151# ----------------------
158152# statement process
159153
160- class StripCommentsFilter ( TokenFilter ) :
154+ class StripCommentsFilter :
161155
162156 def _get_next_comment (self , tlist ):
163157 # TODO(andi) Comment types should be unified, see related issue38
@@ -188,7 +182,7 @@ def process(self, stack, stmt):
188182 self ._process (stmt )
189183
190184
191- class StripWhitespaceFilter ( TokenFilter ) :
185+ class StripWhitespaceFilter :
192186
193187 def _stripws (self , tlist ):
194188 func_name = '_stripws_%s' % tlist .__class__ .__name__ .lower ()
@@ -220,7 +214,7 @@ def process(self, stack, stmt, depth=0):
220214 stmt .tokens .pop (- 1 )
221215
222216
223- class ReindentFilter ( TokenFilter ) :
217+ class ReindentFilter :
224218
225219 def __init__ (self , width = 2 , char = ' ' , line_width = None ):
226220 self .width = width
@@ -385,7 +379,7 @@ def process(self, stack, stmt):
385379
386380
387381# FIXME: Doesn't work ;)
388- class RightMarginFilter ( TokenFilter ) :
382+ class RightMarginFilter :
389383
390384 keep_together = (
391385# sql.TypeCast, sql.Identifier, sql.Alias,
@@ -423,7 +417,7 @@ def process(self, stack, group):
423417 group .tokens = self ._process (stack , group , group .tokens )
424418
425419
426- class ColumnsSelect ( TokenFilter ) :
420+ class ColumnsSelect :
427421 """Get the columns names of a SELECT query"""
428422 def process (self , stack , stream ):
429423 mode = 0
@@ -477,7 +471,7 @@ def process(self, stack, stream):
477471# ---------------------------
478472# postprocess
479473
480- class SerializerUnicode ( TokenFilter ) :
474+ class SerializerUnicode :
481475
482476 def process (self , stack , stmt ):
483477 raw = unicode (stmt )
@@ -497,7 +491,7 @@ def Tokens2Unicode(stream):
497491 return result
498492
499493
500- class OutputFilter ( TokenFilter ) :
494+ class OutputFilter :
501495 varname_prefix = ''
502496
503497 def __init__ (self , varname = 'sql' ):
@@ -611,7 +605,7 @@ def _process(self, stream, varname, has_nl):
611605 yield sql .Token (T .Punctuation , ';' )
612606
613607
614- class Limit ( TokenFilter ) :
608+ class Limit :
615609 """Get the LIMIT of a query.
616610
617611 If not defined, return -1 (SQL specification for no LIMIT query)
0 commit comments