Skip to content

Commit

Permalink
Fixes #235
Browse files Browse the repository at this point in the history
Complex default values are now parsed correctly
  • Loading branch information
Foereaper committed Oct 2, 2024
1 parent 21c0b24 commit d68cd87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/ElunaDoc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,20 @@ class ClassParser(object):
table_columns_regex = re.compile(r"\s*\*\s@columns\s*\[(.+)\]")
table_values_regex = re.compile(r"\s*\*\s@values\s*\[(.+)\]")

param_regex = re.compile(r"""\s*\*\s@param\s # The @param tag starts with opt. whitespace followed by "* @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.
param_regex = re.compile(r"""\s*\*\s@param\s # The @param tag starts with opt. whitespace followed by "* @param ".
([^\s]+)\s(\w+)? # The data type, a space, and the name of the param.
(?:\s=\s([^\s:]+))? # The default value: a space, =, and a value that can include periods but stops at whitespace or a colon.
(?:\s:\s(.+))? # The description: a colon surrounded by spaces, followed by text.
""", re.X)
# This is the same as the @param tag, minus the default value part.
return_regex = re.compile(r"""\s*\*\s@return\s
([\[\]\w]+)\s(\w+)
(?:\s:\s(.+))?
""", re.X)
proto_regex = re.compile(r"""\s*\*\s@proto\s
([\w\s,]+)? # The list of arguments.
(?:=\s)? # An equals sign and a space separate the args and returns.
(?:\(([\w\s,]+)\))? # The list of return values, in parens.
([\w\s,]+)? # The list of arguments.
(?:=\s)? # An equals sign and a space separate the args and returns.
(?:\(([\w\s,]+)\))? # The list of return values, in parens.
""", re.X)

comment_end_regex = re.compile(r"\s*\*/") # The end of the comment portion, i.e. */
Expand Down

0 comments on commit d68cd87

Please sign in to comment.