Expression.Ast (expression v0.3.0)
Parse a string and turn it into an AST which can be evaluated by Expression.Eval
Link to this section Summary
Functions
Parses the given binary
as aexpr.
Parses the given binary
as literal.
Parses the given binary
as parse.
Link to this section Functions
aexpr(binary, opts \\ [])
Specs
aexpr(binary(), keyword()) :: {:ok, [term()], rest, context, line, byte_offset} | {:error, reason, rest, context, line, byte_offset} when line: {pos_integer(), byte_offset}, byte_offset: pos_integer(), rest: binary(), reason: String.t(), context: map()
Parses the given binary
as aexpr.
Returns {:ok, [token], rest, context, position, byte_offset}
or
{:error, reason, rest, context, line, byte_offset}
where position
describes the location of the aexpr (start position) as {line, column_on_line}
.
Options
:byte_offset
- the byte offset for the whole binary, defaults to 0:line
- the line and the byte offset into that line, defaults to{1, byte_offset}
:context
- the initial context value. It will be converted to a map
block__0(rest, acc, stack, context, line, offset)
block__1(rest, acc, stack, context, comb__line, comb__offset)
block__10(rest, user_acc, list, context, line, offset)
block__11(rest, acc, stack, context, line, offset)
block__12(rest, acc, stack, context, comb__line, comb__offset)
block__13(rest, user_acc, list, context, line, offset)
block__14(rest, acc, stack, context, line, offset)
block__2(rest, acc, stack, context, line, offset)
block__3(rest, acc, stack, context, comb__line, comb__offset)
block__4(rest, user_acc, list, context, line, offset)
block__5(rest, acc, stack, context, line, offset)
block__6(rest, acc, stack, context, line, offset)
block__7(rest, acc, stack, context, line, offset)
block__8(rest, acc, stack, context, line, offset)
block__9(rest, acc, stack, context, comb__line, comb__offset)
expression__0(rest, acc, stack, context, line, offset)
expression__1(rest, acc, stack, context, line, offset)
expression__2(rest, acc, stack, context, line, offset)
expression__3(rest, acc, list, context, line, offset)
expression__4(_, _, stack, _, _, _)
expression__5(rest, acc, stack, context, line, offset)
expression__6(rest, acc, list, context, line, offset)
expression__7(_, _, stack, _, _, _)
expression__8(rest, acc, stack, context, line, offset)
expression__9(rest, acc, list, context, line, offset)
fold_infixl(acc)
function__0(rest, acc, stack, context, line, offset)
function__1(rest, acc, stack, context, line, offset)
function__10(rest, user_acc, list, context, line, offset)
function__11(rest, acc, stack, context, line, offset)
function__12(rest, user_acc, list, context, line, offset)
function__13(rest, user_acc, list, context, line, offset)
function__14(rest, acc, stack, context, comb__line, comb__offset)
function__15(rest, acc, stack, context, line, offset)
function__16(rest, acc, stack, context, comb__line, comb__offset)
function__17(rest, acc, list, context, line, offset)
function__18(_, _, stack, _, _, _)
function__19(rest, acc, stack, context, line, offset)
function__2(rest, acc, stack, context, line, offset)
function__20(rest, acc, stack, context, comb__line, comb__offset)
function__21(rest, user_acc, list, context, line, offset)
function__22(rest, acc, stack, context, line, offset)
function__23(rest, acc, stack, context, line, offset)
function__24(rest, acc, stack, context, line, offset)
function__25(rest, acc, list, context, line, offset)
function__26(rest, user_acc, list, context, line, offset)
function__27(rest, acc, stack, context, line, offset)
function__3(rest, acc, stack, context, line, offset)
function__4(rest, acc, stack, context, comb__line, comb__offset)
function__5(rest, acc, stack, context, comb__line, comb__offset)
function__6(rest, user_acc, list, context, line, offset)
function__7(rest, acc, stack, context, line, offset)
function__8(rest, acc, stack, context, line, offset)
function__9(rest, acc, stack, context, comb__line, comb__offset)
function_arguments__0(rest, acc, stack, context, line, offset)
function_arguments__1(rest, acc, stack, context, line, offset)
function_arguments__10(rest, acc, list, context, line, offset)
function_arguments__11(_, _, stack, _, _, _)
function_arguments__12(rest, acc, stack, context, line, offset)
function_arguments__13(rest, acc, list, context, line, offset)
function_arguments__14(_, _, list, _, _, _)
function_arguments__15(rest, acc, stack, context, line, offset)
function_arguments__16(rest, acc, stack, context, comb__line, comb__offset)
function_arguments__17(rest, user_acc, list, context, line, offset)
function_arguments__18(rest, acc, stack, context, line, offset)
function_arguments__19(rest, acc, stack, context, comb__line, comb__offset)
function_arguments__2(rest, acc, stack, context, line, offset)
function_arguments__20(rest, acc, stack, context, line, offset)
function_arguments__21(rest, acc, stack, context, comb__line, comb__offset)
function_arguments__22(rest, user_acc, list, context, line, offset)
function_arguments__23(rest, acc, stack, context, line, offset)
function_arguments__24(rest, acc, stack, context, line, offset)
function_arguments__25(inner_rest, inner_acc, list, inner_context, inner_line, inner_offset)
function_arguments__26(rest, acc, stack, context, line, offset)
function_arguments__27(rest, acc, list, context, line, offset)
function_arguments__28(_, _, stack, _, _, _)
function_arguments__29(rest, acc, stack, context, line, offset)
function_arguments__3(rest, acc, stack, context, line, offset)
function_arguments__30(rest, acc, list, context, line, offset)
function_arguments__31(_, _, stack, _, _, _)
function_arguments__32(rest, acc, stack, context, line, offset)
function_arguments__33(rest, acc, list, context, line, offset)
function_arguments__34(_, _, stack, _, _, _)
function_arguments__35(rest, acc, stack, context, line, offset)
function_arguments__36(rest, acc, list, context, line, offset)
function_arguments__37(rest, user_acc, list, context, line, offset)
function_arguments__38(rest, acc, stack, context, line, offset)
function_arguments__4(rest, acc, list, context, line, offset)
function_arguments__5(_, _, stack, _, _, _)
function_arguments__6(rest, acc, stack, context, line, offset)
function_arguments__7(rest, acc, list, context, line, offset)
function_arguments__8(_, _, stack, _, _, _)
function_arguments__9(rest, acc, stack, context, line, offset)
literal(binary, opts \\ [])
Specs
literal(binary(), keyword()) :: {:ok, [term()], rest, context, line, byte_offset} | {:error, reason, rest, context, line, byte_offset} when line: {pos_integer(), byte_offset}, byte_offset: pos_integer(), rest: binary(), reason: String.t(), context: map()
Parses the given binary
as literal.
Returns {:ok, [token], rest, context, position, byte_offset}
or
{:error, reason, rest, context, line, byte_offset}
where position
describes the location of the literal (start position) as {line, column_on_line}
.
Options
:byte_offset
- the byte offset for the whole binary, defaults to 0:line
- the line and the byte offset into that line, defaults to{1, byte_offset}
:context
- the initial context value. It will be converted to a map
parse(binary, opts \\ [])
Specs
parse(binary(), keyword()) :: {:ok, [term()], rest, context, line, byte_offset} | {:error, reason, rest, context, line, byte_offset} when line: {pos_integer(), byte_offset}, byte_offset: pos_integer(), rest: binary(), reason: String.t(), context: map()
Parses the given binary
as parse.
Returns {:ok, [token], rest, context, position, byte_offset}
or
{:error, reason, rest, context, line, byte_offset}
where position
describes the location of the parse (start position) as {line, column_on_line}
.
Options
:byte_offset
- the byte offset for the whole binary, defaults to 0:line
- the line and the byte offset into that line, defaults to{1, byte_offset}
:context
- the initial context value. It will be converted to a map