projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28b8bd4
)
qapi.py: Permit comments starting anywhere on the line
author
Markus Armbruster
<armbru@redhat.com>
Sat, 27 Jul 2013 15:42:01 +0000
(17:42 +0200)
committer
Anthony 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
patch
|
blob
|
history
tests/qapi-schema/comments.err
patch
|
blob
|
history
tests/qapi-schema/comments.exit
patch
|
blob
|
history
tests/qapi-schema/comments.out
patch
|
blob
|
history
diff --git
a/scripts/qapi.py
b/scripts/qapi.py
index f64b7b26f8d84eb114edf28dc8f8c1479e2c2586..0ebea945bbadaeb62b4a8be5e8fd91ae6135cd59 100644
(file)
--- a/
scripts/qapi.py
+++ b/
scripts/qapi.py
@@
-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
diff --git
a/tests/qapi-schema/comments.err
b/tests/qapi-schema/comments.err
index 4a82b26d0f8bb054e8e97c7ec3d5b7e725833435..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
(file)
--- a/
tests/qapi-schema/comments.err
+++ b/
tests/qapi-schema/comments.err
@@
-1
+0,0
@@
-<stdin>:2:33: Stray "#"
diff --git
a/tests/qapi-schema/comments.exit
b/tests/qapi-schema/comments.exit
index d00491fd7e5bb6fa28c517a0bb32b8b506539d4d..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 100644
(file)
--- a/
tests/qapi-schema/comments.exit
+++ b/
tests/qapi-schema/comments.exit
@@
-1
+1
@@
-1
+0
diff --git
a/tests/qapi-schema/comments.out
b/tests/qapi-schema/comments.out
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e3bd904453988a5926204cc6eaf3faa57213435a 100644
(file)
--- a/
tests/qapi-schema/comments.out
+++ b/
tests/qapi-schema/comments.out
@@
-0,0
+1,3
@@
+[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
+['Status']
+[]