mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added support for strings with commas in template definitions.
This commit is contained in:
parent
48ca7f47f9
commit
9325a16c6f
@ -29,7 +29,7 @@ _string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
_visibility_re = re.compile(r'\b(public|private|protected)\b')
|
||||
_array_def_re = re.compile(r'\[\s*(.+?)?\s*\]')
|
||||
_template_arg_re = re.compile(r'[^,>]+')
|
||||
_template_arg_re = re.compile(r'(%s)|([^,>]+)' % _string_re.pattern, re.S)
|
||||
_operator_re = re.compile(r'''(?x)
|
||||
\[\s*\]
|
||||
| \(\s*\)
|
||||
|
@ -28,6 +28,9 @@ def test_type_definitions():
|
||||
x = 'void operator()(const boost::array<VertexID, 2>& v) const'
|
||||
assert unicode(parse('function', x)) == x
|
||||
|
||||
x = 'void operator()(const boost::array<VertexID, 2, "foo, bar">& v) const'
|
||||
assert unicode(parse('function', x)) == x
|
||||
|
||||
rv = parse('member_object', 'const std::vector< unsigned int, long> &name')
|
||||
assert unicode(rv) == 'const std::vector<unsigned int, long>& name'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user