qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 15/16] qapi: Share gen_err_check()


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v6 15/16] qapi: Share gen_err_check()
Date: Thu, 01 Oct 2015 08:40:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 09/29/2015 08:31 AM, Markus Armbruster wrote:
>> 
>> To really cut the verbosity, I figure we'd have to do something more
>> radical, like having cgen() recognize a (short!) pattern and replace it
>> with a full-blown error check.  Not sure that's actually a good idea,
>> though :)
>
> Another radical idea would be write the python code to not care about
> whitespace or indentation discrepancies, because we instead run things
> through 'indent' as part of the code generation. Then we can emit ugly
> code without caring about indentation or multi-line, if it makes the
> python easier to write, and the output would still be nicely formatted.

I believe generating perfectly neat code the way we generate code
(printing text) isn't practical.  Avoiding long lines in particular
would take far too much effort, and make the generators much more
complex and less readable.

Of course, even if we piped through indent, we'd still want the
generated code look neat in the generator source.  But that's a
different kind of neat.

>  I'm not sure I want to do that, though.

I'm open to the idea.  Right now it doesn't seem worthwhile, because we
already did the work for reasonably legible generated code.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]