Skip to content

Commit

Permalink
#189 catch all preprocessor erros
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bik committed Apr 18, 2018
1 parent dcae8bd commit 70bb24b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/imem_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ compile_mod(ModuleCodeBinStr, Restrict, Opts) when is_binary(ModuleCodeBinStr) -
tokenize(ModuleCodeBinStr) ->
case erl_scan:string(binary_to_list(ModuleCodeBinStr), {0,1}) of
{ok, RawTokens, _} ->
case aleppo:process_tokens(RawTokens) of
case catch aleppo:process_tokens(RawTokens) of
{ok, TokensEOF} ->
[{eof,_} | RevTokens] = lists:reverse(TokensEOF),
Tokens = lists:reverse(RevTokens),
{ok, cut_dot(Tokens)};
{error, Error} ->
{error, {preprocess, {{0, 1}, ?MODULE, Error}, {0, 1}}};
{'EXIT', Error} ->
{error, {preprocess, {{0, 1}, ?MODULE, Error}, {0, 1}}}
end;
{error, ErrorInfo, ErrorLocation} ->
Expand Down

0 comments on commit 70bb24b

Please sign in to comment.