summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2022-02-22 17:00:17 +0100
committerBadlop <badlop@process-one.net>2022-02-24 01:02:51 +0100
commit231dfd776f4ce1777e63aa319d89d573449224b8 (patch)
tree38f2240a37de7f279543dbb0291f8ff24c19f144 /tools
parentAdd link in mod_http_api documentation to the docs API section (diff)
Support Erlang 25 in "make options": returns attribute with simpler syntax
This was introduced in Erlang/OTP 25.0-rc1 https://erlang.org/download/otp_src_25.0-rc1.readme https://github.com/erlang/otp/pull/5509 OTP-17894 Application(s): syntax_tools Related Id(s): PR-5509 The erl_syntax_lib:analyze_attribute/1 function would return {Name, {Name, Value}} instead of {Name, Value} (which is the documented return value).
Diffstat (limited to 'tools')
-rwxr-xr-xtools/opt_types.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/opt_types.sh b/tools/opt_types.sh
index 8de6d894..92cd943d 100755
--- a/tools/opt_types.sh
+++ b/tools/opt_types.sh
@@ -524,6 +524,8 @@ fold_opt(File, Fun, Acc, AbsCode) ->
Fun(File, {#state.defaults, Form}, Acc1);
{attribute, {spec, {spec, {{options, 0}, Spec}}}} ->
Fun(File, {#state.specs, hd(Spec)}, Acc1);
+ {attribute, {spec, {{options, 0}, Spec}}} ->
+ Fun(File, {#state.specs, hd(Spec)}, Acc1);
_ ->
Acc1
end
@@ -539,6 +541,8 @@ fold_mod_opt(File, Fun, Acc, AbsCode) ->
Fun(File, {#state.mod_defaults, Form}, Acc1);
{attribute, {spec, {spec, {{mod_options, 1}, Spec}}}} ->
Fun(File, {#state.mod_specs, hd(Spec)}, Acc1);
+ {attribute, {spec, {{mod_options, 1}, Spec}}} ->
+ Fun(File, {#state.mod_specs, hd(Spec)}, Acc1);
_ ->
Acc1
end
@@ -572,6 +576,8 @@ is_behaviour(AbsCode, Mod) ->
{attribute, {Attr, {_, Mod}}}
when Attr == behaviour orelse Attr == behavior ->
true;
+ {attribute, {behaviour, Mod}} ->
+ true;
_ ->
false
end