Skip to content

Commit

Permalink
Limit the warning suppression to combinator and support functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
seancribbs committed Nov 1, 2009
1 parent 86e0957 commit d712578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/peg_gen.erl
Expand Up @@ -53,7 +53,7 @@ generate_module_attrs(ModName) ->
% some way, but hides warnings about unused parser combinators.
% In a future version we should just emit the used combinators,
% excluding the rest.
"-compile(nowarn_unused_function).\n\n",
"-compile({nowarn_unused_function,[p/4, p/5, p_eof/0, p_optional/1, p_not/1, p_assert/1, p_seq/1, p_and/1, p_choose/1, p_zero_or_more/1, p_one_or_more/1, p_label/2, p_string/1, p_anything/0, p_charclass/1]}).\n\n",
"file(Filename) -> {ok, Bin} = file:read_file(Filename), parse(binary_to_list(Bin)).\n\n",
"parse(Input) ->\n",
" setup_memo('", atom_to_list(ModName),"'),\n",
Expand Down
6 changes: 3 additions & 3 deletions src/peg_meta.erl
@@ -1,12 +1,12 @@
-module(peg_meta).
-export([parse/1,file/1]).
-compile(nowarn_unused_function).
-compile({nowarn_unused_function,[p/4, p/5, p_eof/0, p_optional/1, p_not/1, p_assert/1, p_seq/1, p_and/1, p_choose/1, p_zero_or_more/1, p_one_or_more/1, p_label/2, p_string/1, p_anything/0, p_charclass/1]}).

file(Filename) -> {ok, Bin} = file:read_file(Filename), parse(binary_to_list(Bin)).

parse(Input) ->
setup_memo(peg_meta),
Result = case rules(Input,{{line,1},{column,1}}) of
setup_memo('peg_meta'),
Result = case 'rules'(Input,{{line,1},{column,1}}) of
{AST, [], _Index} -> AST;
Any -> Any
end,
Expand Down

0 comments on commit d712578

Please sign in to comment.