Sourceror.get_end_line
You're seeing just the function
get_end_line
, go back to Sourceror module for more information.
Specs
Returns the line where the given node ends. It recursively checks for end
,
closing
and end_of_expression
line numbers. If none is found, the default
value is returned(defaults to 1).
iex> Sourceror.get_end_line({:foo, [end: [line: 4]], []})
4
iex> Sourceror.get_end_line({:foo, [closing: [line: 2]], []})
2
iex> Sourceror.get_end_line({:foo, [end_of_expression: [line: 5]], []})
5
iex> Sourceror.get_end_line({:foo, [closing: [line: 2], end: [line: 4]], []})
4
iex> """
...> alias Foo.{
...> Bar
...> }
...> """ |> Sourceror.parse_string!() |> Sourceror.get_end_line()
3