Michal Privoznik 6efdd94dbc apibuild.py: Handle enum comments properly
After f4cb85c6aff7c1d90 we only have two options for placing enum
values descriptions. It's either:

    typedef enum {
        /* Some long description. Therefore it's placed before
         * the value. */
        VIR_ENUM_A_VAL = 1,
    } virEnumA;

or:

    typedef enum {
        VIR_ENUM_B_VAL = 1, /* Some short description */
    } virEnumB;

However, our apibuild.py script is not able to deal with the
former one. It messes up comments. To fix this couple of things
needs to be done:

a) DO NOT reset self.comment in parseEnumBlock(). This is a
result from our tokenizer. Upon calling token() if it finds a
comment block it stores it in self.comment and returns the next
token (which is not comment). Therefore, if we reset self.comment
we might lose the first comment in the enum block.

b) we need a variable to track if the current enum block uses
value descriptions before or after values. That is if it's type
virEnumA or virEnumB. Depending on that, it we're dealing with
virEnumA type and the current token is a comma ',' we can add the
value into the list as we already have everything needed:
comment, name and value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2017-07-24 12:03:33 +02:00
..
2016-11-21 13:15:12 +01:00
2016-12-02 09:25:13 +01:00
2016-11-11 12:15:03 +00:00
2014-12-02 07:30:10 +01:00
2015-08-25 07:21:33 -04:00
2015-03-23 09:01:30 +01:00
2014-03-03 17:41:26 +04:00
2013-12-02 10:21:26 +08:00
2017-04-24 14:40:00 +02:00
2016-08-02 14:20:31 +02:00
2014-12-02 07:30:10 +01:00
2016-11-11 09:31:10 +00:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2015-10-20 17:29:03 +02:00
2016-11-22 14:05:24 +01:00
2017-01-10 19:37:53 +01:00
2017-07-18 09:00:13 +02:00
2017-01-04 15:10:06 +01:00
2016-11-11 12:15:03 +00:00
2014-12-02 07:30:10 +01:00