45519a3c2a
We can handle all needed tokens. We still need to test for multiple tokens and for nesting.
20 lines
326 B
Elixir
20 lines
326 B
Elixir
defmodule MfmParser.Reader do
|
|
def peek(input) do
|
|
next_char = input |> String.first()
|
|
|
|
case next_char do
|
|
nil -> :eof
|
|
_ -> next_char
|
|
end
|
|
end
|
|
|
|
def next(input) do
|
|
{next_char, rest} = String.split_at(input, 1)
|
|
|
|
case next_char do
|
|
"" -> :eof
|
|
_ -> {next_char, rest}
|
|
end
|
|
end
|
|
end
|