From ff4f3547472c001e8a80f97f83d59ba27ec101bb Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Tue, 5 May 2009 07:06:33 +0200 Subject: Added Token.flatten() that just yields self to unify behavior of TokenList and Token. --- sqlparse/sql.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sqlparse') diff --git a/sqlparse/sql.py b/sqlparse/sql.py index 52d9b4a..8eef036 100644 --- a/sqlparse/sql.py +++ b/sqlparse/sql.py @@ -48,6 +48,10 @@ class Token(object): short = raw return re.sub('\s+', ' ', short) + def flatten(self): + """Resolve subgroups.""" + yield self + def match(self, ttype, values, regex=False): """Checks whether the token matches the given arguments. -- cgit v1.2.1