diff options
| author | Rémi Verschelde | 2016-05-03 19:34:38 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2016-05-03 19:34:38 +0200 |
| commit | e2e2c0a39fad3ab501a3409a989a6496f6116df9 (patch) | |
| tree | 6749a81ba1754caea5dd39d7aa80ca97d4f7fec1 /tools/doc/doc_data.cpp | |
| parent | e0d27c55237d4f61910b1e72b744fc043e9b6bff (diff) | |
| parent | 57d0b784266f02c8f021d09f4f0bab911d894207 (diff) | |
| download | godot-e2e2c0a39fad3ab501a3409a989a6496f6116df9.tar.gz godot-e2e2c0a39fad3ab501a3409a989a6496f6116df9.tar.zst godot-e2e2c0a39fad3ab501a3409a989a6496f6116df9.zip | |
Merge pull request #4533 from djrm/doc_data_merge_fix
Fixed documentation generator for polymorphic functions
Diffstat (limited to 'tools/doc/doc_data.cpp')
| -rw-r--r-- | tools/doc/doc_data.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 2d0d7617c..4232a6480 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -61,6 +61,26 @@ void DocData::merge_from(const DocData& p_data) { continue; if (cf.methods[j].arguments.size()!=m.arguments.size()) continue; + // since polymorphic functions are allowed we need to check the type of + // the arguments so we make sure they are different. + int arg_count = cf.methods[j].arguments.size(); + bool arg_used[arg_count]; + for (int l = 0; l < arg_count; ++l) arg_used[l] = false; + // also there is no guarantee that argument ordering will match, so we + // have to check one by one so we make sure we have an exact match + for (int k = 0; k < arg_count; ++k) { + for (int l = 0; l < arg_count; ++l) + if (cf.methods[j].arguments[k].type == m.arguments[l].type && !arg_used[l]) { + arg_used[l] = true; + break; + } + } + bool not_the_same = false; + for (int l = 0; l < arg_count; ++l) + if (!arg_used[l]) // at least one of the arguments was different + not_the_same = true; + if (not_the_same) + continue; const MethodDoc &mf = cf.methods[j]; |
