Changes of Revision 2

erlang-neotoma.spec Changed
x
 
1
@@ -4,16 +4,16 @@
2
 
3
 
4
 Name:      erlang-%{realname}
5
-Version:   1.7.2
6
+Version:   1.7.3
7
 Release:   1%{?dist}
8
 Summary:   Erlang library and packrat parser-generator for parsing expression grammars
9
 Group:     Development/Languages
10
 License:   MIT
11
-URL:       http://github.com/%{upstream}/%{realname}
12
-%if 0%{?el7}%{?fedora}
13
-VCS:       scm:git:https://github.com/%{upstream}/%{realname}.git
14
-%endif
15
-Source0:   https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz
16
+URL:       http://github.com/seancribbs/neotoma
17
+
18
+# wget --content-disposition https://github.com/seancribbs/neotoma/archive/1.7.3.tar.gz
19
+Source0:   %{realname}-%{version}.tar.gz
20
+
21
 BuildRequires: erlang-rebar
22
 # ets:insert/2 ( >= R12B-5 )
23
 # ets:insert_new/2 ( >= R12B-5 )
24
fix_version_string.patch Added
15
 
1
@@ -0,0 +1,13 @@
2
+diff --git a/src/neotoma.app.src b/src/neotoma.app.src
3
+index 2f63653..3a5dd15 100644
4
+--- a/src/neotoma.app.src
5
++++ b/src/neotoma.app.src
6
+@@ -1,7 +1,7 @@
7
+ {application, neotoma,
8
+  
9
+   {description, "PEG/Packrat toolkit and parser-generator."},
10
+-  {vsn, git},
11
++  {vsn, "1.7.3"},
12
+   {applications, kernel, stdlib}
13
+  
14
+ }.
15
debian.changelog Added
17
 
1
@@ -0,0 +1,15 @@
2
+neotoma (1.7.3+dfsg-1) unstable; urgency=medium
3
+
4
+  * New maintainer. (Closes: #809925)
5
+  * New upstream release. (Closes: #800569)
6
+  * Change using dh-rebar.
7
+  * Update Standards-Version to 3.9.6.
8
+  * Update debian/watch.
9
+
10
+ -- Nobuhiro Iwamatsu <iwamatsu@debian.org>  Sat, 13 Feb 2016 16:18:49 +0900
11
+
12
+neotoma (1.5.1-1) experimental; urgency=low
13
+
14
+  * Initial release, target experimental since we are in a freeze.
15
+
16
+ -- Tollef Fog Heen <tfheen@debian.org>  Sat, 01 Dec 2012 20:47:41 +0100
17
debian.control Added
37
 
1
@@ -0,0 +1,35 @@
2
+Source: neotoma
3
+Section: devel
4
+Priority: optional
5
+Maintainer: Nobuhiro Iwamatsu <iwamatsu@debian.org>
6
+Build-Depends: debhelper (>= 9), rebar, erlang-dev (>= 1:14.b.4), erlang-eunit, dh-rebar
7
+Standards-Version: 3.9.6
8
+Homepage: https://github.com/seancribbs/neotoma
9
+#Vcs-Git: git://git.debian.org/collab-maint/neotoma.git
10
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/neotoma.git;a=summary
11
+
12
+Package: erlang-neotoma
13
+Architecture: any
14
+Depends: ${shlibs:Depends}, ${misc:Depends},
15
+   erlang-base-hipe | erlang-base | ${erlang-abi:Depends}, ${erlang:Depends},
16
+Description: parser generator for Erlang
17
+ Neotoma is a packrat parser-generator for Erlang for Parsing
18
+ Expression Grammars (PEGs). It consists of a parsing-combinator
19
+ library with memoization routines, a parser for PEGs, and a utility
20
+ to generate parsers from PEGs.  It is inspired by treetop, a Ruby
21
+ library with similar aims, and parsec, the parser-combinator library
22
+ for Haskell.
23
+ .
24
+ Features include:
25
+  - Simple, declarative parsers generated from even simpler grammars.
26
+  - Fully integrated, single-pass lexical and syntactic analysis (a
27
+    feature of PEGs).
28
+  - Packrat-style memoization, boasting parse-time bound linearly to
29
+    the input size (at the expense of memory usage).
30
+  - In-place semantic analysis/transformation, supporting single-pass
31
+    end-to-end in some applications.
32
+  - Erlang code-generation for the lexical/syntactic analysis piece,
33
+    with the option of semantic analysis/transformation inline, or in
34
+    a separate module.
35
+  - Line/column number tracking for easy resolution of parsing
36
+    errors.
37
debian.rules Added
38
 
1
@@ -0,0 +1,36 @@
2
+#!/usr/bin/make -f
3
+# -*- makefile -*-
4
+# Sample debian/rules that uses debhelper.
5
+# This file was originally written by Joey Hess and Craig Small.
6
+# As a special exception, when this file is copied by dh-make into a
7
+# dh-make output file, you may use that output file without restriction.
8
+# This special exception was added by Craig Small in version 0.37 of dh-make.
9
+
10
+# Uncomment this to turn on verbose mode.
11
+#export DH_VERBOSE=1
12
+
13
+PACKAGE = $(shell dpkg-parsechangelog | sed -rne 's/^Source: (.+)/\1/p')
14
+VERSION = $(shell dpkg-parsechangelog | sed -rne 's/^Version: (0-9.+)(\+dfsg)?.*$$/\1/p')
15
+
16
+%:
17
+   dh $@ --buildsystem=rebar --with rebar
18
+
19
+override_dh_auto_install:
20
+   dh_auto_install
21
+
22
+   for dir in ebin priv; do \
23
+       install -d \
24
+           $(CURDIR)/debian/erlang-$(PACKAGE)/usr/lib/erlang/lib/$(PACKAGE)-$(VERSION)/$$dir ; \
25
+       install -m 644 $$dir/* \
26
+       $(CURDIR)/debian/erlang-$(PACKAGE)/usr/lib/erlang/lib/$(PACKAGE)-$(VERSION)/$$dir/ ; \
27
+   done
28
+
29
+#override_dh_gencontrol-arch:
30
+#  erlang-depends -a
31
+#  dh_gencontrol -a
32
+#
33
+#override_dh_compress-arch:
34
+#  dh_compress -X.erl -X.beam
35
+#
36
+#override_dh_auto_test:
37
+#  HOME=/tmp rebar eunit -vv
38
debian.series Added
3
 
1
@@ -0,0 +1,1 @@
2
+fix_version_string.patch
3
debian.tar.gz Added
erlang-neotoma.dsc Added
16
 
1
@@ -0,0 +1,14 @@
2
+Format: 1.0
3
+Source: neotoma
4
+Binary: erlang-neotoma
5
+Architecture: any
6
+Version: 1.7.3+dfsg-1
7
+Maintainer: Nobuhiro Iwamatsu <iwamatsu@debian.org>
8
+Homepage: https://github.com/seancribbs/neotoma
9
+Standards-Version: 3.9.6
10
+Build-Depends: debhelper (>= 9), rebar, erlang-dev (>= 1:14.b.4), erlang-eunit, dh-rebar
11
+Package-List:
12
+ erlang-neotoma deb devel optional arch=any
13
+Files:
14
+ 00000000000000000000000000000000 0 neotoma-1.7.3.tar.gz
15
+ 00000000000000000000000000000000 0 debian.tar.gz
16
neotoma-1.7.2.tar.gz/.travis.yml -> neotoma-1.7.3.tar.gz/.travis.yml Changed
17
 
1
@@ -2,9 +2,12 @@
2
 notifications:
3
   disabled: true
4
 otp_release:
5
+  - 17.0
6
+  - 17.3
7
+  - 17.4
8
+  - R16B02
9
+  - R16B01
10
+  - R16B
11
   - R15B02
12
   - R15B01
13
   - R15B
14
-  - R14B04
15
-  - R14B03
16
-  - R14B02
17
neotoma-1.7.2.tar.gz/README.textile -> neotoma-1.7.3.tar.gz/README.textile Changed
9
 
1
@@ -1,5 +1,7 @@
2
 h1. Neotoma
3
 
4
+!https://travis-ci.org/seancribbs/neotoma.svg?branch=master!:https://travis-ci.org/seancribbs/neotoma
5
+
6
 h2. About
7
 
8
 Neotoma is a packrat parser-generator for Erlang for Parsing Expression Grammars (PEGs).
9
neotoma-1.7.2.tar.gz/extra/csv.erl -> neotoma-1.7.3.tar.gz/extra/csv.erl Changed
10
 
1
@@ -41,7 +41,7 @@
2
                                                                                                                                                                                                    end).
3
 
4
 'field'(Input, Index) ->
5
-    p(Input, Index, 'field', fun(I,D) -> (p_choose(fun 'quoted_field'/2, p_zero_or_more(p_seq(p_not(fun 'field_sep'/2), p_not(fun 'crlf'/2), p_anything()))))(I,D) end, fun(Node, Idx) -> iolist_to_binary(Node) end).
6
+    p(Input, Index, 'field', fun(I,D) -> (p_choose(fun 'quoted_field'/2, p_zero_or_more(p_seq(p_not(fun 'field_sep'/2), p_not(fun 'crlf'/2), p_anything()))))(I,D) end, fun(Node, Idx) -> unicode:characters_to_binary(Node) end).
7
 
8
 'quoted_field'(Input, Index) ->
9
     p(Input, Index, 'quoted_field', fun(I,D) -> (p_seq(p_string(<<"\"">>), p_label('string', p_zero_or_more(p_choose(p_string(<<"\"\"">>), p_seq(p_not(p_string(<<"\"">>)), p_anything())))), p_string(<<"\"">>)))(I,D) end, fun(Node, Idx) ->
10
neotoma-1.7.2.tar.gz/extra/json.erl -> neotoma-1.7.3.tar.gz/extra/json.erl Changed
22
 
1
@@ -45,15 +45,15 @@
2
                                                                                                                                                                                                                                                                                                                                                                                                                            end).
3
 
4
 'string'(Input, Index) ->
5
-    p(Input, Index, 'string', fun(I,D) -> (p_seq(p_string(<<"\"">>), p_label('chars', p_zero_or_more(p_seq(p_not(p_string(<<"\"">>)), p_choose(p_string(<<"\\\\\\\\">>), p_string(<<"\\\\\"">>), p_anything())))), p_string(<<"\"">>)))(I,D) end, fun(Node, Idx) -> iolist_to_binary(proplists:get_value(chars, Node)) end).
6
+    p(Input, Index, 'string', fun(I,D) -> (p_seq(p_string(<<"\"">>), p_label('chars', p_zero_or_more(p_seq(p_not(p_string(<<"\"">>)), p_choose(p_string(<<"\\\\\\\\">>), p_string(<<"\\\\\"">>), p_anything())))), p_string(<<"\"">>)))(I,D) end, fun(Node, Idx) -> unicode:characters_to_binary(proplists:get_value(chars, Node)) end).
7
 
8
 'number'(Input, Index) ->
9
     p(Input, Index, 'number', fun(I,D) -> (p_seq(fun 'int'/2, p_optional(fun 'frac'/2), p_optional(fun 'exp'/2)))(I,D) end, fun(Node, Idx) ->
10
                                                                                                                                       case Node of
11
-                                                                                                                                          Int, ,  -> list_to_integer(binary_to_list(iolist_to_binary(Int)));
12
-                                                                                                                                          Int, Frac,  -> list_to_float(binary_to_list(iolist_to_binary(Int, Frac)));
13
-                                                                                                                                          Int, , Exp -> list_to_float(binary_to_list(iolist_to_binary(Int, ".0", Exp)));
14
-                                                                                                                                          _ -> list_to_float(binary_to_list(iolist_to_binary(Node)))
15
+                                                                                                                                          Int, ,  -> list_to_integer(binary_to_list(unicode:characters_to_binary(Int)));
16
+                                                                                                                                          Int, Frac,  -> list_to_float(binary_to_list(unicode:characters_to_binary(Int, Frac)));
17
+                                                                                                                                          Int, , Exp -> list_to_float(binary_to_list(unicode:characters_to_binary(Int, ".0", Exp)));
18
+                                                                                                                                          _ -> list_to_float(binary_to_list(unicode:characters_to_binary(Node)))
19
                                                                                                                                       end
20
                                                                                                                               end).
21
 
22
neotoma-1.7.2.tar.gz/priv/neotoma_parse.peg -> neotoma-1.7.3.tar.gz/priv/neotoma_parse.peg Changed
37
 
1
@@ -3,7 +3,7 @@
2
 rules <- space? declaration_sequence space? code_block? space?
3
 `
4
   RootRule = verify_rules(),
5
-  Rules = iolist_to_binary(lists:map(fun(R) -> R, "\n\n" end, lists:nth(2, Node))),
6
+  Rules = unicode:characters_to_binary(lists:map(fun(R) -> R, "\n\n" end, lists:nth(2, Node))),
7
   Code = case lists:nth(4, Node) of
8
              {code, Block} -> Block;
9
              _ -> 
10
@@ -141,7 +141,7 @@
11
 
12
 nonterminal <- alpha_char alphanumeric_char*
13
 `
14
-  Symbol = iolist_to_binary(Node),
15
+  Symbol = unicode:characters_to_binary(Node),
16
   add_nt(Symbol, Idx),
17
   {nonterminal, Symbol}
18
 `;
19
@@ -163,7 +163,7 @@
20
 `
21
   used_combinator(p_string),
22
   lists:flatten("p_string(<<\"",
23
-   escape_string(binary_to_list(iolist_to_binary(proplists:get_value(string, Node)))),
24
+   escape_string(unicode:characters_to_list(proplists:get_value(string, Node))),
25
    "\">>)")
26
 `;
27
 
28
@@ -175,7 +175,7 @@
29
 `
30
   used_combinator(p_charclass),
31
   "p_charclass(<<\"",
32
-   escape_string(binary_to_list(iolist_to_binary(proplists:get_value(characters, Node)))),
33
+   escape_string(unicode:characters_to_list(proplists:get_value(characters, Node))),
34
    "\">>)"
35
 `;
36
 
37
neotoma-1.7.2.tar.gz/src/neotoma.erl -> neotoma-1.7.3.tar.gz/src/neotoma.erl Changed
10
 
1
@@ -84,7 +84,7 @@
2
      "-spec file(file:name()) -> any().\n",
3
      "file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end.\n\n",
4
      "-spec parse(binary() | list()) -> any().\n",
5
-     "parse(List) when is_list(List) -> parse(list_to_binary(List));\n",
6
+     "parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List));\n",
7
      "parse(Input) when is_binary(Input) ->\n",
8
      "  _ = setup_memo(),\n",
9
      "  Result = case '",RootRule,"'(Input,{{line,1},{column,1}}) of\n",
10
neotoma-1.7.2.tar.gz/src/neotoma_parse.erl -> neotoma-1.7.3.tar.gz/src/neotoma_parse.erl Changed
46
 
1
@@ -116,7 +116,7 @@
2
 file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end.
3
 
4
 -spec parse(binary() | list()) -> any().
5
-parse(List) when is_list(List) -> parse(list_to_binary(List));
6
+parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List));
7
 parse(Input) when is_binary(Input) ->
8
   _ = setup_memo(),
9
   Result = case 'rules'(Input,{{line,1},{column,1}}) of
10
@@ -129,7 +129,7 @@
11
 'rules'(Input, Index) ->
12
   p(Input, Index, 'rules', fun(I,D) -> (p_seq(p_optional(fun 'space'/2), fun 'declaration_sequence'/2, p_optional(fun 'space'/2), p_optional(fun 'code_block'/2), p_optional(fun 'space'/2)))(I,D) end, fun(Node, _Idx) ->
13
   RootRule = verify_rules(),
14
-  Rules = iolist_to_binary(lists:map(fun(R) -> R, "\n\n" end, lists:nth(2, Node))),
15
+  Rules = unicode:characters_to_binary(lists:map(fun(R) -> R, "\n\n" end, lists:nth(2, Node))),
16
   Code = case lists:nth(4, Node) of
17
              {code, Block} -> Block;
18
              _ -> 
19
@@ -288,7 +288,7 @@
20
 -spec 'nonterminal'(input(), index()) -> parse_result().
21
 'nonterminal'(Input, Index) ->
22
   p(Input, Index, 'nonterminal', fun(I,D) -> (p_seq(fun 'alpha_char'/2, p_zero_or_more(fun 'alphanumeric_char'/2)))(I,D) end, fun(Node, Idx) ->
23
-  Symbol = iolist_to_binary(Node),
24
+  Symbol = unicode:characters_to_binary(Node),
25
   add_nt(Symbol, Idx),
26
   {nonterminal, Symbol}
27
  end).
28
@@ -314,7 +314,7 @@
29
   p(Input, Index, 'quoted_string', fun(I,D) -> (p_choose(fun 'single_quoted_string'/2, fun 'double_quoted_string'/2))(I,D) end, fun(Node, _Idx) ->
30
   used_combinator(p_string),
31
   lists:flatten("p_string(<<\"",
32
-   escape_string(binary_to_list(iolist_to_binary(proplists:get_value(string, Node)))),
33
+   escape_string(unicode:characters_to_list(proplists:get_value(string, Node))),
34
    "\">>)")
35
  end).
36
 
37
@@ -331,7 +331,7 @@
38
   p(Input, Index, 'character_class', fun(I,D) -> (p_seq(p_string(<<"">>), p_label('characters', p_one_or_more(p_seq(p_not(p_string(<<"">>)), p_choose(p_seq(p_string(<<"\\\\">>), p_anything()), p_seq(p_not(p_string(<<"\\\\">>)), p_anything()))))), p_string(<<"">>)))(I,D) end, fun(Node, _Idx) ->
39
   used_combinator(p_charclass),
40
   "p_charclass(<<\"",
41
-   escape_string(binary_to_list(iolist_to_binary(proplists:get_value(characters, Node)))),
42
+   escape_string(unicode:characters_to_list(proplists:get_value(characters, Node))),
43
    "\">>)"
44
  end).
45
 
46
neotoma-1.7.2.tar.gz/src/neotoma_parse.erl.safe -> neotoma-1.7.3.tar.gz/src/neotoma_parse.erl.safe Changed
10
 
1
@@ -116,7 +116,7 @@
2
 file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end.
3
 
4
 -spec parse(binary() | list()) -> any().
5
-parse(List) when is_list(List) -> parse(list_to_binary(List));
6
+parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List));
7
 parse(Input) when is_binary(Input) ->
8
   setup_memo(),
9
   Result = case 'rules'(Input,{{line,1},{column,1}}) of
10
neotoma-1.7.2.tar.gz/test/test_combinators.erl -> neotoma-1.7.3.tar.gz/test/test_combinators.erl Changed
10
 
1
@@ -99,3 +99,8 @@
2
 column_test() ->
3
     ?assertEqual(2, neotoma_peg:column({{line,1},{column,2}})).
4
 
5
+utf8_string_test_() ->
6
+    
7
+     ?_assertEqual({<<"世界">>, <<"def">>,{{line,1},{column,3}}}, (neotoma_peg:p_string(<<"世界">>))(<<"世界def">>,?STARTINDEX)),
8
+     ?_assertEqual({fail,{expected, {string, <<"世界">>}, ?STARTINDEX}}, (neotoma_peg:p_string(<<"世界">>))(<<"界世abc">>,?STARTINDEX))
9
+    .
10
neotoma-1.7.3.tar.gz/test/test_parse.erl Added
21
 
1
@@ -0,0 +1,19 @@
2
+-module(test_parse).
3
+-include_lib("eunit/include/eunit.hrl").
4
+
5
+parser_test() ->
6
+    % so we don't have to copy test.peg to .eunit
7
+    Data = "rule <- .+;",
8
+    file:write_file("test_parser.peg", io_lib:fwrite("~s\n", Data)),
9
+    neotoma:file("test_parser.peg"),
10
+    compile:file("test_parser.erl", ),
11
+    try 
12
+        TestString =  19990,30028,32,102,111,111,
13
+        Result = test_parser:parse(TestString),
14
+        ?assertEqual(6, length(Result)),
15
+        StringResult = lists:flatten(io_lib:format("~ts", Result)),
16
+        ?assertEqual(TestString, StringResult)
17
+    catch
18
+        _:_  -> ?assert(false)
19
+    end.
20
+
21
neotoma-1.7.2.tar.gz/test/test_suite.erl -> neotoma-1.7.3.tar.gz/test/test_suite.erl Changed
7
 
1
@@ -3,4 +3,4 @@
2
 -include_lib("eunit/include/eunit.hrl").
3
 
4
 all_test_() ->
5
-  {module, test_combinators},{module, test_memoization}.
6
+  {module, test_combinators},{module, test_memoization},{module, test_parse}.
7