Edoc crash when using macro with function

View: New views
3 Messages — Rating Filter:   Alert me  

Edoc crash when using macro with function

by Adam Lindberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

Running edoc:file/1 on test.erl with this content will result in a crash in edoc:

-module(test).

-export([f/0]).

-define(FUNC, f() -> ok).

?FUNC.



Seems edoc in R13B02 can't handle the macro on line 7.

1> edoc:file("test.erl"). test.erl: at line 7: syntax error before: '.'
** exception exit: error
     in function  edoc:'-check_forms/2-fun-0-'/2
     in call from lists:foreach/2
     in call from edoc:read_source/2
     in call from edoc_extract:source/3
     in call from edoc:read/2
     in call from edoc:file/2

Cheers,
Adam

________________________________________________________________
erlang-bugs mailing list. See http://www.erlang.org/faq.html
erlang-bugs (at) erlang.org


Parent Message unknown Re: Edoc crash when using macro with function

by Adam Lindberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, didn't make that connection with the documentation at all.

Follow up question: Is it possible to make edoc just skip those files? Right now it says that is is skipping them, but exits with an error anyway. I'd like it to generate the documentation for the modules that do work. Is that possible?

Cheers,
Adam

----- "Richard Carlsson" <carlsson.richard@...> wrote:

> Adam Lindberg wrote:
> > Running edoc:file/1 on test.erl with this content will result in a
> crash in edoc:
> >
> > -module(test).
> >
> > -export([f/0]).
> >
> > -define(FUNC, f() -> ok).
> >
> > ?FUNC.
> >
> >
> > Seems edoc in R13B02 can't handle the macro on line 7.
>
> That's not a bug, it's a feature. :-)
>
> If you want to run edoc on files that contain too weird macros,
> you need to give it the 'preprocess' flag, and possibly specify
> include paths as well; see the docs for eunit.erl for details.
>
>     /Richard

________________________________________________________________
erlang-bugs mailing list. See http://www.erlang.org/faq.html
erlang-bugs (at) erlang.org


Parent Message unknown Re: Edoc crash when using macro with function

by Adam Lindberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, it does. I am however running it in an eval argument to erl, so it crashes the whole node and produces a core dump. Not so nice.

Cheers,
Adam

----- "Richard Carlsson" <carlsson.richard@...> wrote:

> Adam Lindberg wrote:
> > Thanks, didn't make that connection with the documentation at all.
> >
> > Follow up question: Is it possible to make edoc just skip those
> > files? Right now it says that is is skipping them, but exits with
> an
> > error anyway. I'd like it to generate the documentation for the
> > modules that do work. Is that possible?
>
> But it does generate them, right? Apart from the error status
> at the end, I mean?
>
>    /Richard

________________________________________________________________
erlang-bugs mailing list. See http://www.erlang.org/faq.html
erlang-bugs (at) erlang.org