mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C, C++, fix KeyError due to alias directive
This commit is contained in:
parent
8ec937d4c9
commit
025ec263f9
3
CHANGES
3
CHANGES
@ -24,6 +24,9 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* C, C++, fix ``KeyError`` when an ``alias`` directive is the first C/C++
|
||||||
|
directive in a file with another C/C++ directive later.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -3454,7 +3454,8 @@ class AliasNode(nodes.Element):
|
|||||||
if 'c:parent_symbol' not in env.temp_data:
|
if 'c:parent_symbol' not in env.temp_data:
|
||||||
root = env.domaindata['c']['root_symbol']
|
root = env.domaindata['c']['root_symbol']
|
||||||
env.temp_data['c:parent_symbol'] = root
|
env.temp_data['c:parent_symbol'] = root
|
||||||
self.parentKey = env.temp_data['c:parent_symbol'].get_lookup_key()
|
env.ref_context['c:parent_key'] = root.get_lookup_key()
|
||||||
|
self.parentKey = env.ref_context['c:parent_key']
|
||||||
else:
|
else:
|
||||||
assert parentKey is not None
|
assert parentKey is not None
|
||||||
self.parentKey = parentKey
|
self.parentKey = parentKey
|
||||||
|
@ -7177,7 +7177,8 @@ class AliasNode(nodes.Element):
|
|||||||
if 'cpp:parent_symbol' not in env.temp_data:
|
if 'cpp:parent_symbol' not in env.temp_data:
|
||||||
root = env.domaindata['cpp']['root_symbol']
|
root = env.domaindata['cpp']['root_symbol']
|
||||||
env.temp_data['cpp:parent_symbol'] = root
|
env.temp_data['cpp:parent_symbol'] = root
|
||||||
self.parentKey = env.temp_data['cpp:parent_symbol'].get_lookup_key()
|
env.ref_context['cpp:parent_key'] = root.get_lookup_key()
|
||||||
|
self.parentKey = env.ref_context['cpp:parent_key']
|
||||||
else:
|
else:
|
||||||
assert parentKey is not None
|
assert parentKey is not None
|
||||||
self.parentKey = parentKey
|
self.parentKey = parentKey
|
||||||
|
Loading…
Reference in New Issue
Block a user