Skip to content

Commit

Permalink
Format Code
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Nov 6, 2023
1 parent 8e334b1 commit 2cb98ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/expo/po/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ defmodule Expo.PO.Parser do
IO.chardata_to_string(parse_error_reason(error, to_string(token)))
end

defp parse_error_reason('syntax error before: ' = prefix, "<<" <> rest),
defp parse_error_reason(~c"syntax error before: " = prefix, "<<" <> rest),
do: [prefix, binary_part(rest, 0, byte_size(rest) - 2)]

defp parse_error_reason('syntax error before: ' = prefix, "[<<" <> rest),
defp parse_error_reason(~c"syntax error before: " = prefix, "[<<" <> rest),
do: [prefix, binary_part(rest, 0, byte_size(rest) - 3)]

defp parse_error_reason(error, token), do: [error, token]
Expand Down
4 changes: 2 additions & 2 deletions lib/expo/po/tokenizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ defmodule Expo.PO.Tokenizer do
defp tokenize_line(binary, line, _acc) when is_binary(binary) do
# To get the first Unicode char, we convert to char list first.
[char | _] = String.to_charlist(binary)
msg = :io_lib.format('unexpected token: "~ts" (codepoint U+~4.16.0B)', [[char], char])
msg = :io_lib.format(~c"unexpected token: \"~ts\" (codepoint U+~4.16.0B)", [[char], char])
{:error, line, :unicode.characters_to_binary(msg)}
end

Expand Down Expand Up @@ -272,7 +272,7 @@ defmodule Expo.PO.Tokenizer do

defp tokenize_string(<<>>, _acc), do: {:error, "missing token \""}

defp tokenize_plural_form(<<digit, rest::binary>>, acc) when digit in '0123456789' do
defp tokenize_plural_form(<<digit, rest::binary>>, acc) when digit in ~c"0123456789" do
tokenize_plural_form(rest, <<acc::binary, digit>>)
end

Expand Down

0 comments on commit 2cb98ea

Please sign in to comment.