Current section
Files
Jump to
Current section
Files
lib/temple/ast/text.ex
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