comparison python/yacc.py @ 368:d2ddfe134c48

Remove yield from for python < 3.3
author Windel Bouwman
date Fri, 21 Mar 2014 11:21:50 +0100
parents 86b02c98a717
children 173e20a47fda
comparison
equal deleted inserted replaced
367:577ed7fb3fe4 368:d2ddfe134c48
100 yield('%%', '%%') 100 yield('%%', '%%')
101 continue 101 continue
102 if section == 0: 102 if section == 0:
103 if line.startswith('%tokens'): 103 if line.startswith('%tokens'):
104 yield('%tokens', '%tokens') 104 yield('%tokens', '%tokens')
105 yield from tokenize_line(line[7:]) 105 for tk in tokenize_line(line[7:]):
106 yield tk
106 else: 107 else:
107 yield ('HEADER', line) 108 yield ('HEADER', line)
108 elif section == 1: 109 elif section == 1:
109 yield from tokenize_line(line) 110 for tk in tokenize_line(line):
111 yield tk
110 yield ('eof', 'eof') 112 yield ('eof', 'eof')
111 self.tokens = tokenize() 113 self.tokens = tokenize()
112 self.token = self.tokens.__next__() 114 self.token = self.tokens.__next__()
113 115
114 def next_token(self): 116 def next_token(self):