diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-04-24 17:43:10 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-04-24 17:50:20 +0200 |
commit | d567c15aed0a51d939c76305fdf56cc3732bbef3 (patch) | |
tree | df18ee2c9ac5d72a329f89af83d4d5820d6f45a0 /doc/tools | |
parent | 58cbec8db324d60f6367e7ed99c9036abc162203 (diff) |
doc: Fix parsing typed arrays in makerst.py
`Type[]` typed arrays will link to `Type`, as it's likely the most
interesting information for the user.
And sync classref with current source.
Diffstat (limited to 'doc/tools')
-rwxr-xr-x | doc/tools/makerst.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index c6c6cae6c0..5ceab52523 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -973,11 +973,14 @@ def format_table(f, data, remove_empty_columns=False): # type: (TextIO, Iterabl f.write("\n") -def make_type(t, state): # type: (str, State) -> str - if t in state.classes: - return ":ref:`{0}<class_{0}>`".format(t) - print_error("Unresolved type '{}', file: {}".format(t, state.current_class), state) - return t +def make_type(klass, state): # type: (str, State) -> str + link_type = klass + if link_type.endswith("[]"): # Typed array, strip [] to link to contained type. + link_type = link_type[:-2] + if link_type in state.classes: + return ":ref:`{}<class_{}>`".format(klass, link_type) + print_error("Unresolved type '{}', file: {}".format(klass, state.current_class), state) + return klass def make_enum(t, state): # type: (str, State) -> str |