philomena/lib/search/bool_parser.ex
2019-11-02 16:31:55 -04:00

14 lines
No EOL
248 B
Elixir

defmodule Search.BoolParser do
import NimbleParsec
bool =
choice([
string("true"),
string("false")
])
|> unwrap_and_tag(:bool)
|> eos()
|> label("a boolean, like `true' or `false'")
defparsec :parse, bool
end