View Source Nexus.Parser (nexus_cli v0.5.0)

Nexus.Parser provides functionalities to parse raw input strings based on the CLI AST. This implementation uses manual tokenization and parsing without parser combinators.

Summary

Functions

Parses the raw input string based on the given AST.

Types

@type result() :: %{
  program: atom(),
  command: [atom()],
  flags: %{required(atom()) => term()},
  args: %{required(atom()) => term()}
}

Functions

@spec parse_ast(cli :: Nexus.CLI.t(), input :: String.t() | [String.t()]) ::
  {:ok, result()} | {:error, [String.t()]}

Parses the raw input string based on the given AST.