From d0124b877739501187c76b6587856d86396123a7 Mon Sep 17 00:00:00 2001 From: Shen Longxing Date: Fri, 18 Dec 2015 15:38:26 +0800 Subject: fix issue #215 Add splitlevel for while/end while --- sqlparse/engine/filter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/filter.py b/sqlparse/engine/filter.py index 149db58..360ff9b 100644 --- a/sqlparse/engine/filter.py +++ b/sqlparse/engine/filter.py @@ -51,7 +51,7 @@ class StatementFilter: return 1 return 0 - if unified in ('END IF', 'END FOR'): + if unified in ('END IF', 'END FOR', 'END WHILE'): return -1 if unified == 'END': @@ -64,7 +64,7 @@ class StatementFilter: self._is_create = True return 0 - if unified in ('IF', 'FOR') \ + if unified in ('IF', 'FOR', 'WHILE') \ and self._is_create and self._begin_depth > 0: return 1 -- cgit v1.2.1