The lossless match of the interpreted shift-reduce backends,
Grammar.LR and Grammar.GLR (design/lossless-mode.md): tokenize,
run the table with the rules recording, place an error against the
input, weave the tree.
The two differ only in the run -- Grammar.LR.Lossless.run/6, or
Grammar.GLR.Runtime.run/7 building with
Ichor.Syntax.Record.reduced/3 -- so it is handed in, and the
surrounding steps are each backend's ordinary ones, in the same order:
the lossless parse fails exactly where and how the ordinary one does.
Summary
Types
A run over a table, as Grammar.LR.Lossless.run/6 takes its arguments.
Functions
{:ok, value, tree} from a matched/5 result, value evaluated as the backend's run/4 evaluates it.
The lossless tree of input under grammar, whose table is table,
and the ordinary captures beside it with the locator of their recorded
positions, for evaluated/5.
Types
@type run() :: (Grammar.GLR.Runtime.action_fn(), Grammar.GLR.Runtime.goto_fn(), %{required(non_neg_integer()) => Grammar.LRTable.Production.t()}, Grammar.LRTable.state_id(), atom(), tuple() -> {:ok, non_neg_integer(), Ichor.Capture.raw_captures()} | {:error, Ichor.Error.t()})
A run over a table, as Grammar.LR.Lossless.run/6 takes its arguments.
Functions
@spec evaluated( {:ok, Ichor.Syntax.Node.t(), Ichor.Capture.raw_captures(), Grammar.Source.Locator.t()} | {:error, term()}, Aether.Grammar.t(), module(), Ichor.Actions.context(), Ichor.Actions.capture_shapes() ) :: {:ok, term(), Ichor.Syntax.Node.t()} | {:error, term()}
{:ok, value, tree} from a matched/5 result, value evaluated as the backend's run/4 evaluates it.
@spec matched(Aether.Grammar.t(), Grammar.LRTable.t(), String.t(), term(), run()) :: {:ok, Ichor.Syntax.Node.t(), Ichor.Capture.raw_captures(), Grammar.Source.Locator.t()} | {:error, Ichor.Error.t()}
The lossless tree of input under grammar, whose table is table,
and the ordinary captures beside it with the locator of their recorded
positions, for evaluated/5.