philomena/lib/search/bool_parser.ex

13 lines
198 B
Elixir
Raw Normal View History

2019-11-02 19:34:25 +01:00
defmodule Search.BoolParser do
import NimbleParsec
bool =
choice([
string("true"),
string("false")
])
|> unwrap_and_tag(:bool)
|> eos()
defparsec :parse, bool
end