Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ktn_code for the latest aleppo modifications #112

Closed
jfacorro opened this issue Jan 14, 2016 · 0 comments
Closed

Update ktn_code for the latest aleppo modifications #112

jfacorro opened this issue Jan 14, 2016 · 0 comments
Assignees

Comments

@jfacorro
Copy link

The location can also come as a tuple {Line, Column} now, so we need to update the ktn_code:get_location/1 function.

%% @private
get_location(Attrs) when is_integer(Attrs) ->
    Line = Attrs,
    {Line, 1};
get_location(Attrs) when is_list(Attrs) ->
    Line = proplists:get_value(line, Attrs, undefined),
    Column = proplists:get_value(column, Attrs, undefined),
    case {Line, Column} of
        {undefined, undefined} ->
            proplists:get_value(location, Attrs, {-1, -1});
        _ ->
            {Line, Column}
    end;
get_location(Location = {_Line, _Column}) -> %% This is the added clause
  Location;
get_location(_Attrs) ->
    {-1, -1}.
@jfacorro jfacorro self-assigned this Jan 21, 2016
jfacorro added a commit that referenced this issue Jan 21, 2016
jfacorro added a commit that referenced this issue Jan 21, 2016
jfacorro added a commit that referenced this issue Jan 21, 2016
jfacorro added a commit that referenced this issue Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant