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
Raw Normal View History

defmodule Temple.Ast.Text do
2021-01-02 18:21:48 +00:00
@moduledoc false
@behaviour Temple.Parser
use TypedStruct
2021-04-09 03:04:26 +00:00
typedstruct do
field :text, String.t()
end
@impl true
def applicable?(text) when is_binary(text), do: true
def applicable?(_), do: false
@impl true
2021-03-15 04:46:16 +00:00
def run(text) do
Temple.Ast.new(__MODULE__, text: text)
2021-03-15 04:46:16 +00:00
end
end