Update API compiler

This commit is contained in:
Dan 2018-01-21 19:07:48 +01:00
parent ddb8c9e595
commit b1b04b5768

View File

@ -41,12 +41,12 @@ constructors_to_functions = {}
def get_docstring_arg_type(t: str, is_list: bool = False):
if t in core_types:
if t == "long":
return ":obj:`int`:obj:`64-bit`"
return ":obj:`int` :obj:`64-bit`"
elif "int" in t:
size = INT_RE.match(t)
return ":obj:`int`:obj:`{}-bit`".format(size.group(1)) if size else ":obj:`int`:obj:`32-bit`"
return ":obj:`int` :obj:`{}-bit`".format(size.group(1)) if size else ":obj:`int` :obj:`32-bit`"
elif t == "double":
return ":obj:`float`:obj:`64-bit`"
return ":obj:`float` :obj:`64-bit`"
elif t == "string":
return ":obj:`str`"
else:
@ -264,7 +264,7 @@ def start():
docstring_args.append(
"{}: {}{}".format(
arg_name,
"(optional {}) ".format(flag_number) if is_optional else "",
"``optional.{}``".format(flag_number) if is_optional else "",
get_docstring_arg_type(arg_type)
)
)