提交 f1a145e1 编写于 作者: M Markus Armbruster 提交者: Anthony Liguori

qapi.py: Permit comments starting anywhere on the line

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 28b8bd4c
......@@ -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
......
[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
['Status']
[]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册