diff options
author | Lukas Larsson <[email protected]> | 2012-08-22 18:14:58 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-08-22 18:14:58 +0200 |
commit | 49bd35c419ab2d8c0e91c14748d3201b401576fd (patch) | |
tree | b8a042122e80ec230e1b638fc65b66a314786080 /lib/stdlib/src | |
parent | 17a65ee1d0aaedc0d52b4d3ba97f64f7ec7fcfa4 (diff) | |
parent | 0994710c308990a04ca1245c894e4e373e55bcec (diff) | |
download | otp-49bd35c419ab2d8c0e91c14748d3201b401576fd.tar.gz otp-49bd35c419ab2d8c0e91c14748d3201b401576fd.tar.bz2 otp-49bd35c419ab2d8c0e91c14748d3201b401576fd.zip |
Merge branch 'maint'
* maint:
Revert "Merge branch 'nox/compile-column-numbers' into maint"
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/epp.erl | 44 | ||||
-rw-r--r-- | lib/stdlib/src/erl_scan.erl | 2 |
2 files changed, 10 insertions, 36 deletions
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl index d958b0af2a..ccc14610d7 100644 --- a/lib/stdlib/src/epp.erl +++ b/lib/stdlib/src/epp.erl @@ -20,9 +20,9 @@ %% An Erlang code preprocessor. --export([open/2,open/3,open/4, open/5,close/1,format_error/1]). +-export([open/2,open/3,open/5,close/1,format_error/1]). -export([scan_erl_form/1,parse_erl_form/1,macro_defs/1]). --export([parse_file/1, parse_file/3, parse_file/4]). +-export([parse_file/1, parse_file/3]). -export([interpret_file_attribute/1]). -export([normalize_typed_record_fields/1,restore_typed_record_fields/1]). @@ -54,14 +54,12 @@ %% open(FileName, IncludePath) %% open(FileName, IncludePath, PreDefMacros) -%% open(FileName, StartLocation, IncludePath, PredefMacros) %% open(FileName, IoDevice, StartLocation, IncludePath, PreDefMacros) %% close(Epp) %% scan_erl_form(Epp) %% parse_erl_form(Epp) %% parse_file(Epp) %% parse_file(FileName, IncludePath, PreDefMacros) -%% parse_file(FileName, StartLocation, IncludePath, PreDefMacros) %% macro_defs(Epp) -spec open(FileName, IncludePath) -> @@ -83,20 +81,8 @@ open(Name, Path) -> ErrorDescriptor :: term(). open(Name, Path, Pdm) -> - open(Name, 1, Path, Pdm). - --spec open(FileName, StartLocation, IncludePath, PredefMacros) -> - {'ok', Epp} | {'error', ErrorDescriptor} when - FileName :: file:name(), - StartLocation :: erl_scan:location(), - IncludePath :: [DirectoryName :: file:name()], - PredefMacros :: macros(), - Epp :: epp_handle(), - ErrorDescriptor :: term(). - -open(Name, StartLocation, Path, Pdm) -> Self = self(), - Epp = spawn(fun() -> server(Self, Name, StartLocation, Path, Pdm) end), + Epp = spawn(fun() -> server(Self, Name, Path, Pdm) end), epp_request(Epp). open(Name, File, StartLocation, Path, Pdm) -> @@ -192,21 +178,7 @@ format_error(E) -> file:format_error(E). OpenError :: file:posix() | badarg | system_limit. parse_file(Ifile, Path, Predefs) -> - parse_file(Ifile, 1, Path, Predefs). - --spec parse_file(FileName, StartLocation, IncludePath, PredefMacros) -> - {'ok', [Form]} | {error, OpenError} when - FileName :: file:name(), - StartLocation :: erl_scan:location(), - IncludePath :: [DirectoryName :: file:name()], - Form :: erl_parse:abstract_form() | {'error', ErrorInfo} | {'eof',Line}, - PredefMacros :: macros(), - Line :: erl_scan:line(), - ErrorInfo :: erl_scan:error_info() | erl_parse:error_info(), - OpenError :: file:posix() | badarg | system_limit. - -parse_file(Ifile, StartLocation, Path, Predefs) -> - case open(Ifile, StartLocation, Path, Predefs) of + case open(Ifile, Path, Predefs) of {ok,Epp} -> Forms = parse_file(Epp), close(Epp), @@ -273,12 +245,14 @@ restore_typed_record_fields([{attribute,La,type,{{record,Record},Fields,[]}}| restore_typed_record_fields([Form|Forms]) -> [Form|restore_typed_record_fields(Forms)]. -%% server(StarterPid, FileName, Location, Path, PreDefMacros) -server(Pid, Name, AtLocation, Path, Pdm) -> +%% server(StarterPid, FileName, Path, PreDefMacros) + +server(Pid, Name, Path, Pdm) -> process_flag(trap_exit, true), case file:open(Name, [read]) of {ok,File} -> - init_server(Pid, Name, File, AtLocation, Path, Pdm, false); + Location = 1, + init_server(Pid, Name, File, Location, Path, Pdm, false); {error,E} -> epp_reply(Pid, {error,E}) end. diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl index be64b428b1..10b2ed2e49 100644 --- a/lib/stdlib/src/erl_scan.erl +++ b/lib/stdlib/src/erl_scan.erl @@ -55,7 +55,7 @@ token_info/1,token_info/2, attributes_info/1,attributes_info/2,set_attribute/3]). --export_type([error_info/0, line/0, location/0, tokens_result/0]). +-export_type([error_info/0, line/0, tokens_result/0]). %%% %%% Defines and type definitions |