mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-12 16:32:10 -05:00
Update cpp domain identifier regex to match destructors
Previously the regex would fail to match c++ destructors, as the presence of a "~" would mean that the "\b" would no longer match the start of a word. Now we try to find the optional "~" first then continue with the word as normal.
This commit is contained in:
1 parent
ffd9268a65
commit
d04182b85c
1 file changed
+1
-1
@@ -23,7 +23,7 @@ from sphinx.util.nodes import make_refnode
|
||||
from sphinx.util.compat import Directive
|
||||
|
||||
|
||||
_identifier_re = re.compile(r'\b(~?[a-zA-Z_][a-zA-Z0-9_]*)\b')
|
||||
_identifier_re = re.compile(r'(~?\b[a-zA-Z_][a-zA-Z0-9_]*)\b')
|
||||
_whitespace_re = re.compile(r'\s+(?u)')
|
||||
_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
|
||||
Reference in new issue
Block a user