JustBash.Commands.Jq.Parser (JustBash v0.4.0)

View Source

Parser for jq filter expressions.

Converts jq filter strings into an AST for evaluation.

Summary

Functions

Parse a jq filter string into an AST.

Types

ast()

@type ast() ::
  :identity
  | :empty
  | {:field, String.t()}
  | {:index, integer()}
  | {:slice, integer() | nil, integer() | nil}
  | :iterate
  | {:optional, ast()}
  | {:pipe, ast(), ast()}
  | {:comma, [ast()]}
  | {:literal, any()}
  | {:array, [ast()]}
  | {:object, [{ast(), ast()}]}
  | {:func, atom(), [ast()]}
  | {:comparison, atom(), ast(), ast()}
  | {:boolean, atom(), ast(), ast()}
  | {:not, ast()}
  | {:try, ast(), ast() | nil}
  | {:if, ast(), ast(), ast()}
  | {:recursive_descent}

Functions

parse(filter)

@spec parse(String.t()) :: {:ok, ast()} | {:error, String.t()}

Parse a jq filter string into an AST.