elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Can't create docs for v0.13 using v0.13 ExDoc

Open pminten opened this issue 12 years ago • 2 comments

Trying to run make docs in the elixir repository using the v0.13 branch of ExDoc errors out:

bin/elixir ../ex_doc/bin/ex_doc "Elixir" "0.13.0-dev" "./ebin" -m Kernel -u "https://github.com/elixir-lang/elixir" --source-ref "59ca4728d1e0cb25abf10d67c14c755b23dd2da2\c"
** (MatchError) no match of right hand side value: {:map, [], nil}
    (elixir) lib/macro.ex:343: Macro.to_string/2
    /home/peter/git/ex_doc/lib/ex_doc/html_formatter/templates/summary_template.eex:2: ExDoc.HTMLFormatter.Templates.summary_template/1
    /home/peter/git/ex_doc/lib/ex_doc/html_formatter/templates/module_template.eex:81: ExDoc.HTMLFormatter.Templates."-module_template/9-lc$^1/1-1-"/1
    /home/peter/git/ex_doc/lib/ex_doc/html_formatter/templates/module_template.eex:81: ExDoc.HTMLFormatter.Templates.module_template/9
    lib/ex_doc/html_formatter.ex:109: ExDoc.HTMLFormatter.generate_module_page/4
    (elixir) lib/enum.ex:517: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:517: Enum.each/2
    lib/ex_doc/html_formatter.ex:103: ExDoc.HTMLFormatter.generate_list/5

It seems like a weird AST node named :map is passed. This is the function node that caused the problems when passed to ExDoc.HtmlFormatter.Templates.signature:

ExDoc.FunctionNode[id: "%/2", name: :%, arity: 2, doc: "<omitted for brevity>",
source: "<omitted for brevity>", type: :defmacro,
signature: [{:struct, [], nil}, {:map, [], nil}], specs: []]

The map seems to be an argument from the % "definition" in kernel/special_forms.ex: defmacro unquote(:%)(struct, map).

pminten avatar Mar 01 '14 15:03 pminten

It seems this would be the fix?

josevalim avatar Mar 01 '14 15:03 josevalim

Yup, that does the trick. Should have looked at ExDoc tickets first I guess.

pminten avatar Mar 01 '14 15:03 pminten