diff --git a/lib/localize/datetime/format/compiler.ex b/lib/localize/datetime/format/compiler.ex index 45b284d4..d6ccc4be 100644 --- a/lib/localize/datetime/format/compiler.ex +++ b/lib/localize/datetime/format/compiler.ex @@ -34,7 +34,7 @@ defmodule Localize.DateTime.Format.Compiler do def tokenize(format_string) when is_binary(format_string) do format_string |> String.to_charlist() - |> :date_time_format_lexer.string() + |> :localize_date_time_format_lexer.string() |> maybe_add_decimal_separator() |> maybe_return_error(format_string) end @@ -67,7 +67,7 @@ defmodule Localize.DateTime.Format.Compiler do [first | seconds_followed_by_fraction(rest)] end - defp maybe_return_error({:error, {_, :date_time_format_lexer, {_, error}}, _}, format) do + defp maybe_return_error({:error, {_, :localize_date_time_format_lexer, {_, error}}, _}, format) do {:error, Localize.DateTimeFormatError.exception( format: format, diff --git a/lib/localize/number/format/compiler.ex b/lib/localize/number/format/compiler.ex index 494886f9..eb0c468a 100644 --- a/lib/localize/number/format/compiler.ex +++ b/lib/localize/number/format/compiler.ex @@ -60,7 +60,7 @@ defmodule Localize.Number.Format.Compiler do def tokenize(definition) when is_binary(definition) do definition |> String.to_charlist() - |> :decimal_formats_lexer.string() + |> :localize_decimal_formats_lexer.string() end @doc """ @@ -88,7 +88,7 @@ defmodule Localize.Number.Format.Compiler do """ @spec parse(String.t() | list()) :: {:ok, Keyword.t()} | {:error, term()} def parse(tokens) when is_list(tokens) do - :decimal_formats_parser.parse(tokens) + :localize_decimal_formats_parser.parse(tokens) end def parse("") do @@ -97,7 +97,7 @@ defmodule Localize.Number.Format.Compiler do def parse(definition) when is_binary(definition) do {:ok, tokens, _end_line} = tokenize(definition) - :decimal_formats_parser.parse(tokens) + :localize_decimal_formats_parser.parse(tokens) end def parse(nil) do diff --git a/lib/localize/number/plural_rules/compiler.ex b/lib/localize/number/plural_rules/compiler.ex index de9e256a..b0753dea 100644 --- a/lib/localize/number/plural_rules/compiler.ex +++ b/lib/localize/number/plural_rules/compiler.ex @@ -3,8 +3,8 @@ defmodule Localize.Number.PluralRule.Compiler do # Compiles CLDR plural rule definitions into Elixir AST. # - # Uses the Erlang leex lexer (`:plural_rules_lexer`) and yecc parser - # (`:plural_rules_parser`) to tokenize and parse rule definitions + # Uses the Erlang leex lexer (`:localize_plural_rules_lexer`) and yecc parser + # (`:localize_plural_rules_parser`) to tokenize and parse rule definitions # from the ICU/CLDR plural rules syntax. @doc """ @@ -27,7 +27,7 @@ defmodule Localize.Number.PluralRule.Compiler do def tokenize(definition) when is_binary(definition) do definition |> String.to_charlist() - |> :plural_rules_lexer.string() + |> :localize_plural_rules_lexer.string() end @doc """ @@ -49,11 +49,11 @@ defmodule Localize.Number.PluralRule.Compiler do """ def parse(tokens) when is_list(tokens) do - :plural_rules_parser.parse(tokens) + :localize_plural_rules_parser.parse(tokens) end def parse(definition) when is_binary(definition) do {:ok, tokens, _end_line} = tokenize(definition) - :plural_rules_parser.parse(tokens) + :localize_plural_rules_parser.parse(tokens) end end diff --git a/lib/localize/number/rbnf/rule.ex b/lib/localize/number/rbnf/rule.ex index 0cdc8c6a..aca8174b 100644 --- a/lib/localize/number/rbnf/rule.ex +++ b/lib/localize/number/rbnf/rule.ex @@ -59,7 +59,7 @@ defmodule Localize.Number.Rbnf.Rule do definition |> String.trim_leading("'") |> String.to_charlist() - |> :rbnf_lexer.string() + |> :localize_rbnf_lexer.string() end def tokenize(%__MODULE__{definition: definition}) do @@ -86,6 +86,6 @@ defmodule Localize.Number.Rbnf.Rule do end def parse(tokens) when is_list(tokens) do - :rbnf_parser.parse(tokens) + :localize_rbnf_parser.parse(tokens) end end diff --git a/src/date_time_format_lexer.xrl b/src/localize_date_time_format_lexer.xrl similarity index 100% rename from src/date_time_format_lexer.xrl rename to src/localize_date_time_format_lexer.xrl diff --git a/src/decimal_formats_lexer.xrl b/src/localize_decimal_formats_lexer.xrl similarity index 100% rename from src/decimal_formats_lexer.xrl rename to src/localize_decimal_formats_lexer.xrl diff --git a/src/decimal_formats_parser.yrl b/src/localize_decimal_formats_parser.yrl similarity index 100% rename from src/decimal_formats_parser.yrl rename to src/localize_decimal_formats_parser.yrl diff --git a/src/plural_rules_lexer.xrl b/src/localize_plural_rules_lexer.xrl similarity index 100% rename from src/plural_rules_lexer.xrl rename to src/localize_plural_rules_lexer.xrl diff --git a/src/plural_rules_parser.yrl b/src/localize_plural_rules_parser.yrl similarity index 100% rename from src/plural_rules_parser.yrl rename to src/localize_plural_rules_parser.yrl diff --git a/src/rbnf_lexer.xrl b/src/localize_rbnf_lexer.xrl similarity index 100% rename from src/rbnf_lexer.xrl rename to src/localize_rbnf_lexer.xrl diff --git a/src/rbnf_parser.yrl b/src/localize_rbnf_parser.yrl similarity index 100% rename from src/rbnf_parser.yrl rename to src/localize_rbnf_parser.yrl diff --git a/test/localize/number/rbnf_rule_processor_test.exs b/test/localize/number/rbnf_rule_processor_test.exs index f2ee48f1..b63107db 100644 --- a/test/localize/number/rbnf_rule_processor_test.exs +++ b/test/localize/number/rbnf_rule_processor_test.exs @@ -62,7 +62,7 @@ defmodule Localize.Number.RbnfRuleProcessorTest do end test "returns a parser error for an unterminated construct" do - assert {:error, {1, :rbnf_parser, _reason}} = Rule.parse("twenty[->>];") + assert {:error, {1, :localize_rbnf_parser, _reason}} = Rule.parse("twenty[->>];") end end