diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-01-31 14:39:57 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-01-31 14:39:57 +0000 |
commit | 5a828b15cfbe5be64878fecebe3535f9e2b5bcb1 (patch) | |
tree | 8cf6a8e1e6f7f5dfda4e7e259e7b29c71c1b48df /tools/libxl/gentypes.py | |
parent | 78d0c467143a497e6f3fba935573dbcb3b0f6ede (diff) | |
download | xen-5a828b15cfbe5be64878fecebe3535f9e2b5bcb1.tar.gz xen-5a828b15cfbe5be64878fecebe3535f9e2b5bcb1.tar.bz2 xen-5a828b15cfbe5be64878fecebe3535f9e2b5bcb1.zip |
libxl: remove comment support from IDL
People typically don't look for comments in generated source and the syntax for
specifying them in the IDL makes things harder to follow.
Instead just use source code comments in the IDL itself.
I dropped a bunch of "foo bool # enable or disable foo" type comments. A lot of
the remainder still aren't terribly useful though.
No change to the generate code other than the comments being removed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/gentypes.py')
-rw-r--r-- | tools/libxl/gentypes.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py index 7ca63755ac..7ecc11d572 100644 --- a/tools/libxl/gentypes.py +++ b/tools/libxl/gentypes.py @@ -5,19 +5,6 @@ import re import libxltypes -def format_comment(level, comment): - indent = reduce(lambda x,y: x + " ", range(level), "") - s = "%s/*\n" % indent - s += "%s * " % indent - comment = comment.replace("\n", "\n%s * " % indent) - x = re.compile(r'^%s \* $' % indent, re.MULTILINE) - comment = x.sub("%s *" % indent, comment) - s += comment - s += "\n" - s += "%s */" % indent - s += "\n" - return s - def libxl_C_instance_of(ty, instancename): if isinstance(ty, libxltypes.Aggregate) and ty.typename is None: if instancename is None: @@ -30,17 +17,12 @@ def libxl_C_instance_of(ty, instancename): def libxl_C_type_define(ty, indent = ""): s = "" if isinstance(ty, libxltypes.Enumeration): - if ty.comment is not None: - s += format_comment(0, ty.comment) - if ty.typename is None: s += "enum {\n" else: s += "typedef enum %s {\n" % ty.typename for v in ty.values: - if v.comment is not None: - s += format_comment(4, v.comment) x = "%s = %d" % (v.name, v.value) x = x.replace("\n", "\n ") s += " " + x + ",\n" @@ -50,17 +32,12 @@ def libxl_C_type_define(ty, indent = ""): s += "} %s" % ty.typename elif isinstance(ty, libxltypes.Aggregate): - if ty.comment is not None: - s += format_comment(0, ty.comment) - if ty.typename is None: s += "%s {\n" % ty.kind else: s += "typedef %s %s {\n" % (ty.kind, ty.typename) for f in ty.fields: - if f.comment is not None: - s += format_comment(4, f.comment) x = libxl_C_instance_of(f.type, f.name) if f.const: x = "const " + x |