sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
http://sphinxcontrib-matlabdomain.readthedocs.io/
Other
70 stars 45 forks source link

Sphinx Crashes when overloading builtin method in a class #72

Closed sehyoun closed 5 years ago

sehyoun commented 6 years ago

When you overload a builtin method, e.g., sin, cos, isnan, in a class, the parser fails with error message


Exception occurred:
  File "/path/lib/python2.7/site-packages/sphinxcontrib/mat_types.py", line 468, in __init__
    'modname: {}, name: {}'.format(modname, name))
TypeError: Object is not a function. Expected a function.modname: some.module.name, name: None

This is because in the MatlabLexer categorizes builtin functions as Token.Name.Builtin. One can fix this error by adding

meth_tk[0] is Token.Name.Builtin or

on line 873 of mat_types.py file.

joeced commented 6 years ago

Thanks for writing this issue. Can you give me an example MATLAB class that does this.

sehyoun commented 6 years ago

Let me try to make a minimal example (but occupied for a little bit right now, so it might take a little while).

joeced commented 5 years ago

I'll close it for now, please open a new issue if you can reproduce the error.