diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2020-06-06 02:13:38 +0200 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2020-07-12 04:10:40 +0200 |
commit | b8c92fddbfbadc910ef0c0c6c65bd5648b8e86ca (patch) | |
tree | 24fb56f6eed5696ef96473d2debce108b422fb5f /giscanner/girparser.py | |
parent | e7c17469ef3eb1c3a1c4c717800c277ee231405c (diff) | |
download | gobject-introspection-b8c92fddbfbadc910ef0c0c6c65bd5648b8e86ca.tar.gz |
Add the notion of standalone doc sections.
Up to now, section annotations had to match a class or interface
name in order to be serialized in the gir.
With this commit, they now get serialized as docsection nodes,
for potential use by documentation tools.
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r-- | giscanner/girparser.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 35206a41..d229b164 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -138,6 +138,7 @@ class GIRParser(object): _corens('interface'): self._parse_object_interface, _corens('record'): self._parse_record, _corens('union'): self._parse_union, + _corens('docsection'): self._parse_doc_section, _glibns('boxed'): self._parse_boxed} if not self._types_only: @@ -150,6 +151,11 @@ class GIRParser(object): if method is not None: method(node) + def _parse_doc_section(self, node): + docsection = ast.DocSection(node.attrib["name"]) + self._parse_generic_attribs(node, docsection) + self._namespace.append(docsection) + def _parse_include(self, node): include = ast.Include(node.attrib['name'], node.attrib['version']) self._includes.add(include) |