Projects
Kolab:Winterfell
erlang-neotoma
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
erlang-neotoma.spec
Changed
@@ -4,16 +4,16 @@ Name: erlang-%{realname} -Version: 1.7.2 +Version: 1.7.3 Release: 1%{?dist} Summary: Erlang library and packrat parser-generator for parsing expression grammars Group: Development/Languages License: MIT -URL: http://github.com/%{upstream}/%{realname} -%if 0%{?el7}%{?fedora} -VCS: scm:git:https://github.com/%{upstream}/%{realname}.git -%endif -Source0: https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz +URL: http://github.com/seancribbs/neotoma + +# wget --content-disposition https://github.com/seancribbs/neotoma/archive/1.7.3.tar.gz +Source0: %{realname}-%{version}.tar.gz + BuildRequires: erlang-rebar # ets:insert/2 ( >= R12B-5 ) # ets:insert_new/2 ( >= R12B-5 )
View file
neotoma-1.7.2.tar.gz/.travis.yml -> neotoma-1.7.3.tar.gz/.travis.yml
Changed
@@ -2,9 +2,12 @@ notifications: disabled: true otp_release: + - 17.0 + - 17.3 + - 17.4 + - R16B02 + - R16B01 + - R16B - R15B02 - R15B01 - R15B - - R14B04 - - R14B03 - - R14B02
View file
neotoma-1.7.2.tar.gz/README.textile -> neotoma-1.7.3.tar.gz/README.textile
Changed
@@ -1,5 +1,7 @@ h1. Neotoma +!https://travis-ci.org/seancribbs/neotoma.svg?branch=master!:https://travis-ci.org/seancribbs/neotoma + h2. About Neotoma is a packrat parser-generator for Erlang for Parsing Expression Grammars (PEGs).
View file
neotoma-1.7.2.tar.gz/extra/csv.erl -> neotoma-1.7.3.tar.gz/extra/csv.erl
Changed
@@ -41,7 +41,7 @@ end). 'field'(Input, Index) -> - 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). + 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). 'quoted_field'(Input, Index) -> 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) ->
View file
neotoma-1.7.2.tar.gz/extra/json.erl -> neotoma-1.7.3.tar.gz/extra/json.erl
Changed
@@ -45,15 +45,15 @@ end). 'string'(Input, Index) -> - 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). + 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). 'number'(Input, Index) -> 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) -> case Node of - [Int, [], []] -> list_to_integer(binary_to_list(iolist_to_binary(Int))); - [Int, Frac, []] -> list_to_float(binary_to_list(iolist_to_binary([Int, Frac]))); - [Int, [], Exp] -> list_to_float(binary_to_list(iolist_to_binary([Int, ".0", Exp]))); - _ -> list_to_float(binary_to_list(iolist_to_binary(Node))) + [Int, [], []] -> list_to_integer(binary_to_list(unicode:characters_to_binary(Int))); + [Int, Frac, []] -> list_to_float(binary_to_list(unicode:characters_to_binary([Int, Frac]))); + [Int, [], Exp] -> list_to_float(binary_to_list(unicode:characters_to_binary([Int, ".0", Exp]))); + _ -> list_to_float(binary_to_list(unicode:characters_to_binary(Node))) end end).
View file
neotoma-1.7.2.tar.gz/priv/neotoma_parse.peg -> neotoma-1.7.3.tar.gz/priv/neotoma_parse.peg
Changed
@@ -3,7 +3,7 @@ rules <- space? declaration_sequence space? code_block? space? ` RootRule = verify_rules(), - Rules = iolist_to_binary(lists:map(fun(R) -> [R, "\n\n"] end, lists:nth(2, Node))), + Rules = unicode:characters_to_binary(lists:map(fun(R) -> [R, "\n\n"] end, lists:nth(2, Node))), Code = case lists:nth(4, Node) of {code, Block} -> Block; _ -> [] @@ -141,7 +141,7 @@ nonterminal <- alpha_char alphanumeric_char* ` - Symbol = iolist_to_binary(Node), + Symbol = unicode:characters_to_binary(Node), add_nt(Symbol, Idx), {nonterminal, Symbol} `; @@ -163,7 +163,7 @@ ` used_combinator(p_string), lists:flatten(["p_string(<<\"", - escape_string(binary_to_list(iolist_to_binary(proplists:get_value(string, Node)))), + escape_string(unicode:characters_to_list(proplists:get_value(string, Node))), "\">>)"]) `; @@ -175,7 +175,7 @@ ` used_combinator(p_charclass), ["p_charclass(<<\"[", - escape_string(binary_to_list(iolist_to_binary(proplists:get_value(characters, Node)))), + escape_string(unicode:characters_to_list(proplists:get_value(characters, Node))), "]\">>)"] `;
View file
neotoma-1.7.2.tar.gz/src/neotoma.erl -> neotoma-1.7.3.tar.gz/src/neotoma.erl
Changed
@@ -84,7 +84,7 @@ ["-spec file(file:name()) -> any().\n", "file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end.\n\n", "-spec parse(binary() | list()) -> any().\n", - "parse(List) when is_list(List) -> parse(list_to_binary(List));\n", + "parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List));\n", "parse(Input) when is_binary(Input) ->\n", " _ = setup_memo(),\n", " Result = case '",RootRule,"'(Input,{{line,1},{column,1}}) of\n",
View file
neotoma-1.7.2.tar.gz/src/neotoma_parse.erl -> neotoma-1.7.3.tar.gz/src/neotoma_parse.erl
Changed
@@ -116,7 +116,7 @@ file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end. -spec parse(binary() | list()) -> any(). -parse(List) when is_list(List) -> parse(list_to_binary(List)); +parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List)); parse(Input) when is_binary(Input) -> _ = setup_memo(), Result = case 'rules'(Input,{{line,1},{column,1}}) of @@ -129,7 +129,7 @@ 'rules'(Input, Index) -> 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) -> RootRule = verify_rules(), - Rules = iolist_to_binary(lists:map(fun(R) -> [R, "\n\n"] end, lists:nth(2, Node))), + Rules = unicode:characters_to_binary(lists:map(fun(R) -> [R, "\n\n"] end, lists:nth(2, Node))), Code = case lists:nth(4, Node) of {code, Block} -> Block; _ -> [] @@ -288,7 +288,7 @@ -spec 'nonterminal'(input(), index()) -> parse_result(). 'nonterminal'(Input, Index) -> 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) -> - Symbol = iolist_to_binary(Node), + Symbol = unicode:characters_to_binary(Node), add_nt(Symbol, Idx), {nonterminal, Symbol} end). @@ -314,7 +314,7 @@ 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) -> used_combinator(p_string), lists:flatten(["p_string(<<\"", - escape_string(binary_to_list(iolist_to_binary(proplists:get_value(string, Node)))), + escape_string(unicode:characters_to_list(proplists:get_value(string, Node))), "\">>)"]) end). @@ -331,7 +331,7 @@ 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) -> used_combinator(p_charclass), ["p_charclass(<<\"[", - escape_string(binary_to_list(iolist_to_binary(proplists:get_value(characters, Node)))), + escape_string(unicode:characters_to_list(proplists:get_value(characters, Node))), "]\">>)"] end).
View file
neotoma-1.7.2.tar.gz/src/neotoma_parse.erl.safe -> neotoma-1.7.3.tar.gz/src/neotoma_parse.erl.safe
Changed
@@ -116,7 +116,7 @@ file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end. -spec parse(binary() | list()) -> any(). -parse(List) when is_list(List) -> parse(list_to_binary(List)); +parse(List) when is_list(List) -> parse(unicode:characters_to_binary(List)); parse(Input) when is_binary(Input) -> setup_memo(), Result = case 'rules'(Input,{{line,1},{column,1}}) of
View file
neotoma-1.7.2.tar.gz/test/test_combinators.erl -> neotoma-1.7.3.tar.gz/test/test_combinators.erl
Changed
@@ -99,3 +99,8 @@ column_test() -> ?assertEqual(2, neotoma_peg:column({{line,1},{column,2}})). +utf8_string_test_() -> + [ + ?_assertEqual({<<"世界">>, <<"def">>,{{line,1},{column,3}}}, (neotoma_peg:p_string(<<"世界">>))(<<"世界def">>,?STARTINDEX)), + ?_assertEqual({fail,{expected, {string, <<"世界">>}, ?STARTINDEX}}, (neotoma_peg:p_string(<<"世界">>))(<<"界世abc">>,?STARTINDEX)) + ].
View file
neotoma-1.7.3.tar.gz/test/test_parse.erl
Added
@@ -0,0 +1,19 @@ +-module(test_parse). +-include_lib("eunit/include/eunit.hrl"). + +parser_test() -> + % so we don't have to copy test.peg to .eunit + Data = "rule <- .+;", + file:write_file("test_parser.peg", io_lib:fwrite("~s\n", [Data])), + neotoma:file("test_parser.peg"), + compile:file("test_parser.erl", []), + try + TestString = [19990,30028,32,102,111,111], + Result = test_parser:parse(TestString), + ?assertEqual(6, length(Result)), + StringResult = lists:flatten(io_lib:format("~ts", [Result])), + ?assertEqual(TestString, StringResult) + catch + _:_ -> ?assert(false) + end. +
View file
neotoma-1.7.2.tar.gz/test/test_suite.erl -> neotoma-1.7.3.tar.gz/test/test_suite.erl
Changed
@@ -3,4 +3,4 @@ -include_lib("eunit/include/eunit.hrl"). all_test_() -> - [{module, test_combinators},{module, test_memoization}]. + [{module, test_combinators},{module, test_memoization},{module, test_parse}].
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.