qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] qapi2texi: change texi formatters
Date: Wed, 25 Jan 2017 17:03:07 +0400	[thread overview]
Message-ID: <20170125130308.16104-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20170125130308.16104-1-marcandre.lureau@redhat.com>

STRUCT_FMT is generic enough, rename it to TYPE_FMT, use it for unions.

Rename COMMAND_FMT to MSG_FMT, since it applies to both commands and
events.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 scripts/qapi2texi.py | 46 +++++++++++++++++++---------------------------
 1 file changed, 19 insertions(+), 27 deletions(-)

diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 83ded95c2d..e1b79c2ad3 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -9,7 +9,7 @@ import sys
 
 import qapi
 
-COMMAND_FMT = """
+MSG_FMT = """
 @deftypefn {type} {{}} {name}
 
 {body}
@@ -18,16 +18,7 @@ COMMAND_FMT = """
 
 """.format
 
-ENUM_FMT = """
-@deftp Enum {name}
-
-{body}
-
-@end deftp
-
-""".format
-
-STRUCT_FMT = """
+TYPE_FMT = """
 @deftp {{{type}}} {name}
 
 {body}
@@ -172,9 +163,9 @@ def texi_body(doc):
 def texi_alternate(expr, doc):
     """Format an alternate to texi"""
     body = texi_body(doc)
-    return STRUCT_FMT(type="Alternate",
-                      name=doc.symbol,
-                      body=body)
+    return TYPE_FMT(type="Alternate",
+                    name=doc.symbol,
+                    body=body)
 
 
 def texi_union(expr, doc):
@@ -186,9 +177,9 @@ def texi_union(expr, doc):
         union = "Simple Union"
 
     body = texi_body(doc)
-    return STRUCT_FMT(type=union,
-                      name=doc.symbol,
-                      body=body)
+    return TYPE_FMT(type=union,
+                    name=doc.symbol,
+                    body=body)
 
 
 def texi_enum(expr, doc):
@@ -197,32 +188,33 @@ def texi_enum(expr, doc):
         if i not in doc.args:
             doc.args[i] = ''
     body = texi_body(doc)
-    return ENUM_FMT(name=doc.symbol,
+    return TYPE_FMT(type="Enum",
+                    name=doc.symbol,
                     body=body)
 
 
 def texi_struct(expr, doc):
     """Format a struct to texi"""
     body = texi_body(doc)
-    return STRUCT_FMT(type="Struct",
-                      name=doc.symbol,
-                      body=body)
+    return TYPE_FMT(type="Struct",
+                    name=doc.symbol,
+                    body=body)
 
 
 def texi_command(expr, doc):
     """Format a command to texi"""
     body = texi_body(doc)
-    return COMMAND_FMT(type="Command",
-                       name=doc.symbol,
-                       body=body)
+    return MSG_FMT(type="Command",
+                   name=doc.symbol,
+                   body=body)
 
 
 def texi_event(expr, doc):
     """Format an event to texi"""
     body = texi_body(doc)
-    return COMMAND_FMT(type="Event",
-                       name=doc.symbol,
-                       body=body)
+    return MSG_FMT(type="Event",
+                   name=doc.symbol,
+                   body=body)
 
 
 def texi_expr(expr, doc):
-- 
2.11.0.295.gd7dffce1c

  reply	other threads:[~2017-01-25 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 13:03 [Qemu-devel] [PATCH 0/2] qapi2texi: add type information Marc-André Lureau
2017-01-25 13:03 ` Marc-André Lureau [this message]
2017-01-27  7:44   ` [Qemu-devel] [PATCH 1/2] qapi2texi: change texi formatters Markus Armbruster
2017-01-25 13:03 ` [Qemu-devel] [PATCH 2/2] qapi2texi: produce type information Marc-André Lureau
2017-01-27  9:38   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170125130308.16104-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).