apibuild.py: Handle enum comments properly
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 <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Martin Kletzander <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>

eskultety/libvirt,nertpinx/libvirt,jfehlig/libvirt,jfehlig/libvirt,jfehlig/libvirt,jardasgit/libvirt,zippy2/libvirt,nertpinx/libvirt,eskultety/libvirt,nertpinx/libvirt,olafhering/libvirt,crobinso/libvirt,eskultety/libvirt,jardasgit/libvirt,andreabolognani/libvirt,libvirt/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,crobinso/libvirt,zippy2/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,crobinso/libvirt,jardasgit/libvirt,datto/libvirt,olafhering/libvirt,libvirt/libvirt,datto/libvirt,zippy2/libvirt,libvirt/libvirt,jardasgit/libvirt,crobinso/libvirt,fabianfreyer/libvirt,eskultety/libvirt,andreabolognani/libvirt,nertpinx/libvirt,nertpinx/libvirt,datto/libvirt,datto/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,olafhering/libvirt,datto/libvirt,eskultety/libvirt,zippy2/libvirt,libvirt/libvirt,olafhering/libvirt,andreabolognani/libvirt