aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-06-30 10:27:45 +0200
committerBjörn Gustavsson <[email protected]>2016-06-30 10:27:45 +0200
commitc2157dc06a8c997c207dd82cd6fa11dbcb508f11 (patch)
treef43c21977cd0f1f31d69748149523e2bccba4e8d /lib/compiler
parentb67da3610ace6d4e998bdfb458343165e205fae8 (diff)
parent9aabc64783ee1a1fbcd5b80ea03f9ef12807cb92 (diff)
downloadotp-c2157dc06a8c997c207dd82cd6fa11dbcb508f11.tar.gz
otp-c2157dc06a8c997c207dd82cd6fa11dbcb508f11.tar.bz2
otp-c2157dc06a8c997c207dd82cd6fa11dbcb508f11.zip
Merge branch 'aronisstav/compiler/fix-compile-forms-spec/PR-1109' into maint
* aronisstav/compiler/fix-compile-forms-spec/PR-1109: Fix spec of compile:(noenv_)forms/2
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/compile.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index e2eff2a89b..e951a25e04 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -43,6 +43,10 @@
-type abstract_code() :: [erl_parse:abstract_form()].
+%% Internal representations used for 'from_asm' and 'from_beam' compilation can
+%% also be valid, but have no relevant types defined.
+-type forms() :: abstract_code() | cerl:c_module().
+
-type option() :: atom() | {atom(), term()} | {'d', atom(), term()}.
-type err_info() :: {erl_anno:line() | 'none',
@@ -88,7 +92,7 @@ file(File, Opt) ->
forms(Forms) -> forms(Forms, ?DEFAULT_OPTIONS).
--spec forms(abstract_code(), [option()] | option()) -> comp_ret().
+-spec forms(forms(), [option()] | option()) -> comp_ret().
forms(Forms, Opts) when is_list(Opts) ->
do_compile({forms,Forms}, [binary|Opts++env_default_opts()]);
@@ -116,7 +120,7 @@ noenv_file(File, Opts) when is_list(Opts) ->
noenv_file(File, Opt) ->
noenv_file(File, [Opt|?DEFAULT_OPTIONS]).
--spec noenv_forms(abstract_code(), [option()] | option()) -> comp_ret().
+-spec noenv_forms(forms(), [option()] | option()) -> comp_ret().
noenv_forms(Forms, Opts) when is_list(Opts) ->
do_compile({forms,Forms}, [binary|Opts]);