Eluna changes

* Attempt fix VS 2010 pow error
* Tweak the doc parser a little to work with variable arugments ... and show
enum names and similar.
* Change push and check to work with more types like size and time (fix osx)
* Add errors to using not implemented operations on eluna objects
* Change some SQL comments to work with documentation better
* Add functions to create uint64 and int64 values (may need rename)
* Change doc generation documentation a little to make it clearer how proto is used
This commit is contained in:
Rochet2
2014-12-19 12:39:37 +02:00
parent 809a0ac2bc
commit 631e220b31
9 changed files with 200 additions and 121 deletions

View File

@@ -43,7 +43,10 @@ This is a template for a function that takes in different parameters. When defin
*
* @proto returnValue = (object)
* @proto returnValue = (x, y, z)
* @param Type paramName = defaultValue : parameter description
* @param [WorldObject] object = defaultValue : parameter description
* @param float x = defaultValue : parameter description
* @param float y = defaultValue : parameter description
* @param float z = defaultValue : parameter description
* @return Type returnName : return value description
*/
```

View File

@@ -118,6 +118,7 @@ if __name__ == '__main__':
'string': 'http://www.lua.org/pil/2.4.html',
'table': 'http://www.lua.org/pil/2.5.html',
'function': 'http://www.lua.org/pil/2.6.html',
'...': 'http://www.lua.org/pil/5.2.html',
}
def data_type_parser(content):
@@ -132,6 +133,8 @@ if __name__ == '__main__':
url = '{}{}/index.html'.format(('../' * level), class_name)
return '<strong><a class="mod" href="{}">{}</a></strong>'.format(url, class_name)
return content[1:-1]
return link_parser, data_type_parser
# Create the render function with the template path and parser maker.

View File

@@ -18,6 +18,8 @@ class ParameterDoc(object):
'uint16': ('0', '65,535'),
'int32': ('-2,147,483,647', '2,147,483,647'),
'uint32': ('0', '4,294,967,295'),
'int64': ('-9,223,372,036,854,775,808', '9,223,372,036,854,775,807'),
'uint64': ('0', '18,446,744,073,709,551,615'),
}
@params(self=object, name=unicode, data_type=str, description=unicode, default_value=Nullable(unicode))
@@ -47,8 +49,8 @@ class ParameterDoc(object):
elif self.data_type == 'bool':
self.data_type = 'boolean'
elif self.data_type == 'uint64' or self.data_type == 'int64':
self.data_type = 'string'
elif self.data_type == 'int64' or self.data_type == 'uint64':
self.data_type = '[' + self.data_type + ']'
class MethodDoc(object):
@@ -112,7 +114,7 @@ class ClassParser(object):
# An extra optional space (\s?) was thrown in to make it different from `class_body_regex`.
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(\w+) # The data type, a space, and the name of the param.
(?:\s=\s(\w+))? # The default value: a = surrounded by spaces, followed by text.
(?:\s:\s(.+))? # The description: a colon surrounded by spaces, followed by text.
""", re.X)
@@ -183,11 +185,18 @@ class ClassParser(object):
if parameters != '':
parameters = ' ' + parameters + ' '
if self.returned:
return_values = ', '.join([param.name for param in self.returned])
prototype = '{0} = {1}:{2}({3})'.format(return_values, self.class_name, self.method_name, parameters)
if self.class_name == 'Global':
if self.returned:
return_values = ', '.join([param.name for param in self.returned])
prototype = '{0} = {1}({2})'.format(return_values, self.method_name, parameters)
else:
prototype = '{0}({1})'.format(self.method_name, parameters)
else:
prototype = '{0}:{1}({2})'.format(self.class_name, self.method_name, parameters)
if self.returned:
return_values = ', '.join([param.name for param in self.returned])
prototype = '{0} = {1}:{2}({3})'.format(return_values, self.class_name, self.method_name, parameters)
else:
prototype = '{0}:{1}({2})'.format(self.class_name, self.method_name, parameters)
self.prototypes.append(prototype)
else: