mfm-parser/lib/token.ex
Ilja 1bf36d1f52 Code review part 3
* <https://ilja.space/notice/ALpd6nux5hT2nsfetM>
    * Previous commit: `|> fill_props(token) after the cond` in the parser
    * Previous commit: Don't use intention-specific data in the tokens (e.g. left is reverse, x is mfm-spinX)
* <https://ilja.space/notice/ALpcK6W59UjkIUofU8>
    * This commit: Use less files
* Previous commit: Change nested if-statement in mfm.ex to `cond do`

I also added some more and better info to the README.md and moduledocs.
2022-07-25 14:13:43 +02:00

21 lines
410 B
Elixir

defmodule MfmParser.Token do
def append(token = %{content: content}, new_char) do
token |> Map.put(:content, content <> new_char)
end
end
defmodule MfmParser.Token.Text do
defstruct content: ""
end
defmodule MfmParser.Token.Newline do
defstruct content: ""
end
defmodule MfmParser.Token.MFM.Open do
defstruct content: ""
end
defmodule MfmParser.Token.MFM.Close do
defstruct content: ""
end