From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Hoes Subject: [PATCH 03/28] libxl: ocaml: fix code intended to output comments before definitions Date: Mon, 25 Mar 2013 14:45:04 +0000 Message-ID: <1364222729-6982-4-git-send-email-rob.hoes@citrix.com> References: <1364222729-6982-1-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1364222729-6982-1-git-send-email-rob.hoes@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, Rob Hoes List-Id: xen-devel@lists.xenproject.org I'm not sure how useful these comments actually are but erred on the side of fixing rather than removing. Signed-off-by: Ian Campbell Signed-off-by: Rob Hoes --- tools/ocaml/libs/xl/genwrap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py index ea978bf..5757218 100644 --- a/tools/ocaml/libs/xl/genwrap.py +++ b/tools/ocaml/libs/xl/genwrap.py @@ -79,12 +79,14 @@ def gen_ocaml_ml(ty, interface, indent=""): s = ("""(* %s interface *)\n""" % ty.typename) else: s = ("""(* %s implementation *)\n""" % ty.typename) + if isinstance(ty, idl.Enumeration): - s = "type %s = \n" % ty.rawname + s += "type %s = \n" % ty.rawname for v in ty.values: s += "\t | %s\n" % v.rawname elif isinstance(ty, idl.Aggregate): - s = "" + s += "" + if ty.typename is None: raise NotImplementedError("%s has no typename" % type(ty)) else: -- 1.7.10.4