Adjust default values of type index in Lua docs
This commit is contained in:
parent
bf5655c0bc
commit
c3c8648be4
@ -151,6 +151,12 @@ class Writer(object):
|
|||||||
error("unknown constant '%s'" % value)
|
error("unknown constant '%s'" % value)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def __format_default_value(self, p):
|
||||||
|
if p.type.name == 'index' and self.mode == 'lua':
|
||||||
|
return str(int(p.default_value) + 1)
|
||||||
|
else:
|
||||||
|
return self.__format_constant(p.default_value)
|
||||||
|
|
||||||
def __format_doc(self, doc):
|
def __format_doc(self, doc):
|
||||||
text = doc.text
|
text = doc.text
|
||||||
text = re.sub(r'@([\w\d_]+)(?!\{)', r'<parameter>\1</parameter>', text)
|
text = re.sub(r'@([\w\d_]+)(?!\{)', r'<parameter>\1</parameter>', text)
|
||||||
@ -209,7 +215,7 @@ class Writer(object):
|
|||||||
if not self.__check_bind_ann(p.type):
|
if not self.__check_bind_ann(p.type):
|
||||||
return
|
return
|
||||||
if p.default_value is not None:
|
if p.default_value is not None:
|
||||||
params.append('%s=%s' % (p.name, self.__format_constant(p.default_value)))
|
params.append('%s=%s' % (p.name, self.__format_default_value(p)))
|
||||||
else:
|
else:
|
||||||
params.append(p.name)
|
params.append(p.name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user