changeset 368:d2ddfe134c48

Remove yield from for python < 3.3
author Windel Bouwman
date Fri, 21 Mar 2014 11:21:50 +0100
parents 577ed7fb3fe4
children 5333318ee33d
files experiments/qemu_vexpress_a9/run.sh python/pyburg.py python/yacc.py
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/experiments/qemu_vexpress_a9/run.sh	Fri Mar 21 10:27:57 2014 +0100
+++ b/experiments/qemu_vexpress_a9/run.sh	Fri Mar 21 11:21:50 2014 +0100
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 qemu-system-arm -M vexpress-a9 -m 128M  -kernel test.bin \
-    -serial file:output.txt
+    -serial stdio
 
--- a/python/pyburg.py	Fri Mar 21 10:27:57 2014 +0100
+++ b/python/pyburg.py	Fri Mar 21 11:21:50 2014 +0100
@@ -99,7 +99,8 @@
                     if section == 0:
                         header_lines.append(line)
                     else:
-                        yield from baselex.tokenize(tok_spec, line)
+                        for tk in baselex.tokenize(tok_spec, line):
+                            yield tk
             yield Token(EOF, EOF)
         self.tokens = tokenize()
         self.token = self.tokens.__next__()
--- a/python/yacc.py	Fri Mar 21 10:27:57 2014 +0100
+++ b/python/yacc.py	Fri Mar 21 11:21:50 2014 +0100
@@ -102,11 +102,13 @@
                 if section == 0:
                     if line.startswith('%tokens'):
                         yield('%tokens', '%tokens')
-                        yield from tokenize_line(line[7:])
+                        for tk in tokenize_line(line[7:]):
+                            yield tk
                     else:
                         yield ('HEADER', line)
                 elif section == 1:
-                    yield from tokenize_line(line)
+                    for tk in tokenize_line(line):
+                        yield tk
             yield ('eof', 'eof')
         self.tokens = tokenize()
         self.token = self.tokens.__next__()