You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ erl -enable-feature maybe_expr
> edoc:get_doc("t.erl").
t.erl: at line 7: syntax error before: '{'
t.erl: If the error is caused by too exotic macro
t.erl: definitions or uses of macros, adding option
t.erl: {preprocess, true} can help. See also edoc(3).
** exception exit: error
in function edoc:'-check_forms/3-fun-0-'/3 (edoc.erl, line 771)
in call from lists:foreach_1/2 (lists.erl, line 1686)
in call from edoc:read_source/2 (edoc.erl, line 640)
in call from edoc_extract:source/3 (edoc_extract.erl, line 60)
Expected behavior
The function call succeeds.
Affected versions
OTP 26.0
Additional context
The root cause is in the epp_dodger module, where the io:scan_erl_form/4 function is invoked with an incorrect reserved_word_fun which does not take into account the feature macros, which are currently discarded by the dodger.
A possible solution could be to introduce some state and update the features accordingly, similarly to how the update_feature/4 function works in the epp module. This could be tricky to do in a backward-compatible way, since most of the epp_dodger parsing functions are exported.
Alternatives could be:
Treat all potential keywords as keywords (would break the opposite case, where the atoms maybe and else
Use the process dictionary
The text was updated successfully, but these errors were encountered:
Summary: In OTP 26, [EDoc is broken](erlang/otp#7266) in presence of the `maybe` operator. This is (partially) fixed in OTP 27. Backport the OTP 27 dodger, so that EDoc can be built for OTP 26 modules.
Reviewed By: TheGeorge
Differential Revision: D57099852
fbshipit-source-id: 9e8935411d2e41c20afc12a4ac11f2706356e86b
Summary: In OTP 26, [EDoc is broken](erlang/otp#7266) in presence of the `maybe` operator. This is (partially) fixed in OTP 27. Backport the OTP 27 dodger, so that EDoc can be built for OTP 26 modules.
Reviewed By: TheGeorge
Differential Revision: D57099852
fbshipit-source-id: 9e8935411d2e41c20afc12a4ac11f2706356e86b
Describe the bug
This is a follow up from #7175, which was partially fixed by #7176.
To Reproduce
Given the following example module (extracted from the OTP 26 highlights post):
The following crashes:
Expected behavior
The function call succeeds.
Affected versions
Additional context
The root cause is in the
epp_dodger
module, where theio:scan_erl_form/4
function is invoked with an incorrectreserved_word_fun
which does not take into account thefeature
macros, which are currently discarded by the dodger.A possible solution could be to introduce some state and update the features accordingly, similarly to how the
update_feature/4
function works in theepp
module. This could be tricky to do in a backward-compatible way, since most of theepp_dodger
parsing functions are exported.Alternatives could be:
maybe
andelse
The text was updated successfully, but these errors were encountered: