Enhance parser

This commit is contained in:
Rochet2
2014-08-11 00:26:39 +03:00
parent 8e92558eac
commit 70dc13f595
3 changed files with 12 additions and 7 deletions

View File

@@ -62,10 +62,11 @@ namespace LuaWeather
/**
* Regenerates the &Weather, causing it to change based on the below statistics.
* - 30% chance of no change
* - 30% chance of &Weather getting better (if not fine) or changing &Weather type
* - 30% chance of &Weather getting worse (if not fine)
* - 10% chance of radical change (if not fine)
*
* * 30% chance of no change
* * 30% chance of &Weather getting better (if not fine) or changing &Weather type
* * 30% chance of &Weather getting worse (if not fine)
* * 10% chance of radical change (if not fine)
*
* @return bool changed : returns 'true' if &Weather changed
*/

View File

@@ -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)