diff options
author | John Högberg <[email protected]> | 2018-10-08 07:50:11 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-10-08 07:50:11 +0200 |
commit | 4312fba6cf15a41b7331c2309104dd82f29be9d6 (patch) | |
tree | 961f90539cace5eabd1ab129165497934caec3d8 /lib/compiler/src | |
parent | 0cb5456831a99e21f11e7331b4e2c56849827944 (diff) | |
parent | 3a34f37fbc5af8eca7a70f5dab61dca7ee1706b0 (diff) | |
download | otp-4312fba6cf15a41b7331c2309104dd82f29be9d6.tar.gz otp-4312fba6cf15a41b7331c2309104dd82f29be9d6.tar.bz2 otp-4312fba6cf15a41b7331c2309104dd82f29be9d6.zip |
Merge branch 'john/compiler/deterministic-paths/OTP-15245/ERL-706' into maint
* john/compiler/deterministic-paths/OTP-15245/ERL-706:
compiler: Forward +source flag to epp and fix bug in +deterministic
epp: Allow user to set source name independently of input file name
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/compile.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 562d57a6ef..6510571441 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -931,11 +931,17 @@ parse_module(_Code, St0) -> end. do_parse_module(DefEncoding, #compile{ifile=File,options=Opts,dir=Dir}=St) -> + SourceName0 = proplists:get_value(source, Opts, File), + SourceName = case member(deterministic, Opts) of + true -> filename:basename(SourceName0); + false -> SourceName0 + end, R = epp:parse_file(File, - [{includes,[".",Dir|inc_paths(Opts)]}, - {macros,pre_defs(Opts)}, - {default_encoding,DefEncoding}, - extra]), + [{includes,[".",Dir|inc_paths(Opts)]}, + {source_name, SourceName}, + {macros,pre_defs(Opts)}, + {default_encoding,DefEncoding}, + extra]), case R of {ok,Forms,Extra} -> Encoding = proplists:get_value(encoding, Extra), |