This repository has been archived on 2023-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
temple/lib/temple/ast/text.ex

20 lines
333 B
Elixir

defmodule Temple.Ast.Text do
@moduledoc false
@behaviour Temple.Parser
use TypedStruct
typedstruct do
field :text, String.t()
end
@impl true
def applicable?(text) when is_binary(text), do: true
def applicable?(_), do: false
@impl true
def run(text) do
Temple.Ast.new(__MODULE__, text: text)
end
end