diff mbox

[9/9] qapi.py: Permit comments starting anywhere on the line

Message ID 1374842387-17146-10-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster July 26, 2013, 12:39 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Eric Blake July 26, 2013, 4:15 p.m. UTC | #1
On 07/26/2013 06:39 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 1d856c9..da46fb9 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -53,13 +53,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