breathe-doc / breathe

ReStructuredText and Sphinx bridge to Doxygen
https://breathe-doc.org
Other
752 stars 199 forks source link

Error parsing default member value #453

Open pitrou opened 5 years ago

pitrou commented 5 years ago

I have the following struct member:

struct ParseOptions {
  /// Escaping character (if `escaping` is true)
  char escape_char = '\\';
};

which when parsed and rendered by breathe / Sphinx gives the following error:

/home/antoine/arrow/dev/docs/source/cpp/api/formats.rst:28: WARNING: Parsing of expression failed. Using fallback parser. Error was:
Error in postfix expression, expected primary expression or type.
If primary expression:
  Invalid definition: Expected identifier in nested name. [error at 45]
    char arrow::csv::ParseOptions::escape_char = '\'
    ---------------------------------------------^
If type:
  Invalid definition: Expected identifier in nested name. [error at 45]
    char arrow::csv::ParseOptions::escape_char = '\'
    ---------------------------------------------^
pitrou commented 5 years ago

Amusingly, the HTML is still emitted correctly.

jakobandersen commented 5 years ago

I'm almost certain this is due to the same problem as in sphinx-doc/sphinx#6462. It is however nice to hear that the parser fallback works as intended. (If the expression is more complex you can potentially have identifiers that will not be hyperlinked due to the fallback.)

jakobandersen commented 4 years ago

This should be fixed in Sphinx 3.