mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
Here's the weird bit. QAPIDoc generally expects -- virtually everywhere -- that it will always have a current section. The sole exception to this is in the case that end_comment() is called, which leaves us with *no* section. However, in this case, we also don't expect to actually ever mutate the comment contents ever again. NullSection is just a Null-object that allows us to maintain the invariant that we *always* have a current section, enforced by static typing -- allowing us to type that field as QAPIDoc.Section instead of the more ambiguous Optional[QAPIDoc.Section]. end_section is renamed to switch_section and now accepts as an argument the new section to activate, clarifying that no callers ever just unilaterally end a section; they only do so when starting a new section. Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210930205716.1148693-8-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> |
||
|---|---|---|
| .. | ||
| .flake8 | ||
| .isort.cfg | ||
| __init__.py | ||
| commands.py | ||
| common.py | ||
| error.py | ||
| events.py | ||
| expr.py | ||
| gen.py | ||
| introspect.py | ||
| main.py | ||
| mypy.ini | ||
| parser.py | ||
| pylintrc | ||
| schema.py | ||
| source.py | ||
| types.py | ||
| visit.py | ||