Sourceror.parse_expression

You're seeing just the function parse_expression, go back to Sourceror module for more information.
Link to this function

parse_expression(string, opts \\ [])

View Source

Parses a single expression from the given string. It returns the parsed expression and the rest of the string on success.

Examples

iex> ~S"""
...> 42
...>
...> :ok
...> """ |> Sourceror.parse_expression()
{:ok, {:__block__, [trailing_comments: [], leading_comments: [],
                    token: "42", line: 2], [42]}, "\n:ok"}

Options

  • :from_line - The line at where the parsing should start. Defaults to 1.