changed
CHANGELOG.md
|
@@ -1,5 +1,9 @@
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+ ## v1.0.1
|
4
|
+
|
5
|
+ * Fix backslash escaping in `Expo.PO.compose/1`
|
6
|
+
|
3
7
|
## v1.0.0
|
4
8
|
|
5
9
|
* Fix compose output of extracted comments on plural messages
|
changed
hex_metadata.config
|
@@ -4,7 +4,7 @@
|
4
4
|
{<<"GitHub">>,<<"https://github.com/elixir-gettext/expo">>},
|
5
5
|
{<<"Issues">>,<<"https://github.com/elixir-gettext/expo/issues">>}]}.
|
6
6
|
{<<"name">>,<<"expo">>}.
|
7
|
- {<<"version">>,<<"1.0.0">>}.
|
7
|
+ {<<"version">>,<<"1.0.1">>}.
|
8
8
|
{<<"description">>,
|
9
9
|
<<"Low-level Gettext file handling (.po/.pot/.mo file writer and parser).">>}.
|
10
10
|
{<<"elixir">>,<<"~> 1.11">>}.
|
|
@@ -12,23 +12,24 @@
|
12
12
|
{<<"licenses">>,[<<"Apache-2.0">>]}.
|
13
13
|
{<<"requirements">>,[]}.
|
14
14
|
{<<"files">>,
|
15
|
- [<<"lib">>,<<"lib/mix">>,<<"lib/mix/tasks">>,
|
16
|
- <<"lib/mix/tasks/expo.msguniq.ex">>,<<"lib/mix/tasks/expo.msgmft.ex">>,
|
17
|
- <<"lib/expo">>,<<"lib/expo/util.ex">>,<<"lib/expo/message.ex">>,
|
18
|
- <<"lib/expo/mo">>,<<"lib/expo/mo/composer.ex">>,
|
15
|
+ [<<"lib">>,<<"lib/expo">>,<<"lib/expo/messages.ex">>,<<"lib/expo/mo">>,
|
16
|
+ <<"lib/expo/mo/invalid_file_error.ex">>,
|
19
17
|
<<"lib/expo/mo/unsupported_version_error.ex">>,
|
20
|
- <<"lib/expo/mo/invalid_file_error.ex">>,<<"lib/expo/mo/parser.ex">>,
|
21
|
- <<"lib/expo/mo.ex">>,<<"lib/expo/message">>,
|
22
|
- <<"lib/expo/message/singular.ex">>,<<"lib/expo/message/plural.ex">>,
|
23
|
- <<"lib/expo/po">>,<<"lib/expo/po/duplicate_translations_error.ex">>,
|
24
|
- <<"lib/expo/po/composer.ex">>,<<"lib/expo/po/syntax_error.ex">>,
|
25
|
- <<"lib/expo/po/tokenizer.ex">>,<<"lib/expo/po/parser.ex">>,
|
26
|
- <<"lib/expo/plural_forms">>,<<"lib/expo/plural_forms/syntax_error.ex">>,
|
18
|
+ <<"lib/expo/mo/composer.ex">>,<<"lib/expo/mo/parser.ex">>,
|
19
|
+ <<"lib/expo/plural_forms.ex">>,<<"lib/expo/message.ex">>,
|
20
|
+ <<"lib/expo/message">>,<<"lib/expo/message/singular.ex">>,
|
21
|
+ <<"lib/expo/message/plural.ex">>,<<"lib/expo/plural_forms">>,
|
22
|
+ <<"lib/expo/plural_forms/tokenizer.ex">>,
|
27
23
|
<<"lib/expo/plural_forms/known.ex">>,
|
28
|
- <<"lib/expo/plural_forms/tokenizer.ex">>,<<"lib/expo/plural_forms.ex">>,
|
29
|
- <<"lib/expo/messages.ex">>,<<"lib/expo/po.ex">>,<<".formatter.exs">>,
|
30
|
- <<"mix.exs">>,<<"README.md">>,<<"LICENSE">>,<<"CHANGELOG.md">>,<<"src">>,
|
31
|
- <<"src/expo_po_parser.erl">>,<<"src/expo_po_parser.yrl">>,
|
24
|
+ <<"lib/expo/plural_forms/syntax_error.ex">>,<<"lib/expo/po">>,
|
25
|
+ <<"lib/expo/po/duplicate_translations_error.ex">>,
|
26
|
+ <<"lib/expo/po/tokenizer.ex">>,<<"lib/expo/po/composer.ex">>,
|
27
|
+ <<"lib/expo/po/parser.ex">>,<<"lib/expo/po/syntax_error.ex">>,
|
28
|
+ <<"lib/expo/util.ex">>,<<"lib/expo/mo.ex">>,<<"lib/expo/po.ex">>,
|
29
|
+ <<"lib/mix">>,<<"lib/mix/tasks">>,<<"lib/mix/tasks/expo.msguniq.ex">>,
|
30
|
+ <<"lib/mix/tasks/expo.msgmft.ex">>,<<".formatter.exs">>,<<"mix.exs">>,
|
31
|
+ <<"README.md">>,<<"LICENSE">>,<<"CHANGELOG.md">>,<<"src">>,
|
32
32
|
<<"src/expo_plural_forms_parser.erl">>,
|
33
|
- <<"src/expo_plural_forms_parser.yrl">>]}.
|
33
|
+ <<"src/expo_plural_forms_parser.yrl">>,<<"src/expo_po_parser.yrl">>,
|
34
|
+ <<"src/expo_po_parser.erl">>]}.
|
34
35
|
{<<"build_tools">>,[<<"mix">>]}.
|
changed
lib/expo/po/composer.ex
|
@@ -135,5 +135,6 @@ defmodule Expo.PO.Composer do
|
135
135
|
defp escape_char(?\n), do: ~S(\n)
|
136
136
|
defp escape_char(?\t), do: ~S(\t)
|
137
137
|
defp escape_char(?\r), do: ~S(\r)
|
138
|
+ defp escape_char(?\\), do: <<?\\::utf8, ?\\::utf8>>
|
138
139
|
defp escape_char(char), do: <<char>>
|
139
140
|
end
|
changed
mix.exs
|
@@ -2,7 +2,7 @@
|
2
2
|
defmodule Expo.MixProject do
|
3
3
|
use Mix.Project
|
4
4
|
|
5
|
- @version "1.0.0"
|
5
|
+ @version "1.0.1"
|
6
6
|
@source_url "https://github.com/elixir-gettext/expo"
|
7
7
|
@description "Low-level Gettext file handling (.po/.pot/.mo file writer and parser)."
|
8
8
|
|
|
@@ -67,7 +67,7 @@ defmodule Expo.MixProject do
|
67
67
|
defp deps do
|
68
68
|
[
|
69
69
|
# Dev/test dependencies
|
70
|
- {:credo, "~> 1.0", only: [:dev], runtime: false},
|
70
|
+ {:credo, "~> 1.7", only: [:dev], runtime: false},
|
71
71
|
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
|
72
72
|
{:ex_doc, ">= 0.0.0", only: [:dev], runtime: false},
|
73
73
|
{:excoveralls, "~> 0.17", only: [:test], runtime: false}
|
changed
src/expo_plural_forms_parser.erl
|
@@ -1,4 +1,6 @@
|
1
|
+ -file("src/expo_plural_forms_parser.yrl", 0).
|
1
2
|
-module(expo_plural_forms_parser).
|
3
|
+ -file("src/expo_plural_forms_parser.erl", 3).
|
2
4
|
-export([parse/1, parse_and_scan/1, format_error/1]).
|
3
5
|
-file("src/expo_plural_forms_parser.yrl", 48).
|
4
6
|
|
|
@@ -6,11 +8,11 @@ value({int, _Line, Int}) -> Int.
|
6
8
|
|
7
9
|
operator({Op, _Line}) -> Op.
|
8
10
|
|
9
|
- -file("/Users/andrea/.asdf/installs/erlang/25.0/lib/parsetools-2.4/include/yeccpre.hrl", 0).
|
11
|
+ -file("/home/vscode/.asdf/installs/erlang/27.0.1/lib/parsetools-2.6/include/yeccpre.hrl", 0).
|
10
12
|
%%
|
11
13
|
%% %CopyrightBegin%
|
12
14
|
%%
|
13
|
- %% Copyright Ericsson AB 1996-2021. All Rights Reserved.
|
15
|
+ %% Copyright Ericsson AB 1996-2024. All Rights Reserved.
|
14
16
|
%%
|
15
17
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
16
18
|
%% you may not use this file except in compliance with the License.
|
|
@@ -32,10 +34,16 @@ operator({Op, _Line}) -> Op.
|
32
34
|
|
33
35
|
-type yecc_ret() :: {'error', _} | {'ok', _}.
|
34
36
|
|
37
|
+ -ifdef (YECC_PARSE_DOC).
|
38
|
+ -doc ?YECC_PARSE_DOC.
|
39
|
+ -endif.
|
35
40
|
-spec parse(Tokens :: list()) -> yecc_ret().
|
36
41
|
parse(Tokens) ->
|
37
42
|
yeccpars0(Tokens, {no_func, no_location}, 0, [], []).
|
38
43
|
|
44
|
+ -ifdef (YECC_PARSE_AND_SCAN_DOC).
|
45
|
+ -doc ?YECC_PARSE_AND_SCAN_DOC.
|
46
|
+ -endif.
|
39
47
|
-spec parse_and_scan({function() | {atom(), atom()}, [_]}
|
40
48
|
| {atom(), atom(), [_]}) -> yecc_ret().
|
41
49
|
parse_and_scan({F, A}) ->
|
|
@@ -44,6 +52,9 @@ parse_and_scan({M, F, A}) ->
|
44
52
|
Arity = length(A),
|
45
53
|
yeccpars0([], {{fun M:F/Arity, A}, no_location}, 0, [], []).
|
46
54
|
|
55
|
+ -ifdef (YECC_FORMAT_ERROR_DOC).
|
56
|
+ -doc ?YECC_FORMAT_ERROR_DOC.
|
57
|
+ -endif.
|
47
58
|
-spec format_error(any()) -> [char() | list()].
|
48
59
|
format_error(Message) ->
|
49
60
|
case io_lib:deep_char_list(Message) of
|
|
@@ -185,7 +196,7 @@ yecctoken2string1(Other) ->
|
185
196
|
|
186
197
|
|
187
198
|
|
188
|
- -file("src/expo_plural_forms_parser.erl", 188).
|
199
|
+ -file("src/expo_plural_forms_parser.erl", 199).
|
189
200
|
|
190
201
|
-dialyzer({nowarn_function, yeccpars2/7}).
|
191
202
|
-compile({nowarn_unused_function, yeccpars2/7}).
|
changed
src/expo_po_parser.erl
|
@@ -1,4 +1,6 @@
|
1
|
+ -file("src/expo_po_parser.yrl", 0).
|
1
2
|
-module(expo_po_parser).
|
3
|
+ -file("src/expo_po_parser.erl", 3).
|
2
4
|
-export([parse/1, parse_and_scan/1, format_error/1]).
|
3
5
|
-file("src/expo_po_parser.yrl", 242).
|
4
6
|
|
|
@@ -40,11 +42,11 @@ group_meta(MetaFields) ->
|
40
42
|
)
|
41
43
|
).
|
42
44
|
|
43
|
- -file("/Users/andrea/.asdf/installs/erlang/25.0/lib/parsetools-2.4/include/yeccpre.hrl", 0).
|
45
|
+ -file("/home/vscode/.asdf/installs/erlang/27.0.1/lib/parsetools-2.6/include/yeccpre.hrl", 0).
|
44
46
|
%%
|
45
47
|
%% %CopyrightBegin%
|
46
48
|
%%
|
47
|
- %% Copyright Ericsson AB 1996-2021. All Rights Reserved.
|
49
|
+ %% Copyright Ericsson AB 1996-2024. All Rights Reserved.
|
48
50
|
%%
|
49
51
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
50
52
|
%% you may not use this file except in compliance with the License.
|
|
@@ -66,10 +68,16 @@ group_meta(MetaFields) ->
|
66
68
|
|
67
69
|
-type yecc_ret() :: {'error', _} | {'ok', _}.
|
68
70
|
|
71
|
+ -ifdef (YECC_PARSE_DOC).
|
72
|
+ -doc ?YECC_PARSE_DOC.
|
73
|
+ -endif.
|
69
74
|
-spec parse(Tokens :: list()) -> yecc_ret().
|
70
75
|
parse(Tokens) ->
|
71
76
|
yeccpars0(Tokens, {no_func, no_location}, 0, [], []).
|
72
77
|
|
78
|
+ -ifdef (YECC_PARSE_AND_SCAN_DOC).
|
79
|
+ -doc ?YECC_PARSE_AND_SCAN_DOC.
|
80
|
+ -endif.
|
73
81
|
-spec parse_and_scan({function() | {atom(), atom()}, [_]}
|
74
82
|
| {atom(), atom(), [_]}) -> yecc_ret().
|
75
83
|
parse_and_scan({F, A}) ->
|
|
@@ -78,6 +86,9 @@ parse_and_scan({M, F, A}) ->
|
78
86
|
Arity = length(A),
|
79
87
|
yeccpars0([], {{fun M:F/Arity, A}, no_location}, 0, [], []).
|
80
88
|
|
89
|
+ -ifdef (YECC_FORMAT_ERROR_DOC).
|
90
|
+ -doc ?YECC_FORMAT_ERROR_DOC.
|
91
|
+ -endif.
|
81
92
|
-spec format_error(any()) -> [char() | list()].
|
82
93
|
format_error(Message) ->
|
83
94
|
case io_lib:deep_char_list(Message) of
|
|
@@ -219,7 +230,7 @@ yecctoken2string1(Other) ->
|
219
230
|
|
220
231
|
|
221
232
|
|
222
|
- -file("src/expo_po_parser.erl", 222).
|
233
|
+ -file("src/expo_po_parser.erl", 233).
|
223
234
|
|
224
235
|
-dialyzer({nowarn_function, yeccpars2/7}).
|
225
236
|
-compile({nowarn_unused_function, yeccpars2/7}).
|