ex_yarn v0.4.1 ExYarn.Parser View Source

Main module for parsing lockfiles (intended for internal use only)

This module receives the lockfile as input, passes it over to ExYarn.Parser.Token for tokenization and parses the resulting token list to generate the map reprsenting the lockfile's contents.

Link to this section Summary

Types

t()

The parser's state. Intended for internal use only.

Functions

The module's entrypoint

Link to this section Types

Specs

t() :: %ExYarn.Parser{
  comments: [String.t()],
  current_token: ExYarn.Token.t() | nil,
  indent: integer(),
  result: map(),
  tokens: [ExYarn.Token.t()]
}

The parser's state. Intended for internal use only.

Link to this section Functions

Specs

parse(any()) :: {:error, Exception.t()} | {:ok, map(), [binary()]}

The module's entrypoint

Receives the lockfile's content as a String and returns the parsed map representing the lockfile as a Map and the list of comments.