mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Enhance parser
This commit is contained in:
@@ -159,4 +159,4 @@ if __name__ == '__main__':
|
||||
# Render each method's page.
|
||||
for method in class_.methods:
|
||||
method_path = '{}/{}.html'.format(class_.name, method.name)
|
||||
render('method.html', method_path, level=1, current_class=class_, current_method=method)
|
||||
render('method.html', method_path, level=1, current_class=class_, current_method=method)
|
||||
|
||||
@@ -43,6 +43,10 @@ class ParameterDoc(object):
|
||||
self.description += '<p><em>Valid numbers</em>: all decimal numbers.</p>'
|
||||
|
||||
self.data_type = 'number'
|
||||
elif self.data_type == 'bool':
|
||||
self.data_type = 'boolean'
|
||||
elif self.data_type == 'uint64':
|
||||
self.data_type = 'string'
|
||||
|
||||
|
||||
class MethodDoc(object):
|
||||
@@ -106,7 +110,7 @@ class ClassParser(object):
|
||||
|
||||
param_regex = re.compile(r"""\s*\*\s@param\s # The @param tag starts with opt. whitespace followed by "* @param ".
|
||||
([&\w]+)\s(\w+) # The data type, a space, and the name of the param.
|
||||
(?:\s=\s(.+))? # The default value: a = surrounded by spaces, followed by text.
|
||||
(?:\s=\s(.-))? # The default value: a = surrounded by spaces, followed by text.
|
||||
(?:\s:\s(.+))? # The description: a colon surrounded by spaces, followed by text.""",
|
||||
re.X)
|
||||
|
||||
@@ -239,4 +243,4 @@ class ClassParser(object):
|
||||
parser.next_line(line)
|
||||
line = file.readline()
|
||||
|
||||
return parser.to_class_doc()
|
||||
return parser.to_class_doc()
|
||||
|
||||
Reference in New Issue
Block a user