diff --git a/lib/search/float_parser.ex b/lib/search/float_parser.ex index 8f3bbb80..157feb2a 100644 --- a/lib/search/float_parser.ex +++ b/lib/search/float_parser.ex @@ -1,6 +1,8 @@ defmodule Search.FloatParser do import NimbleParsec - import Search.Helpers + + defp to_number(input), do: Search.Helpers.to_number(input) + defp range(input), do: Search.Helpers.range(input) space = choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")]) @@ -33,4 +35,4 @@ defmodule Search.FloatParser do |> label("a real number, like `2.7182818' or `-10'") defparsec :parse, float_parser -end \ No newline at end of file +end diff --git a/lib/search/int_parser.ex b/lib/search/int_parser.ex index e12744f0..61756a50 100644 --- a/lib/search/int_parser.ex +++ b/lib/search/int_parser.ex @@ -1,6 +1,8 @@ defmodule Search.IntParser do import NimbleParsec - import Search.Helpers + + defp to_int(input), do: Search.Helpers.to_int(input) + defp range(input), do: Search.Helpers.range(input) space = choice([string(" "), string("\t"), string("\n"), string("\r"), string("\v"), string("\f")]) @@ -26,4 +28,4 @@ defmodule Search.IntParser do |> label("an integer, like `3' or `-10'") defparsec :parse, int_parser -end \ No newline at end of file +end diff --git a/lib/search/lexer.ex b/lib/search/lexer.ex index 60a3129e..925182a4 100644 --- a/lib/search/lexer.ex +++ b/lib/search/lexer.ex @@ -1,6 +1,7 @@ defmodule Search.Lexer do import NimbleParsec - import Search.Helpers + + defp to_number(input), do: Search.Helpers.to_number(input) float = optional(ascii_char('-+')) @@ -97,4 +98,4 @@ defmodule Search.Lexer do |> eos() defparsec :lex, search -end \ No newline at end of file +end diff --git a/lib/search/literal_parser.ex b/lib/search/literal_parser.ex index 21e0cf2e..8db31d95 100644 --- a/lib/search/literal_parser.ex +++ b/lib/search/literal_parser.ex @@ -1,6 +1,7 @@ defmodule Search.LiteralParser do import NimbleParsec - import Search.Helpers + + defp to_number(input), do: Search.Helpers.to_number(input) float = ascii_string([?0..?9], min: 1) @@ -55,4 +56,4 @@ defmodule Search.LiteralParser do ]) defparsec :parse, literal -end \ No newline at end of file +end