break compile time dependencies inside the search parser

This commit is contained in:
byte[] 2019-12-30 16:14:57 -05:00
parent 0f3cb295a3
commit f278362fda
4 changed files with 14 additions and 8 deletions

View file

@ -1,6 +1,8 @@
defmodule Search.FloatParser do defmodule Search.FloatParser do
import NimbleParsec import NimbleParsec
import Search.Helpers
defp to_number(input), do: Search.Helpers.to_number(input)
defp range(input), do: Search.Helpers.range(input)
space = space =
choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")]) choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")])

View file

@ -1,6 +1,8 @@
defmodule Search.IntParser do defmodule Search.IntParser do
import NimbleParsec import NimbleParsec
import Search.Helpers
defp to_int(input), do: Search.Helpers.to_int(input)
defp range(input), do: Search.Helpers.range(input)
space = space =
choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")]) choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")])

View file

@ -1,6 +1,7 @@
defmodule Search.Lexer do defmodule Search.Lexer do
import NimbleParsec import NimbleParsec
import Search.Helpers
defp to_number(input), do: Search.Helpers.to_number(input)
float = float =
optional(ascii_char('-+')) optional(ascii_char('-+'))

View file

@ -1,6 +1,7 @@
defmodule Search.LiteralParser do defmodule Search.LiteralParser do
import NimbleParsec import NimbleParsec
import Search.Helpers
defp to_number(input), do: Search.Helpers.to_number(input)
float = float =
ascii_string([?0..?9], min: 1) ascii_string([?0..?9], min: 1)