Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Use erl_scan:line/1 if present
COUCHDB-3058
  • Loading branch information
rnewson committed Jul 14, 2016
1 parent 5a7f286 commit f6ad55d804ac741b59fe37dd092787113847661c
Showing 1 changed file with 10 additions and 1 deletion.
@@ -66,6 +66,15 @@ fixup_terminator(Tokens) ->
{dot, _} -> Tokens;
{';', _} -> Tokens;
Token ->
{line, Line} = erl_scan:token_info(Token, line),
Line = line(Token),
Tokens ++ [{dot, Line}]
end.

line(Token) ->
case erlang:function_exported(erl_scan, line, 1) of
true ->
erl_scan:line(Token);
false ->
{line, Line} = erl_scan:token_info(Token, line),
Line
end.

0 comments on commit f6ad55d

Please sign in to comment.