Support nested tuple unpacking in for loops

Fixed issue where unpacking nested tuples in a for loop using would raise a
"couldn't apply loop context" error if the loop context was used. The regex
used to match the for loop expression now allows the list of loop variables
to contain parenthesized sub-tuples. Pull request courtesy Matt Trescott.

For example:
~~~
for (key1, val1), (key2, val2) in itertools.pairwise(dict.items()):
    ...
~~~

This is really just "kicking the can down the road" so to speak, because
it doesn't allow an infinite number of layers of tuples, but
it helps somewhat.

Closes: #368
Pull-request: https://github.com/sqlalchemy/mako/pull/368
Pull-request-sha: 3f15a87266a36306826d460cddc7699dd62a9c43

Change-Id: I52915acb8904daf7071d8c92e1de352f200131ec
3 files changed