summaryrefslogtreecommitdiff
path: root/cffi/cparser.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-11-15 09:22:52 +0100
committerArmin Rigo <arigo@tunes.org>2015-11-15 09:22:52 +0100
commit16db90ce06a3cb3b155eea14b6179d2228563c3b (patch)
tree0d9f45813580d05d75668966a764c292e145912e /cffi/cparser.py
parent0cafc2884c0a40414687296e423c44346b4b316e (diff)
parent7a8bdf1f2c870207b99ae4970dd590c448d4d0f6 (diff)
downloadcffi-16db90ce06a3cb3b155eea14b6179d2228563c3b.tar.gz
hg merge default
Diffstat (limited to 'cffi/cparser.py')
-rw-r--r--cffi/cparser.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cffi/cparser.py b/cffi/cparser.py
index b2290f1..61af035 100644
--- a/cffi/cparser.py
+++ b/cffi/cparser.py
@@ -63,7 +63,8 @@ def _workaround_for_old_pycparser(csource):
if csource.startswith('*', endpos):
parts.append('('); closing += ')'
level = 0
- for i in xrange(endpos, len(csource)):
+ i = endpos
+ while i < len(csource):
c = csource[i]
if c == '(':
level += 1
@@ -74,6 +75,7 @@ def _workaround_for_old_pycparser(csource):
elif c in ',;=':
if level == 0:
break
+ i += 1
csource = csource[endpos:i] + closing + csource[i:]
#print repr(''.join(parts)+csource)
parts.append(csource)