On 07/26/2013 06:39 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster <arm...@redhat.com> > --- > scripts/qapi.py | 29 +++++++++++++++++++++++++++-- > tests/qapi-schema/test-qapi.py | 2 ++ > tests/qapi-schema/unclosed-string.err | 2 +- > 3 files changed, 30 insertions(+), 3 deletions(-)
> > +class QAPISchemaError(Exception): > + def __init__(self, schema, msg): > + self.fp = schema.fp > + self.msg = msg > + self.line = self.col = 1 > + for ch in schema.src[0:schema.pos]: > + if ch == '\n': > + self.line += 1 > + self.col = 1 > + elif ch == '\t': > + self.col = (self.col + 7) % 8 + 1 Do we even want to allow TABs in the schema files? Right now, they are tab-free; if you error out here instead of futzing with tab width, we could forcefully maintain that property. > + else: > + self.col += 1 Does python support ++ as shorthand for += 1? Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature