diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2020-11-29 08:07:57 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2020-11-29 19:45:36 +0530 |
commit | d0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea (patch) | |
tree | e2798248857411a781ac192cb847baed59ceb9f2 /modules/gdscript/gdscript_analyzer.cpp | |
parent | ef2d1f6d19f861f0f4d9cf7c581795bc7f4016d8 (diff) | |
download | redot-engine-d0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea.tar.gz |
Documentation generation for GDScript
- ClassDoc added to GDScript and property reflection data were extracted
from parse tree
- GDScript comments are collected from tokenizer for documentation and
applied to the ClassDoc by the GDScript compiler
- private docs were excluded (name with underscore prefix and doesn't
have any doc comments)
- default values (of non exported vars), arguments are extraced from the
parser
- Integrated with GDScript 2.0 and new enums were added.
- merge conflicts fixed
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 3f2fdc04a5..fcbab9e3a1 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -860,7 +860,12 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode * parser->push_warning(p_function->parameters[i]->identifier, GDScriptWarning::UNUSED_PARAMETER, p_function->identifier->name, p_function->parameters[i]->identifier->name); } is_shadowing(p_function->parameters[i]->identifier, "function parameter"); -#endif +#endif // DEBUG_ENABLED +#ifdef TOOLS_ENABLED + if (p_function->parameters[i]->default_value && p_function->parameters[i]->default_value->is_constant) { + p_function->default_arg_values.push_back(p_function->parameters[i]->default_value->reduced_value); + } +#endif // TOOLS_ENABLED } if (p_function->identifier->name == "_init") { |