[libvirt] [PATCH 21/22] apibuild: Simplify merging of preproc tokens

Radostin Stoyanov posted 22 patches 7 years, 3 months ago
[libvirt] [PATCH 21/22] apibuild: Simplify merging of preproc tokens
Posted by Radostin Stoyanov 7 years, 3 months ago
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 docs/apibuild.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/apibuild.py b/docs/apibuild.py
index f9784f9bd..24e0eb505 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -479,8 +479,8 @@ class CLexer:
                 # of '#define' we might end up with '#' and 'define'. This
                 # merges them back together
                 if self.tokens[0][1] == "#":
-                    self.tokens[0] = ('preproc', self.tokens[0][1] + self.tokens[1][1])
-                    self.tokens = self.tokens[:1] + self.tokens[2:]
+                    self.tokens[0] = ('preproc', "#" + self.tokens[1][1])
+                    del self.tokens[1]
                 break
             l = len(line)
             if line[0] == '"' or line[0] == "'":
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 21/22] apibuild: Simplify merging of preproc tokens
Posted by Daniel P. Berrangé 7 years, 3 months ago
On Sat, Mar 17, 2018 at 02:23:39PM +0000, Radostin Stoyanov wrote:
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
> ---
>  docs/apibuild.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list