Fix the symbols tree hierarchy by considering the whole scope when
adding a tag, avoiding choosing the wrong parent when several tags have
the same name. Until now, to avoid such misbehavior we only used to
choose the parent candidate that appeared last (line-wise) before the
child. It works in most typical situations as generally tag names are
fairly unique, and children appear right after their parent.
However, there are cases that are trickier and cannot be handled that
way. In the following valid C++ snippet, it is impossible to know
whether `function` should be listed under the namespace `A` or the
class `A` without looking at its full scope:
```C++
namespace A {
namespace B {
class A {
void method() {}
};
};
void function() {}
};
```
And it is a real-world problem for some parsers like the JSON parser
that generates numeric indices for array elements name, often leading
to several possibly close duplicates.
Additionally, to prevent trying to set a tag as its own parent, the
code guarded against accepting a parent if the child had the same name,
lading to incorrect hierarchy for `method` in cases like this:
```C++
namespace A {
class A {
void method() {}
};
};
```
So to fix this, consider the whole hierarchy of a tag for choosing its
parent, when that information is available from the parser.
Fixes#1583.
* Update obsolete references to GLib 2.27/28 in HACKING
Fixes#1476.
* Replace obsolete gcc -W option with -Wextra in HACKING
According to gcc --help=warnings, -W is a deprecated option
and -Wextra should be used instead.
Avoid deprecation warnings from GLib and GTK versions newer than what
we currently require by default.
To undo this and get all deprecation warnings back, undefine
`GLIB_VERSION_MIN_REQUIRED` and `GDK_DISABLE_DEPRECATION_WARNINGS` on
the command line (e.g. using `-U...` in `CFLAGS`).
All of these typos were found by codespell, so credits go the
the authors of this incredibly useful tool.
I manually confirmed and adapted all changes, which includes
reflowing over-long lines or filling up with spaces for alignment.
Some of these typos may need forwarding to their original authors.
codespell reported a lot words where I am unsure; I have not
included those corrections.
We assume that the GTK 2.24 API docs will remain online in the long-term
so there is no reason why we should self-host those docs any longer.
This is the last missing bit of #245.
Don't use wildcards to select files to install, nor manually perform
the installation when Automake could do it for us.
Using wildcards makes it hard to know what will really be installed,
and may results in installing files not part of the distribution.
* Add new function: document_update_tags().
* Refactor the various tag update functions into document_update_tags().
* Remove extra call to update the tags in document_new_file().
It was used only in one place in document_update_type_keywords() which
already did a similar check using the file type before calling this function.
Update HACKING file and very minor cleanup of other code in
document_update_type_keywords().