Skip to content

Can't reference token from other productionlist's if its group name contains hypens #11854

Closed
@skirpichev

Description

@skirpichev

Describe the bug

BTW, this poses problems only references inside of some productionlist directive. Outside of the production list it's possible to use cross-references like :token:`~python-grammar:with_item`.

This affects CPython docs, see python/cpython#108184 for a proposed workaround.

How to Reproduce

$ cat index.rst
.. productionlist:: a-foo
   digit: "0".."9"

.. productionlist:: b
   hexdigit: `a-foo:digit` | "a".."f"

Environment Information

Platform:              linux; (Linux-6.1.0-16-amd64-x86_64-with-glibc2.36)
Python version:        3.11.3+ (heads/3.11:9fbb614c4e, Apr 29 2023, 14:18:05) [GCC 10.2.1 20210110])
Python implementation: CPython
Sphinx version:        7.2.6
Docutils version:      0.18.1
Jinja2 version:        3.1.2
Pygments version:      2.15.1

Sphinx extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions