sphinx-contrib / matlabdomain

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

An end of line comment directly at the end of a function declaration causes Sphinx to crash #29

Closed joeced closed 6 years ago

joeced commented 10 years ago

Originally reported by: Anonymous


When trying to document the following class:

#!matlab

classdef ClassWithEndOfLineComment
    methods
        % No spaces between the end of line and the comment causes Sphinx to crash
        function test(this)% This crash
        end

        function test2(this) % This doesn't
        end
    end
end

Sphinx raises the following exception:

Exception occurred:
  File "C:\Appli\Python\2.7\lib\site-packages\sphinxcontrib\mat_types.py", line 470, in __init__
    raise TypeError('Expected a whitespace after input args.')
TypeError: Expected a whitespace after input args.

The complete error log is in the attachments.


joeced commented 6 years ago

Fixed in https://github.com/sphinx-contrib/matlabdomain/commit/235f561ae167292914594b93ff8ae4b9f7b57c7b