]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qapi.py: Permit comments starting anywhere on the line
authorMarkus Armbruster <armbru@redhat.com>
Sat, 27 Jul 2013 15:42:01 +0000 (17:42 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 29 Jul 2013 15:37:11 +0000 (10:37 -0500)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scripts/qapi.py
tests/qapi-schema/comments.err
tests/qapi-schema/comments.exit
tests/qapi-schema/comments.out

index f64b7b26f8d84eb114edf28dc8f8c1479e2c2586..0ebea945bbadaeb62b4a8be5e8fd91ae6135cd59 100644 (file)
@@ -68,13 +68,12 @@ class QAPISchema:
 
     def accept(self):
         while True:
-            bol = self.cursor == 0 or self.src[self.cursor-1] == '\n'
             self.tok = self.src[self.cursor]
             self.pos = self.cursor
             self.cursor += 1
             self.val = None
 
-            if self.tok == '#' and bol:
+            if self.tok == '#':
                 self.cursor = self.src.find('\n', self.cursor)
             elif self.tok in ['{', '}', ':', ',', '[', ']']:
                 return
index 4a82b26d0f8bb054e8e97c7ec3d5b7e725833435..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-<stdin>:2:33: Stray "#"
index d00491fd7e5bb6fa28c517a0bb32b8b506539d4d..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 100644 (file)
@@ -1 +1 @@
-1
+0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e3bd904453988a5926204cc6eaf3faa57213435a 100644 (file)
@@ -0,0 +1,3 @@
+[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
+['Status']
+[]